This commit is contained in:
chikyun.kim
2018-10-29 09:53:15 +09:00
parent 28cde78186
commit 0878e80f14
10 changed files with 208 additions and 44 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace FCOMMON
{
public static partial class DBM
{
public static int getAuth_Purchase(string uid)
{
return getAuth("purchase", uid);
}
public static int getAuth_Purchase()
{
return getAuth("purchase", info.Login.no);
}
public static int getAuth(string field,string uid)
{
var cn = getCn();
cn.Open();
int retval = 0;
string sql = string.Format("select isnull([{0}],0) from Auth where [user]= '{1}'",field,uid);
var cmd = new SqlCommand(sql, cn);
var rdr = cmd.ExecuteScalar();
if(rdr != null )
retval = int.Parse(rdr.ToString());
cn.Close();
cn.Dispose();
return retval;
}
}
}

View File

@@ -6,7 +6,7 @@ using System.Data.SqlClient;
namespace FCOMMON
{
public static class DBM
public static partial class DBM
{
public static SqlConnection getCn()
{
@@ -72,6 +72,7 @@ namespace FCOMMON
return retval;
}
public static sItemInfo getItemInfo(int idx)
{
var cn = getCn();

View File

@@ -45,6 +45,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Auth.cs" />
<Compile Include="DataBaseManager.cs" />
<Compile Include="fBase.cs">
<SubType>Form</SubType>