public string InsertUpdateLog(SYS_tblActionLogDTO actionLog) { string result = ""; result = db.sExecuteSQL("SYS_spfrmActionLog", new string[] { "Activity", "Username", "LanguageID", "FullName", "ComputerName", "AccountWindows", "ActionVN", "ActionEN", "FunctionID", "FunctionNameVN", "FunctionNameEN", "IPLAN", "IPWAN", "MacAddress", "DescriptionVN", "DescriptionEN" }, new object[] { actionLog.Activity, actionLog.UserID, actionLog.LanguageID, actionLog.FullName, actionLog.ComputerName, actionLog.AccountWindows, actionLog.ActionVN, actionLog.ActionEN, actionLog.FunctionID, actionLog.FunctionNameVN, actionLog.FunctionNameEN, actionLog.IPLAN, actionLog.IPWAN, actionLog.MacAddress, actionLog.DescriptionVN, actionLog.DescriptionEN }); if (!string.IsNullOrEmpty(result)) { logger.Error(result); } return(result); }
public DataTable LoadAllData(string username, string language_id, string group_id) { SYS_tblActionLogDTO log = new SYS_tblActionLogDTO(); log.Activity = "Insert"; log.Username = username; log.LanguageID = language_id; log.ActionVN = "Tải Tất Cả Dữ Liệu"; log.ActionEN = "Load All Data"; log.FunctionID = "10"; log.DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu người dùng.", username); log.DescriptionEN = string.Format("Account '{0}' downloaded successfully data of users.", username); this.InsertActionLog(log); return(db.GetDataTable("SYS_spfrmUser", new string[] { "Activity", "Username", "LanguageID", "GroupID" }, new object[] { "LoadAllData", log.Username, log.LanguageID, group_id })); }
public async static Task <ResponseItem> InsertUpdateLog(SYS_tblActionLogDTO item) { ResponseItem result = new ResponseItem(); try { string url = string.Format(@"{0}/InsertUpdateLog", GetBaseUrl()); var postData = new SYS_tblActionLogDCO { ID = item.ID, ActionVN = item.ActionVN, ActionEN = item.ActionEN, ActionTime = item.ActionTime, FunctionID = item.FunctionID, FunctionNameVN = item.FunctionNameVN, FunctionNameEN = item.FunctionNameEN, DescriptionEN = item.DescriptionEN, DescriptionVN = item.DescriptionVN, FullName = item.FullName, ComputerName = item.ComputerName, AccountWindows = item.AccountWindows, IPLAN = item.IPLAN, IPWAN = item.IPWAN, MacAddress = item.MacAddress, Activity = item.Activity, UserID = item.UserID, LanguageID = item.LanguageID }; var json_data = "{\"actionLog\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await SYS_tblActionLogDAO.InsertUpdateLog(url, json_data); } catch (Exception ex) { logger.Error(ex); result.Message = ex.Message; } return(result); }
public string InsertUser(SYS_tblUserDTO item) { string strError = ""; strError = db.sExecuteSQL("SYS_spfrmUser", new string[] { "Activity", "Username", "LanguageID", "UsernameOther", "Password", "GroupID", "EffectiveDate", "ToDate", "DateChangePass", "Locked", "LockDate", "UnlockDate", "PassNeverExpired", "ChangePassNextTime", "EmpID", "FullName", "CanNotChangePassword", "Email", "Note" }, new object[] { item.Activity, item.Username, item.LanguageID, item.UserName, item.Password, item.GroupID, item.EffectiveDate, item.ToDate, item.DateChangePass, item.Locked, item.LockDate, item.UnlockDate, item.PassNeverExpired, item.ChangePassNextTime, item.EmpID, item.FullName, item.CanNotChangePassword, item.Email, item.Note }); if (strError.Equals("")) { SYS_tblActionLogDTO log = new SYS_tblActionLogDTO(); log.Activity = item.Activity; log.Username = item.Username; log.LanguageID = item.LanguageID; log.ActionVN = "Thêm Mới"; log.ActionEN = "Insert"; log.FunctionID = "10"; log.DescriptionVN = string.Format("Tài khoản '{0}' vừa thêm mới thành công người dùng có tên tài khoản '{1}'.", item.Username, item.UserName); log.DescriptionEN = string.Format("Account '{0}' has inserted new user successfully with username is '{1}'.", item.Username, item.UserName); strError = this.InsertActionLog(log); } return(strError); }
public string InsertGroupUser(SYS_tblGroupUserDTO item) { string strError = ""; strError = db.sExecuteSQL("SYS_spfrmGroupUser", new string[] { "Activity", "Username", "LanguageID", "GroupCode", "GroupName", "Note", "Active", "IsDefault", "IsRoot" }, new object[] { item.Activity, item.Username, item.LanguageID, item.GroupCode, item.GroupName, item.Note, item.Active, item.IsDefault, item.IsRoot }); if (strError.Equals("")) { SYS_tblActionLogDTO log = new SYS_tblActionLogDTO(); log.Activity = item.Activity; log.Username = item.Username; log.LanguageID = item.LanguageID; log.ActionVN = "Thêm Mới"; log.ActionEN = "Insert"; log.FunctionID = "9"; log.DescriptionVN = string.Format("Tài khoản '{0}' vừa thêm mới thành công nhóm người dùng có mã '{1}'.", item.Username, item.GroupCode); log.DescriptionEN = string.Format("Account '{0}' has inserted new group user successfully with group code is '{1}'.", item.Username, item.GroupCode); strError = this.InsertActionLog(log); } return(strError); }
public string DeleteListGroupUser(string group_id_list, string group_code_list, string username, string language_id) { string strError = ""; strError = db.sExecuteSQL("SYS_spfrmGroupUser", new string[] { "Activity", "Username", "LanguageID", "GroupIDList" }, new object[] { "DeleteList", username, language_id, group_id_list }); if (strError.Equals("")) { SYS_tblActionLogDTO log = new SYS_tblActionLogDTO(); log.Activity = "Insert"; log.Username = username; log.LanguageID = language_id; log.ActionVN = "Xóa"; log.ActionEN = "Delete"; log.FunctionID = "9"; log.DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công nhóm người dùng có mã '{1}'.", username, group_code_list.Replace("$", ", ")); log.DescriptionEN = string.Format("Account '{0}' has deleted group user successfully with group code are '{1}'.", username, group_code_list.Replace("$", ", ")); strError = this.InsertActionLog(log); } return(strError); }
public string InsertActionLog(SYS_tblActionLogDTO log) { string result = ""; try { result = db.sExecuteSQL("SYS_spfrmActionLog", new string[] { "Activity", "Username", "LanguageID", "FullName", "ComputerName", "AccountWindows", "ActionVN", "ActionEN", "ActionTime", "FunctionID", "FunctionNameVN", "FunctionNameEN", "IPLAN", "IPWAN", "MacAddress", "DescriptionVN", "DescriptionEN" }, new object[] { log.Activity, log.UserID, log.LanguageID, log.FullName, log.ComputerName, log.AccountWindows, log.ActionVN, log.ActionEN, DateTime.Now, log.FunctionID, log.FunctionNameVN, log.FunctionNameEN, log.IPLAN, log.IPWAN, log.MacAddress, log.DescriptionVN, log.DescriptionEN }); if (!string.IsNullOrEmpty(result)) { logger.Error(result); } return(result); } catch (Exception ex) { result = ex.Message; logger.Error(ex); } return(result); }
private void btnLogin_Click(object sender, EventArgs e) { if (CheckLogin()) { User.UserInfo.LanguageID = icbLanguage.Properties.Items[icbLanguage.SelectedIndex].Value + ""; string _username = (chkRemember.Checked) ? Encryption.Encrypt(txtUsername.Text) : ""; string _password = (chkRemember.Checked) ? Encryption.Encrypt(txtPassword.Text) : ""; new IO().Write("Initialize", "Username", _username); new IO().Write("Initialize", "Password", _password); this.DialogResult = System.Windows.Forms.DialogResult.OK; SYS_tblActionLogDTO log = new SYS_tblActionLogDTO(); log.Activity = "Insert"; log.Username = txtUsername.Text; log.ActionVN = "Đăng Nhập"; log.ActionEN = "Login"; log.FunctionID = null; log.FunctionNameEN = log.ActionEN; log.FunctionNameVN = log.ActionVN; log.DescriptionEN = string.Format("Account '{0}' has logined to system at {1}.", txtUsername.Text, DateTime.Now); log.DescriptionVN = string.Format("Tài khoản '{0}' vừa đăng nhập vào hệ thống vào lúc {1}.", txtUsername.Text, DateTime.Now); busUser.InsertActionLog(log); } }
public string InsertActionLog(SYS_tblActionLogDTO log) { return(dao.InsertActionLog(log)); }
public async static Task <SYS_tblUserDRO> DeleteUser(string user_code_list, string username, string language_id, SYS_tblActionLogDTO actionLog) { SYS_tblUserDRO result = new SYS_tblUserDRO(); try { string url = string.Format(@"{0}/DeleteUser?Username={1}&LanguageID={2}&UserCodeList={3}", GetBaseUrl(), username, language_id, user_code_list); result = await SYS_tblUserDAO.DeleteUser(url); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <PRO_tblWarehouseDRO> GetAllWarehouses(string username, string language_id, bool is_combobox, string store_id, string province_id, string district_id, SYS_tblActionLogDTO actionLog) { PRO_tblWarehouseDRO result = new PRO_tblWarehouseDRO(); try { string url = string.Format(@"{0}/GetAllWarehouses?Username={1}&LanguageID={2}&StoreID={3}&ProvinceID={4}&DistrictID={5}&GetCombobox={6}", GetBaseUrl(), username, language_id, store_id, province_id, district_id, is_combobox ? "True" : "False"); result = await PRO_tblWarehouseDAO.GetAllWarehouses(url); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { if (actionLog != null) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <PRO_tblStoreDRO> InsertUpdateStore(PRO_tblStoreDTO item, SYS_tblActionLogDTO actionLog) { PRO_tblStoreDRO result = new PRO_tblStoreDRO(); try { string url = string.Format(@"{0}/InsertUpdateStore", GetBaseUrl()); var postData = new PRO_tblStoreDCO { StoreID = item.StoreID, StoreCode = item.StoreCode, ShortCode = item.ShortCode, VNName = item.VNName, ENName = item.ENName, BuildDate = item.BuildDate, EndDate = item.EndDate, AddressVN = item.AddressVN, AddressEN = item.AddressEN, Phone = item.Phone, Fax = item.Fax, TaxCode = item.TaxCode, Rank = item.Rank, Used = item.Used, IsRoot = item.IsRoot, Representatives = item.Representatives, Note = item.Note, Photo = item.Photo, ProvinceID = string.IsNullOrEmpty(item.ProvinceID) ? null : item.ProvinceID, DistrictID = string.IsNullOrEmpty(item.DistrictID) ? null : item.DistrictID, UserID = item.UserID, Activity = item.Activity, LanguageID = item.LanguageID }; var json_data = "{\"store\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await PRO_tblStoreDAO.InsertUpdateStore(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <SYS_tblPermissionDRO> UpdatePermission(string username, string language_id, List <SYS_tblPermissionDTO> permissions, bool is_user, SYS_tblActionLogDTO actionLog) { SYS_tblPermissionDRO result = new SYS_tblPermissionDRO(); try { string url = string.Format("{0}/UpdatePermission", GetBaseUrl()); var json_data = "{\"Username\":\"" + username + "\",\"LanguageID\":\"" + language_id + "\",\"IsUser\":" + (is_user ? "true" : "false") + ",\"permissionList\":" + JsonConvert.SerializeObject(permissions, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await SYS_tblPermissionDAO.UpdatePermission(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <SYS_tblGroupUserDRO> InsertUpdateGroupUser(SYS_tblGroupUserDTO item, SYS_tblActionLogDTO actionLog) { SYS_tblGroupUserDRO result = new SYS_tblGroupUserDRO(); try { string url = string.Format(@"{0}/InsertUpdateGroupUser", GetBaseUrl()); var postData = new SYS_tblGroupUserDCO { GroupID = string.IsNullOrEmpty(item.GroupID) ? "0" : item.GroupID, GroupCode = item.GroupCode, VNName = item.VNName, ENName = item.ENName, Note = item.Note, IsDefault = item.IsDefault, Active = item.Active, Activity = item.Activity, UserID = item.UserID, LanguageID = item.LanguageID }; var json_data = "{\"groupUser\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await SYS_tblGroupUserDAO.InsertUpdateGroupUser(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <PRO_tblLevel2DRO> GetAllLevel2(string username, string language_id, string level1_id, bool is_combobox, SYS_tblActionLogDTO actionLog) { PRO_tblLevel2DRO result = new PRO_tblLevel2DRO(); try { string url = string.Format(@"{0}/GetAllLevel2?Username={1}&LanguageID={2}&Level1ID={3}&GetCombobox={4}", GetBaseUrl(), username, language_id, level1_id, is_combobox ? "True" : "False"); result = await PRO_tblLevel2DAO.GetAllLevel2(url); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { if (actionLog != null) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <PRO_tblStallDRO> InsertUpdateStall(PRO_tblStallDTO item, SYS_tblActionLogDTO actionLog) { PRO_tblStallDRO result = new PRO_tblStallDRO(); try { string url = string.Format(@"{0}/InsertUpdateStall", GetBaseUrl()); var postData = new PRO_tblStallDCO { StallID = item.StallID, StallCode = item.StallCode, VNName = item.VNName, ENName = item.ENName, StoreID = item.StoreID, WarehouseID = item.WarehouseID, Rank = item.Rank, Used = item.Used, Note = item.Note, UserID = item.UserID, Activity = item.Activity, LanguageID = item.LanguageID }; var json_data = "{\"stall\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await PRO_tblStallDAO.InsertUpdateStall(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public BaseDAO() { db = new SQL(); log = new SYS_tblActionLogDTO(); }
public string InsertActionLog(SYS_tblActionLogDTO log) { return(db.sExecuteSQL("SYS_spfrmActionLog", new string[] { "Activity", "Username", "LanguageID", "FullName", "ComputerName", "AccountWindows", "ActionVN", "ActionEN", "ActionTime", "FunctionID", "FunctionNameVN", "FunctionNameEN", "IPLAN", "IPWAN", "MacAddress", "DescriptionVN", "DescriptionEN" }, new object[] { log.Activity, log.Username, log.LanguageID, log.FullName, log.ComputerName, log.AccountWindows, log.ActionVN, log.ActionEN, DateTime.Now, log.FunctionID, log.FunctionNameVN, log.FunctionNameEN, log.IPLAN, log.IPWAN, log.MacAddress, log.DescriptionVN, log.DescriptionEN })); }
public async static Task <SYS_tblUserDRO> ChangeUserPassword(string username, string language_id, string password, SYS_tblActionLogDTO actionLog) { SYS_tblUserDRO result = new SYS_tblUserDRO(); try { string url = string.Format(@"{0}/ChangeUserPassword?Username={1}&LanguageID={2}&Password={3}", GetBaseUrl(), username, language_id, password); result = await SYS_tblUserDAO.ChangeUserPassword(url); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <PRO_tblLevel2DRO> DeleteLevel2(string username, string language_id, string level2_id_list, SYS_tblActionLogDTO actionLog) { PRO_tblLevel2DRO result = new PRO_tblLevel2DRO(); try { string url = string.Format(@"{0}/DeleteLevel2?Username={1}&LanguageID={2}&Level2IDList={3}", GetBaseUrl(), username, language_id, level2_id_list); result = await PRO_tblLevel2DAO.DeleteLevel2(url); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <SYS_tblUserDRO> GetAllUsers(string username, string language_id, SYS_tblActionLogDTO actionLog) { SYS_tblUserDRO result = new SYS_tblUserDRO(); try { string url = string.Format("{0}/GetAllUsers?Username={1}&LanguageID={2}", GetBaseUrl(), username, language_id); result = await SYS_tblUserDAO.GetAllUsers(url); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { if (actionLog != null) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <PRO_tblLevel2DRO> InsertUpdateLevel2(PRO_tblLevel2DTO item, SYS_tblActionLogDTO actionLog) { PRO_tblLevel2DRO result = new PRO_tblLevel2DRO(); try { string url = string.Format(@"{0}/InsertUpdateLevel2", GetBaseUrl()); var postData = new PRO_tblLevel2DCO { Level2ID = item.Level2ID, Level2Code = item.Level2Code, Level2ShortCode = item.Level2ShortCode, Level1ID = item.Level1ID, VNName = item.VNName, ENName = item.ENName, Rank = string.IsNullOrEmpty(item.Rank) ? null : item.Rank, Note = item.Note, Description = item.Description, Used = item.Used, Activity = item.Activity, UserID = item.UserID, LanguageID = item.LanguageID }; var json_data = "{\"level2\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await PRO_tblLevel2DAO.InsertUpdateLevel2(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }
public async static Task <SYS_tblUserDRO> InsertUpdateUser(SYS_tblUserDTO item, SYS_tblActionLogDTO actionLog) { SYS_tblUserDRO result = new SYS_tblUserDRO(); try { string url = string.Format(@"{0}/InsertUpdateUser", GetBaseUrl()); var postData = new SYS_tblUserDCO { Username = item.Username, Password = item.Password, GroupID = item.GroupID, GroupName = item.GroupName, EffectiveDate = item.EffectiveDate, ToDate = item.ToDate, DateChangePass = item.DateChangePass, Locked = item.Locked, LockDate = item.LockDate, UnlockDate = item.UnlockDate, PassNeverExpired = item.PassNeverExpired, ChangePassNextTime = item.ChangePassNextTime, EmpID = item.EmpID, FullName = item.FullName, Email = item.EmpID, Note = item.Note, CanNotChangePassword = item.CanNotChangePassword, Activity = item.Activity, UserID = item.UserID, LanguageID = item.LanguageID }; var json_data = "{\"user\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await SYS_tblUserDAO.InsertUpdateUser(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) { result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return(result); }