..
This commit is contained in:
@@ -9,15 +9,22 @@ namespace FCOMMON
|
||||
public static partial class DBM
|
||||
{
|
||||
|
||||
public static int getAuth_Purchase(string uid)
|
||||
public enum eAutoType
|
||||
{
|
||||
return getAuth("purchase", uid);
|
||||
purchase,
|
||||
holyday
|
||||
}
|
||||
public static int getAuth_Purchase()
|
||||
public static int getAuth(eAutoType type, string uid)
|
||||
{
|
||||
return getAuth("purchase", info.Login.no);
|
||||
return getAuth(type.ToString(), uid);
|
||||
}
|
||||
public static int getAuth(string field,string uid)
|
||||
public static int getAuth(eAutoType type)
|
||||
{
|
||||
return getAuth(type.ToString(), info.Login.no);
|
||||
}
|
||||
|
||||
|
||||
private static int getAuth(string field,string uid)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
@@ -31,6 +31,58 @@ namespace FCOMMON
|
||||
public int qty;
|
||||
}
|
||||
|
||||
public static Boolean setImageData(System.Drawing.Image img, string table, string field, int idx)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
Boolean retval = false;
|
||||
string sql = "update " + table + " set " + field + " = @data" + " where idx = @idx";
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
|
||||
System.IO.MemoryStream sm = new System.IO.MemoryStream();
|
||||
img.Save(sm, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
var buffer = sm.GetBuffer();
|
||||
sm.Dispose();
|
||||
|
||||
cmd.Parameters.Add(new SqlParameter("idx", idx));
|
||||
cmd.Parameters.Add(new SqlParameter("data", buffer));
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
retval = true;
|
||||
}catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
}
|
||||
public static System.Drawing.Image GetImageData(string table,string field,int idx)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
|
||||
string sql = "select " + field + " from "+table+" where idx = " + idx.ToString();
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
var data = cmd.ExecuteScalar() as byte[];
|
||||
System.Drawing.Bitmap bmp = null;
|
||||
if(data != null)
|
||||
{
|
||||
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
|
||||
bmp = new System.Drawing.Bitmap(ms, true);
|
||||
ms.Dispose();
|
||||
}
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return bmp;
|
||||
}
|
||||
|
||||
public static sItemInfo getLastPurchaseInfo(int idx)
|
||||
{
|
||||
var cn = getCn();
|
||||
|
||||
@@ -34,7 +34,20 @@
|
||||
<Reference Include="ArSetting.Net4">
|
||||
<HintPath>..\..\DLL\ArSetting.Net4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FarPoint.CalcEngine, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.Excel, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.Localization, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.PDF, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.PluginCalendar.WinForms, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.Win, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.Win.Chart, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="FarPoint.Win.Spread, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457, processorArchitecture=MSIL" />
|
||||
<Reference Include="GrapeCity.CalcEngine, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="GrapeCity.Spreadsheet, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="GrapeCity.Spreadsheet.Win, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457" />
|
||||
<Reference Include="GrapeCity.Win.PluginInputMan, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@@ -43,6 +56,7 @@
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Auth.cs" />
|
||||
@@ -64,6 +78,7 @@
|
||||
<Compile Include="Info.cs" />
|
||||
<Compile Include="FormUtil.cs" />
|
||||
<Compile Include="Util.cs" />
|
||||
<Compile Include="Util_Farpoint.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="fBase.resx">
|
||||
@@ -72,6 +87,7 @@
|
||||
<EmbeddedResource Include="fLovDateList.resx">
|
||||
<DependentUpon>fLovDateList.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
Reference in New Issue
Block a user