public bool SaveUserInfo(UserInfo info) { Hashtable ht = new Hashtable(); if (info.id > 0) { ht["id"] = info.id; } if (!string.IsNullOrEmpty(info.Password)) { ht["Password"] = StringHelper.Sha256(info.Password); } ht["UserName"] = info.UserName; ht["CompanyId"] = info.CompanyId; ht["CompanyName"] = info.CompanyName; ht["CompanyShortName"] = info.CompanyShortName; ht["LoginName"] = info.LoginName; ht["PermissonLevel"] = info.PermissonLevel; // ht["LastLoginIp"] = info.LastLoginIp; ht["IsActive"] = info.IsActive; ht["CompanyShortName"] = info.CompanyShortName; if (info.id > 0) { ht["ModifyUserId"] = info.ModifyUserId; ht["Modifytime"] = comm.GetDBDate(); return(comm.UpdateTable(ht, "users") > 0 ? true : false); } else { ht["AddUserId"] = info.AddUserId; return(comm.InsertTable(ht, "users") > 0 ? true : false); } }
public bool SaveUserInfo(UserInfo info) { Hashtable ht = new Hashtable(); if (info.id > 0) { ht["id"] = info.id; } if (!string.IsNullOrEmpty(info.UserPassword)) { ht["User_Pass"] = StringHelper.Sha256(info.UserPassword); } ht["HY_NAME"] = info.HY_NAME; ht["User_name"] = info.UserName; ht["Lever"] = info.Lever; if (info.id > 0) { return(comm.UpdateTable(ht, "users") > 0 ? true : false); } else { return(comm.InsertTable(ht, "users") > 0 ? true : false); } }
public int SaveInputData(IList <Hashtable> dataList, ref IList <string> snoList) { int id = 0; int rs = 0; foreach (Hashtable ht in dataList) { id = Convert.ToInt32(ht["id"]); if (id > 0) { rs += comm.UpdateTable(ht, "InputWork"); } else { ht["SNo"] = GetMaxSno(ht["VoyageNo"].ToString(), ht["I_E_FLAG"].ToString(), ht["InputDate"].ToString()); rs += comm.InsertTable(ht, "InputWork", "id"); } snoList.Add(ht["TradeType"].ToString() + "_" + ht["SNo"].ToString()); } return(rs); }