udpate login.html
This commit is contained in:
@@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Data.SqlClient;
|
||||
using System.Windows.Forms;
|
||||
using FCOMMON.Models;
|
||||
using System.Data;
|
||||
|
||||
namespace FCOMMON
|
||||
{
|
||||
@@ -17,21 +19,124 @@ namespace FCOMMON
|
||||
return cn;
|
||||
}
|
||||
|
||||
public struct sItemInfo
|
||||
|
||||
public static UserModel GetUserInfo(string uid)
|
||||
{
|
||||
public int idx;
|
||||
public string sid;
|
||||
public string model;
|
||||
public string supply;
|
||||
public string name;
|
||||
public string unit;
|
||||
public float scale;
|
||||
public string price;
|
||||
public int supplyidx;
|
||||
public string project;
|
||||
public int qty;
|
||||
var retval = new UserModel();
|
||||
var cn = getCn();
|
||||
|
||||
var sql = "select * from Users where id = @id";
|
||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("id", SqlDbType.VarChar).Value = uid;
|
||||
cn.Open();
|
||||
var rdr = cmd.ExecuteReader();
|
||||
var cnt = 0;
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.name = rdr["name"].ToString();
|
||||
retval.password = rdr["password"].ToString();
|
||||
retval.id = rdr["id"].ToString();
|
||||
retval.email = rdr["email"].ToString();
|
||||
retval.hp = rdr["email"].ToString();
|
||||
retval.tel = rdr["tel"].ToString();
|
||||
retval.grade = rdr["grade"].ToString();
|
||||
cnt += 1;
|
||||
}
|
||||
|
||||
cn.Dispose();
|
||||
if (cnt == 0) return null;
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static UserGroupModel GetUserGroup(string gcode)
|
||||
{
|
||||
var retval = new UserGroupModel();
|
||||
var cn = getCn();
|
||||
|
||||
var sql = "select * from UserGroup where gcode = @gcode";
|
||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = gcode;
|
||||
cn.Open();
|
||||
var rdr = cmd.ExecuteReader();
|
||||
var cnt = 0;
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.gcode = rdr["gcode"].ToString();
|
||||
retval.name = rdr["dept"].ToString();
|
||||
cnt += 1;
|
||||
}
|
||||
cn.Dispose();
|
||||
if (cnt == 0) return null;
|
||||
return retval;
|
||||
}
|
||||
/// <summary>
|
||||
/// 입력된 id의 그룹정보를 반환
|
||||
/// </summary>
|
||||
/// <param name="gcode"></param>
|
||||
/// <param name="uid"></param>
|
||||
/// <returns></returns>
|
||||
public static GroupUserModel GetGroupUser(string gcode, string uid)
|
||||
{
|
||||
var retval = new GroupUserModel();
|
||||
var cn = getCn();
|
||||
|
||||
var sql = "select * from EETGW_GroupUser where gcode = @gcode and uid = @uid";
|
||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("uid", SqlDbType.VarChar).Value = uid;
|
||||
cn.Open();
|
||||
var rdr = cmd.ExecuteReader();
|
||||
var cnt = 0;
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.Gcode = rdr["gcode"].ToString();
|
||||
retval.uid = rdr["uid"].ToString();
|
||||
retval.level = int.Parse(rdr["level"]?.ToString() ?? "0");
|
||||
retval.Process = rdr["Process"].ToString();
|
||||
cnt += 1;
|
||||
}
|
||||
|
||||
|
||||
cn.Dispose();
|
||||
if (cnt == 0) return null;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
public static List<UserGroupModel> GetUserGroups()
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
List<UserGroupModel> retval = new List<UserGroupModel>();
|
||||
var sql = " select gcode,dept,permission,managerinfo,devinfo,usemail" +
|
||||
" from UserGroup " +
|
||||
" order by usemail desc,dept";
|
||||
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
try
|
||||
{
|
||||
var rdr = cmd.ExecuteReader();
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.Add(new UserGroupModel
|
||||
{
|
||||
gcode = rdr["gcode"]?.ToString() ?? string.Empty,
|
||||
name = rdr["dept"]?.ToString() ?? string.Empty,
|
||||
perm = int.Parse(rdr["permission"]?.ToString() ?? "0"),
|
||||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
public static List<string> GetItemStorageList()
|
||||
{
|
||||
|
||||
@@ -489,12 +594,12 @@ namespace FCOMMON
|
||||
|
||||
}
|
||||
|
||||
public static sItemInfo getLastPurchaseInfo(int idx)
|
||||
public static ItemModel getLastPurchaseInfo(int idx)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new sItemInfo();
|
||||
var retval = new ItemModel();
|
||||
retval.idx = -1;
|
||||
|
||||
string sql = "select isnull(max(idx),-1) from Purchase where pumidx = " + idx.ToString();
|
||||
@@ -530,12 +635,12 @@ namespace FCOMMON
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static sItemInfo getLastPurchaseCRInfo(int idx)
|
||||
public static ItemModel getLastPurchaseCRInfo(int idx)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new sItemInfo();
|
||||
var retval = new ItemModel();
|
||||
retval.idx = -1;
|
||||
|
||||
string sql = "select isnull(max(idx),-1) from EETGW_PurchaseCR WITH (nolock) where pumidx = " + idx.ToString();
|
||||
@@ -679,12 +784,12 @@ namespace FCOMMON
|
||||
return cnt == 1;
|
||||
}
|
||||
|
||||
public static sItemInfo getItemInfo(int idx)
|
||||
public static ItemModel getItemInfo(int idx)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new sItemInfo();
|
||||
var retval = new ItemModel();
|
||||
retval.idx = -1;
|
||||
|
||||
string sql = "select * from Items WITH (nolock) where gcode='" + FCOMMON.info.Login.gcode + "' and idx = " + idx.ToString();
|
||||
@@ -709,7 +814,7 @@ namespace FCOMMON
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
}
|
||||
public static int addItemInfo(sItemInfo info)
|
||||
public static int addItemInfo(ItemModel info)
|
||||
{
|
||||
int retval = -1;
|
||||
var cn = getCn();
|
||||
@@ -748,12 +853,12 @@ namespace FCOMMON
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
}
|
||||
public static sItemInfo getItemInfo(string sid)
|
||||
public static ItemModel getItemInfo(string sid)
|
||||
{
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new sItemInfo();
|
||||
var retval = new ItemModel();
|
||||
retval.idx = -1;
|
||||
|
||||
string sql = "select * from Items WITH (nolock) where [gcode] = '" + FCOMMON.info.Login.gcode + "' and [sid] = '" + sid + "'";
|
||||
@@ -796,7 +901,7 @@ namespace FCOMMON
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new sItemInfo();
|
||||
var retval = new ItemModel();
|
||||
retval.idx = -1;
|
||||
|
||||
string sql = "select [id],[name],([name] +'(' +[id] +')') as dispName,isnull([dept],'') as dept,isnull(grade,'') as grade," +
|
||||
@@ -908,7 +1013,7 @@ namespace FCOMMON
|
||||
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
var sql = "select isnull(code,''),isnull(memo,''),isnull(svalue,''),isnull(svalue2,'')"+
|
||||
var sql = "select isnull(code,''),isnull(memo,''),isnull(svalue,''),isnull(svalue2,'')" +
|
||||
" from Common WITH (nolock) " +
|
||||
" where gcode='" + FCOMMON.info.Login.gcode + "' and Grp = '{0}' and svalue = '{1}'";
|
||||
|
||||
|
||||
@@ -36,9 +36,6 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="arControl.Net4">
|
||||
<HintPath>..\..\Sub\arCtl\obj\Debug\arControl.Net4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ArSetting.Net4">
|
||||
<HintPath>..\..\DLL\ArSetting.Net4.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -176,6 +173,10 @@
|
||||
<Compile Include="IMyContract.cs" />
|
||||
<Compile Include="ISO8601.cs" />
|
||||
<Compile Include="keyValuedataTable.cs" />
|
||||
<Compile Include="Models\GroupUserModel.cs" />
|
||||
<Compile Include="Models\ItemModel.cs" />
|
||||
<Compile Include="Models\UserModel.cs" />
|
||||
<Compile Include="Models\UserGroupModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Info.cs" />
|
||||
<Compile Include="Setting.cs" />
|
||||
@@ -245,6 +246,10 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Sub\arCtl\arControl.csproj">
|
||||
<Project>{f31c242c-1b15-4518-9733-48558499fe4b}</Project>
|
||||
<Name>arControl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Sub\arftp\FTPClass.csproj">
|
||||
<Project>{150859d3-1c5d-4e20-b324-f9ebe188d893}</Project>
|
||||
<Name>FTPClass</Name>
|
||||
|
||||
12
SubProject/FCOMMON/Models/GroupUserModel.cs
Normal file
12
SubProject/FCOMMON/Models/GroupUserModel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace FCOMMON.Models
|
||||
{
|
||||
|
||||
|
||||
public class GroupUserModel
|
||||
{
|
||||
public string Gcode { get; set; }
|
||||
public string uid { get; set; }
|
||||
public string Process { get; set; }
|
||||
public int level { get; set; }
|
||||
}
|
||||
}
|
||||
17
SubProject/FCOMMON/Models/ItemModel.cs
Normal file
17
SubProject/FCOMMON/Models/ItemModel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace FCOMMON.Models
|
||||
{
|
||||
public class ItemModel
|
||||
{
|
||||
public int idx;
|
||||
public string sid;
|
||||
public string model;
|
||||
public string supply;
|
||||
public string name;
|
||||
public string unit;
|
||||
public float scale;
|
||||
public string price;
|
||||
public int supplyidx;
|
||||
public string project;
|
||||
public int qty;
|
||||
}
|
||||
}
|
||||
9
SubProject/FCOMMON/Models/UserGroupModel.cs
Normal file
9
SubProject/FCOMMON/Models/UserGroupModel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace FCOMMON.Models
|
||||
{
|
||||
public class UserGroupModel
|
||||
{
|
||||
public string gcode { get; set; }
|
||||
public string name { get; set; }
|
||||
public int perm { get; set; }
|
||||
}
|
||||
}
|
||||
19
SubProject/FCOMMON/Models/UserModel.cs
Normal file
19
SubProject/FCOMMON/Models/UserModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FCOMMON.Models
|
||||
{
|
||||
public class UserModel
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string password { get; set; }
|
||||
public string name { get; set; }
|
||||
public string grade { get; set; }
|
||||
public string email { get; set; }
|
||||
public string hp { get; set; }
|
||||
public string tel { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user