protected void Page_Load(object sender, EventArgs e) { if (IsPostBack.IsFalse()) { InitializeSession(); txtApproveBy_nc.Text = Enc.Decrypt(CurrentUserSession.UserName, ASL.STATIC.StaticInfo.encString); } else { Page.ClientScript.GetPostBackEventReference(this, String.Empty); String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"]; if (eventTarget == "SearchSalaryRule") { SalaryRuleBackup searchSalaryRule = Session[ASL.STATIC.StaticInfo.SearchSessionVarName] as SalaryRuleBackup; if (searchSalaryRule.IsNotNull()) { txtSalaryRuleID.Text = searchSalaryRule.SalaryRuleCode; grdSalaryRuleList = manager.GetAllSalaryRuleBackup(searchSalaryRule.SalaryRuleCode); if (grdSalaryRuleList.Count != 0) { chkApproved.Checked = grdSalaryRuleList[0].IsApproved; txtApprovalDate.Text = grdSalaryRuleList[0].ApprovalDate == DateTime.MinValue ? string.Empty : grdSalaryRuleList[0].ApprovalDate.ToShortDateString(); txtApproveBy_nc.Text = grdSalaryRuleList[0].ApproveBy; } } } } }
private void SetDataInControls(Users u) { try { txtUserCode.Text = u.UserCode.ToString(); txtName.Text = u.Name.ToString(); ddlEmpCode.SelectedValue = u.EmpCode; txtUserName.Text = Enc.Decrypt(u.UserName, ASL.STATIC.StaticInfo.encString); txtPassword.Attributes.Add("value", Enc.Decrypt(u.Password, ASL.STATIC.StaticInfo.encString)); txtConfirmPassword.Attributes.Add("value", Enc.Decrypt(u.Password, ASL.STATIC.StaticInfo.encString)); if (u.IsActive == 1) { chkActiveUser.Checked = true; } else { chkActiveUser.Checked = false; } if (u.IsAdmin == 1) { chkAdminUser.Checked = true; } else { chkAdminUser.Checked = false; } } catch (Exception ex) { throw (ex); } }