public UserService_Client GetClient(string UserName, string Password, string CaseId) { if (!UserAuth(UserName, Password)) { return(null); } try { string query = "SELECT * FROM Client WHERE disabled = '0' AND Case_Id = " + ClsDB.sqlEncode(CaseId); DataTable dt = new ClsDB().ExecuteDataTable(query); if (dt.Rows.Count == 1) { DataRow r = dt.Rows[0]; UserService_Client c = new UserService_Client(); c.Case_Id = ClsUtil.getStrVal(r["Case_Id"]); c.Client_Type = ClsClient.getClientType(ClsUtil.getStrVal((r["Client_Type"]))); c.First_Name = ClsUtil.getStrVal(r["First_Name"]); c.Last_Name = ClsUtil.getStrVal(r["Last_Name"]); return(c); } } catch (Exception ex) { } return(null); }
public List <UserService_Client> GetClientList(string UserName, string Password) { if (!UserAuth(UserName, Password)) { return(null); } List <UserService_Client> list = new List <UserService_Client>(); try { string query = "SELECT * FROM Client WHERE disabled = '0'"; DataTable dt = new ClsDB().ExecuteDataTable(query); for (int i = 0; i < dt.Rows.Count; ++i) { UserService_Client c = new UserService_Client(); c.Case_Id = ClsUtil.getStrVal(dt.Rows[i]["Case_Id"]); c.Client_Type = ClsClient.getClientType(ClsUtil.getStrVal((dt.Rows[i]["Client_Type"]))); c.First_Name = ClsUtil.getStrVal(dt.Rows[i]["First_Name"]); c.Last_Name = ClsUtil.getStrVal(dt.Rows[i]["Last_Name"]); list.Add(c); } } catch (Exception ex) { list.Clear(); } return(list); }