protected void Page_Load(object sender, EventArgs e) { //string DatabaseUpgradePage = "DatabaseUpgrade.aspx"; //if (Session["NeedDBUpgrade"] != null) // if (Application["NeedDBUpgrade"].Equals(true)) // HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "~/" + DatabaseUpgradePage); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { //else { //EUser dummyUser = null; //if (!WebUtils.ValidateUser(user.LoginID, user.UserPassword, false, false, out dummyUser)) //{ // HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "~/Login.aspx"); //} if (DecryptedRequest["LastURL"] != null) { string lastURL = DecryptedRequest["LastURL"].ToString(); if (!string.IsNullOrEmpty(lastURL)) { HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, System.Text.Encoding.ASCII.GetString(Convert.FromBase64String(HttpUtility.UrlDecode(lastURL)))); } } HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "~/ESS_Home.aspx"); } } else { HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "~/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { isAllowLeaveCancel = ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ESS_FUNCTION_CANCEL_LEAVE_APPLICATION).Equals("N", StringComparison.CurrentCultureIgnoreCase) ? false : true; EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } DBFilter leaveTypeFilter = new DBFilter(); { DBFilter leaveAppFilter = new DBFilter(); leaveAppFilter.add(new Match("EmpID", CurID)); DBFilter leaveCodeFilter = new DBFilter(); leaveCodeFilter.add(new IN("LeaveCodeID", "SELECT DISTINCT la.LeaveCodeID FROM " + ELeaveApplication.db.dbclass.tableName + " la", leaveAppFilter)); leaveTypeFilter.add(new IN("LeaveTypeID", "SELECT DISTINCT lc.LeaveTypeID FROM " + ELeaveCode.db.dbclass.tableName + " lc", leaveCodeFilter)); } binding = new SearchBinding(dbConn, db); binding.initValues("LeaveAppUnit", null, Values.VLLeaveUnit, null); binding.add(new DropDownVLSearchBinder(LeaveType, "l.LeaveTypeID", ELeaveType.VLLeaveType).setFilter(leaveTypeFilter)); //binding.add(new FieldDateRangeSearchBinder(LeaveAppDateFrom.TextBox, LeaveAppDateTo.TextBox, "LeaveAppDateFrom").setUseCurDate(false)); binding.init(Request.QueryString, null); info = ListFooter.ListInfo; }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); binding.add(EmpNo); binding.add(EmpAlias); binding.add(EmpEngSurname); binding.add(EmpEngOtherName); //binding.add(EmpHKID); binding.add(EmpChiFullName); binding.add(new LabelVLBinder(db, EmpGender, Values.VLGender)); //binding.add(EmpDateOfBirth); binding.add(EmpDateOfJoin); binding.add(EmpServiceDate); binding.add(EmpProbaLastDate); binding.init(Request, Session); if (CurID <= 0) { //CurID = Int32.Parse(DecryptedRequest["EmpID"]); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); binding.add(new TextBoxBinder(db, RequestOTClaimPeriodFrom.TextBox, RequestOTClaimPeriodFrom.ID)); binding.add(new TextBoxBinder(db, RequestOTClaimPeriodTo.TextBox, RequestOTClaimPeriodTo.ID)); binding.add(RequestOTClaimHourFrom); binding.add(RequestOTClaimHourTo); binding.add(RequestOTHours); binding.add(RequestOTClaimRemark); binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(Session, this.Controls); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurEmpID = user.EmpID; EmpID.Value = CurEmpID.ToString(); } }
protected void SaveLanguage_Click(object sender, EventArgs e) { PageErrors errors = PageErrors.getErrors(db, Page.Master); errors.clear(); DBFilter filter = new DBFilter(); filter.add(new Match("EmpID", CurID)); ArrayList list = EESSUser.db.select(dbConn, filter); EESSUser user = (EESSUser)list[0]; user.EmpESSLanguage = this.cbxPARAM_CODE_DEFAULT_LANGUAGE.SelectedValue; EESSUser.db.update(dbConn, user); //string redirectURL = "ESS_Home.aspx"; //WebUtils.SetSessionLanguage(Session, user); //HROne.Common.WebUtility.initLanguage(Session); WebUtils.RegisterRedirectJavaScript(this, null, HROne.Common.WebUtility.GetLocalizedStringByCode("Please re-login", "Please logout and login again to have the system language to take effect")); return; }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } }
protected void Page_Load(object sender, EventArgs e) { if (!ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ENABLE_OTCLAIM).Equals("Y", StringComparison.CurrentCultureIgnoreCase)) { return; } if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } }
protected void Page_Load(object sender, EventArgs e) { //PreRender += new EventHandler(Emp_Authorize_List_PreRender); binding = new SearchBinding(dbConn, EEmpPersonalInfo.db); //binding.add(new DropDownVLSearchBinder(EmpRequestStatus2, "R.EmpRequestStatus", VLStatusUnit)); //binding.add(new FieldDateRangeSearchBinder(EmpRequestFromDate, EmpRequestToDate, "EmpRequestCreateDate").setUseCurDate(false)); if (!ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ENABLE_OTCLAIM).Equals("Y", StringComparison.CurrentCultureIgnoreCase)) { binding.add(new DropDownVLSearchBinder(EmpRequestType, "R.EmpRequestType", EEmpRequest.VLRequestType)); } else { binding.add(new DropDownVLSearchBinder(EmpRequestType, "R.EmpRequestType", EEmpRequest.VLRequestType2)); } binding.initValues("EmpRequestType", null, EEmpRequest.VLRequestType, null); binding.initValues("EmpRequestStatus", null, EEmpRequest.VLRequestStatus, null); binding.init(Request.QueryString, null); info = ListFooter.ListInfo; EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); binding.add(RequestOTClaimPeriodFrom); binding.add(RequestOTClaimPeriodTo); binding.add(RequestOTClaimHourFrom); binding.add(RequestOTClaimHourTo); binding.add(RequestOTHours); binding.add(RequestOTClaimRemark); // Start 0000060, Miranda, 2014-07-22 binding.add(new TextBoxBinder(db, RequestOTClaimEffectiveDate.TextBox, RequestOTClaimEffectiveDate.ID)); binding.add(new TextBoxBinder(db, RequestOTClaimDateExpiry.TextBox, RequestOTClaimDateExpiry.ID)); // End 0000060, Miranda, 2014-07-22 binding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { UserID = user.EmpID; UserName = user.EmpEngFullNameWithAlias; } if (!Int32.TryParse(DecryptedRequest["TargetEmpID"], out CurEmpID)) { CurEmpID = -1; } if (!Int32.TryParse(DecryptedRequest["EmpRequestRecordID"], out CurRequestID)) { CurRequestID = -1; } EmpID.Value = CurEmpID.ToString(); if (!Page.IsPostBack) { if (UserID > 0) { loadObject(); DateTime dtFrom; if (DateTime.TryParse(RequestOTClaimPeriodFrom.Text, out dtFrom) && RequestOTClaimDateExpiry.TextBox.Text == "") { RequestOTClaimDateExpiry.Value = calExpiryDate(RequestOTClaimPeriodFrom.Text).ToString("yyyy-MM-dd"); } RequestOTClaimEffectiveDate.Value = AppUtils.ServerDateTime().ToString("yyyy-MM-dd");// Default CL Requisition effective date is today ApprovedBy.Text = UserName; } } }
protected void Page_Load(object sender, EventArgs e) { binding = new Binding(dbConn, db); binding2 = new Binding(dbConn, EmpDb); binding.add(RequestEmpID); binding.add(RequestEmpAlias); binding.add(new LabelVLBinder(db, RequestEmpMaritalStatus, Values.VLMaritalStatus)); binding.add(RequestEmpPassportNo); binding.add(RequestEmpPassportIssuedCountry); binding.add(RequestEmpPassportExpiryDate); binding.add(RequestEmpNationality); binding.add(RequestEmpHomePhoneNo); binding.add(RequestEmpMobileNo); binding.add(RequestEmpOfficePhoneNo); binding.add(RequestEmpEmail); binding.add(RequestEmpResAddr); binding.add(new LabelVLBinder(db, RequestEmpResAddrAreaCode, Values.VLArea)); binding.add(RequestEmpCorAdd); binding.add(RequestEmpCreateDate); binding2.add(EmpNo); binding2.add(EmpEngSurname); binding2.add(EmpEngOtherName); binding2.add(EmpHKID); binding2.add(EmpChiFullName); binding2.add(new LabelVLBinder(EmpDb, EmpGender, Values.VLGender)); binding2.add(EmpDateOfBirth); binding2.add(EmpDateOfJoin); binding2.add(EmpServiceDate); // Start 0000092, KuangWei, 2014-10-13 binding.add(RequestEmpPlaceOfBirth); // End 0000092, KuangWei, 2014-10-13 binding.init(Request, Session); binding2.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { UserID = user.EmpID; } if (!int.TryParse(DecryptedRequest["TargetEmpID"], out CurEmpID)) { CurEmpID = -1; } if (!int.TryParse(DecryptedRequest["EmpRequestRecordID"], out RequestID)) { RequestID = -1; } if (!int.TryParse(DecryptedRequest["EmpRequestRecordID"], out CurRequestID)) { CurRequestID = -1; } }
//protected const string AL_AUTHORIZED_BEFORE_PROBATION_MESSAGE = "Staff is under probation and not entitled to annual leave. Continue to proceed the authorization?"; protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } leaveAppBinding = new Binding(dbConn, ELeaveApplication.db); leaveAppBinding.add(EmpID); //binding.add(new LabelVLBinder(db, EmpName,"EmpID", EEmpPersonalInfo.VLEmp)); leaveAppBinding.add(new LabelVLBinder(db, LeaveCodeID, ELeaveCode.VLLeaveCode)); leaveAppBinding.add(new LabelVLBinder(db, LeaveAppUnit, Values.VLLeaveUnit)); leaveAppBinding.add(LeaveAppDateFrom); leaveAppBinding.add(LeaveAppDateTo); leaveAppBinding.add(LeaveAppTimeFrom); leaveAppBinding.add(LeaveAppTimeTo); leaveAppBinding.add(LeaveAppDays); leaveAppBinding.add(LeaveAppHours); leaveAppBinding.add(LeaveAppRemark); leaveAppBinding.add(new LabelVLBinder(db, LeaveAppHasMedicalCertificate, Values.VLTrueFalseYesNo)); leaveAppBinding.init(Request, Session); cancelBinding = new Binding(dbConn, ERequestLeaveApplicationCancel.db); cancelBinding.add(RequestLeaveAppCancelReason); cancelBinding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { UserID = user.EmpID; } if (!Int32.TryParse(DecryptedRequest["TargetEmpID"], out CurEmpID)) { CurEmpID = -1; } if (!Int32.TryParse(DecryptedRequest["EmpRequestRecordID"], out CurRequestID)) { CurRequestID = -1; } EmpID.Value = CurEmpID.ToString(); if (!Page.IsPostBack) { if (UserID > 0) { loadObject(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { m_ESSUserID = user.EmpID; } // Start 0000209, Miranda, 2015-06-11 HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); // End 0000209, Miranda, 2015-06-11 DateTime currentDate = AppUtils.ServerDateTime().Date; DBFilter empRosterTableGroupFilter = new DBFilter(); empRosterTableGroupFilter.add(new Match("ertg.EmpID", m_ESSUserID)); OR orEmpRosterTableGroupFromTerm = new OR(); orEmpRosterTableGroupFromTerm.add(new Match("ertg.EmpRosterTableGroupEffFr", "<=", currentDate)); orEmpRosterTableGroupFromTerm.add(new NullTerm("ertg.EmpRosterTableGroupEffFr")); empRosterTableGroupFilter.add(orEmpRosterTableGroupFromTerm); OR orEmpRosterTableGroupToTerm = new OR(); orEmpRosterTableGroupToTerm.add(new Match("ertg.EmpRosterTableGroupEffTo", ">=", currentDate)); orEmpRosterTableGroupToTerm.add(new NullTerm("ertg.EmpRosterTableGroupEffTo")); empRosterTableGroupFilter.add(orEmpRosterTableGroupToTerm); DBFilter RosterTableGroupIDFilter = new DBFilter(); RosterTableGroupIDFilter.add(new IN("RosterTableGroupID", "SELECT ertg.RosterTableGroupID FROM " + EEmpRosterTableGroup.db.dbclass.tableName + " ertg", empRosterTableGroupFilter)); sbinding = new SearchBinding(dbConn, ERosterClientSite.db); sbinding.add(new DropDownVLSearchBinder(RosterTableGroupID, "RosterTableGroupID", ERosterTableGroup.VLRosterTableGroup).setFilter(RosterTableGroupIDFilter)); sbinding.init(DecryptedRequest, null); RosterTableGroupID.Items[0].Text = "All"; HtmlLink cssLink = new HtmlLink(); cssLink.Href = "~/CSS/RadScheduler.css"; cssLink.Attributes.Add("rel", "stylesheet"); cssLink.Attributes.Add("type", "text/css"); Header.Controls.Add(cssLink); }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } DBFilter empTaxFilter = new DBFilter(); empTaxFilter.add(new Match("te.EmpID", CurID)); empTaxFilter.add(new Match("te.TaxEmpIsReleasePrintoutToESS", true)); empTaxFilter.add(new MatchField("TaxForm.TaxFormID", "te.TaxFormID")); //if (!IsPostBack) { DBFilter taxFormFilter = new DBFilter(); taxFormFilter.add(new Match("TaxFormType", "B")); taxFormFilter.add("TaxFormYear", false); taxFormFilter.add(new Exists("TaxEmp te", empTaxFilter)); binding.add(new DropDownVLBinder(ETaxForm.db, TaxFormID, ETaxForm.VLTaxFormYear, taxFormFilter)); } binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } }
protected void Page_Load(object sender, EventArgs e) { PreRender += new EventHandler(Emp_Beneficiaries_List_PreRender); sbinding = new SearchBinding(dbConn, sdb); sbinding.init(DecryptedRequest, null); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } EmpID.Value = CurID.ToString(); }
protected void Page_Load(object sender, EventArgs e) { binding = new SearchBinding(dbConn, db); binding.initValues("EmpRequestStatus", null, EEmpRequest.VLRequestStatus, null); binding.init(Request.QueryString, null); info = ListFooter.ListInfo; EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { bool skipAccessChecking = false; if (Session["ForceChangePassword"] != null) { if (Session["ForceChangePassword"].Equals(true)) { skipAccessChecking = true; } } if (!skipAccessChecking) { if (!WebUtils.CheckAccess(Response, Session)) { return; } } binding = new Binding(dbConn, db); binding.add(EmpID); binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } OTClaimBinding = new Binding(dbConn, EOTClaim.db); OTClaimBinding.add(EmpID); OTClaimBinding.add(OTClaimDateFrom); OTClaimBinding.add(OTClaimDateTo); OTClaimBinding.add(OTClaimTimeFrom); OTClaimBinding.add(OTClaimTimeTo); OTClaimBinding.add(OTClaimHours); OTClaimBinding.add(OTClaimRemark); OTClaimBinding.init(Request, Session); cancelBinding = new Binding(dbConn, ERequestOTClaimCancel.db); cancelBinding.add(RequestOTClaimCancelReason); cancelBinding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { UserID = user.EmpID; } if (!Int32.TryParse(DecryptedRequest["TargetEmpID"], out CurEmpID)) { CurEmpID = -1; } if (!Int32.TryParse(DecryptedRequest["EmpRequestRecordID"], out CurRequestID)) { CurRequestID = -1; } EmpID.Value = CurEmpID.ToString(); if (!Page.IsPostBack) { if (UserID > 0) { loadObject(); } } }
protected void Page_Load(object sender, EventArgs e) { EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } //DBFilter lateYearFilter = new DBFilter(); //lateYearFilter.add(new Match("EmpID", CurID)); //DBFilter empReqFilter = new DBFilter(); //empReqFilter.add(new Match("EmpID", CurID)); //empReqFilter.add(new IN("EmpRequestType", lateWaiveReqType)); //lateYearFilter.add(new IN("RequestLateWaiveID", "select EmpRequestRecordID from " + EEmpRequest.db.dbclass.tableName, empReqFilter)); sbinding = new SearchBinding(dbConn, sdb); //sbinding.add(new DropDownVLSearchBinder(Year, "Year(RequestLateWaiveCreateDate)", ERequestLateWaive.VLLateWaiveYear).setFilter(lateYearFilter)); sbinding.init(Request.QueryString, null); binding = new Binding(dbConn, sdb); //binding.add(RequestLateWaiveID); binding.add(EmpID); //binding.add(AttendanceRecordID); //binding.add(RequestLateWaiveReason); //binding.add(RequestLateWaiveCreateDate); //binding.add(EmpRequestID); //binding.add(AttendanceRecordDate); //binding.add(RosterCodeDesc); //binding.add(AttendanceRecordWorkStart); //binding.add(AttendanceRecordWorkEnd); //binding.add(AttendanceRecordActualLateMins); binding.init(Request, Session); if (!int.TryParse(DecryptedRequest["EmpRequestID"], out CurEntitleID)) { CurEntitleID = -1; } info = ListFooter.ListInfo; }
protected void Page_Load(object sender, EventArgs e) { sbinding = new SearchBinding(dbConn, sdb); //sbinding.add(new FieldDateRangeSearchBinder(RequestLateWaivePeriodFrom, RequestLateWaivePeriodTo, "AttendanceRecordDate").setUseCurDate(false)); sbinding.init(Request.QueryString, null); info = ListFooter.ListInfo; if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); //binding.add(new TextBoxBinder(db, RequestLateWaivePeriodFrom.TextBox, RequestLateWaivePeriodFrom.ID)); //binding.add(new TextBoxBinder(db, RequestLateWaivePeriodTo.TextBox, RequestLateWaivePeriodTo.ID)); //binding.add(RequestLateWaiveHourFrom); //binding.add(RequestLateWaiveHourTo); //binding.add(RequestOTHours); binding.add(RequestLateWaiveReason); binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(Session, this.Controls); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurEmpID = user.EmpID; EmpID.Value = CurEmpID.ToString(); // Start 0000112, Miranda, 2015-01-11 //// set default period is current month //DateTime now = AppUtils.ServerDateTime().Date; //DateTime firstDay = new DateTime(now.Year, now.Month, 1); //DateTime lastDay = firstDay.AddMonths(1).AddDays(-1); //// Start Miranda, 0000112, 2014-12-29 //RequestLateWaivePeriodFrom.Value = firstDay.ToString("yyyy-MM-dd"); //RequestLateWaivePeriodTo.Value = lastDay.ToString("yyyy-MM-dd"); //// End Miranda, 0000112, 2014-12-29 // End 0000112, Miranda, 2015-01-11 } }
protected void Page_Load(object sender, EventArgs e) { binding = new SearchBinding(dbConn, db); //binding.add(new DropDownVLSearchBinder(EmpRequestStatus, "EmpRequestStatus", VLStatusUnit)); binding.initValues("LeaveAppUnit", null, Values.VLLeaveUnit, null); binding.initValues("EmpRequestStatus", null, EEmpRequest.VLRequestStatus, null); //binding.add(new FieldDateRangeSearchBinder(RequestFromDate, RequestToDate, "RequestLeaveAppCreateDate").setUseCurDate(false)); binding.init(Request.QueryString, null); info = ListFooter.ListInfo; EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); // binding.add(EmpNo); binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } if (!Page.IsPostBack) { // view = loadData(info, AVCPlanDetaildb, Repeater); //add by Ben if (CurID > 0) { loadObject(); // Delete.Visible = true; } else { } // Delete.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } DBFilter leaveYearFilter = new DBFilter(); leaveYearFilter.add(new Match("EmpID", CurID)); leaveYearFilter.add(new Match("CompensationLeaveEntitleIsOTClaim", isOTClaim)); sbinding = new SearchBinding(dbConn, sdb); sbinding.add(new DropDownVLSearchBinder(Year, "Year(CompensationLeaveEntitleEffectiveDate)", ECompensationLeaveEntitle.VLLeaveEntitleYear).setFilter(leaveYearFilter));//, null, "Year(pp.PayPeriodFR)")); sbinding.init(Request.QueryString, null); binding = new Binding(dbConn, sdb); binding.add(CompensationLeaveEntitleID); binding.add(EmpID); binding.add(CompensationLeaveEntitleEffectiveDate); binding.add(CompensationLeaveEntitleDateExpiry); binding.add(CompensationLeaveEntitleClaimPeriodFrom); binding.add(CompensationLeaveEntitleClaimPeriodTo); binding.add(CompensationLeaveEntitleClaimHourFrom); binding.add(CompensationLeaveEntitleClaimHourTo); binding.add(CompensationLeaveEntitleHoursClaim); binding.add(CompensationLeaveEntitleApprovedBy); binding.add(CompensationLeaveEntitleRemark); binding.init(Request, Session); if (!int.TryParse(DecryptedRequest["CompensationLeaveEntitleID"], out CurEntitleID)) { CurEntitleID = -1; } info = ListFooter.ListInfo; }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); binding.add(AttendanceRecordID); binding.add(RequestLateWaiveReason); binding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { UserID = user.EmpID; UserName = user.EmpEngFullNameWithAlias; } if (!Int32.TryParse(DecryptedRequest["TargetEmpID"], out CurEmpID)) { CurEmpID = -1; } if (!Int32.TryParse(DecryptedRequest["EmpRequestRecordID"], out CurRequestID)) { CurRequestID = -1; } EmpID.Value = CurEmpID.ToString(); if (!Page.IsPostBack) { if (UserID > 0) { loadObject(); ApprovedBy.Text = UserName; } } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.init(Request, Session); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } sbinding = new SearchBinding(dbConn, ETimeCardRecord.db); ////binding.initValues("LeaveAppUnit", null, Values.VLLeaveUnit, null); //binding.add(new DropDownVLSearchBinder(LeaveType, "l.LeaveTypeID", ELeaveType.VLLeaveType)); ////binding.add(new FieldDateRangeSearchBinder(LeaveAppDateFrom.TextBox, LeaveAppDateTo.TextBox, "LeaveAppDateFrom").setUseCurDate(false)); sbinding.init(Request.QueryString, null); info = ListFooter.ListInfo; }
protected void Page_Load(object sender, EventArgs e) { //PreRender += new EventHandler(Emp_Authorize_List_PreRender); binding = new SearchBinding(dbConn, EEmpPersonalInfo.db); //binding.add(new FieldDateRangeSearchBinder(EmpRequestFromDate, EmpRequestToDate, "EmpRequestCreateDate").setUseCurDate(false)); // not supporting CL Requisition if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ENABLE_OTCLAIM).Equals("N", StringComparison.CurrentCultureIgnoreCase)) { binding.add(new DropDownVLSearchBinder(EmpRequestType, "R.EmpRequestType", EEmpRequest.VLRequestType)); } else { binding.add(new DropDownVLSearchBinder(EmpRequestType, "R.EmpRequestType", EEmpRequest.VLRequestType2)); } binding.initValues("EmpRequestType", null, EEmpRequest.VLRequestType, null); binding.initValues("EmpRequestApprovalHistoryStatusBefore", null, EEmpRequest.VLRequestStatus, null); binding.initValues("EmpRequestApprovalHistoryStatusAfter", null, EEmpRequest.VLRequestStatus, null); // Start 0000180, KuangWei, 2015-03-25 binding.add(new DropDownVLSearchBinder(LeaveCode, "L.LeaveCodeID", ELeaveCode.VLLeaveCode)); binding.initValues("LeaveCode", null, ELeaveCode.VLLeaveCode, null); // End 0000180, KuangWei, 2015-03-25 binding.init(Request.QueryString, null); info = ListFooter.ListInfo; EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; EmpID.Value = CurID.ToString(); } }
public static void SetSessionLanguage(HttpSessionState Session, EESSUser user) { string defaultLang = string.Empty; if (user != null) { // Start 000170, Ricky So, 2015-02-05 //if (EUser.db.select(dbConn, user)) defaultLang = user.EmpESSLanguage; // End 000170, Ricky So, 2015-02-05 } if (string.IsNullOrEmpty(defaultLang)) { try { defaultLang = ESystemParameter.getParameter(HROne.Common.WebUtility.GetDatabaseConnection(Session), ESystemParameter.PARAM_CODE_ESS_DEFAULT_LANGUAGE); } catch { //Response.Redirect("~/DatabaseConfiguration.aspx"); } } if (string.IsNullOrEmpty(defaultLang)) { defaultLang = "en"; } if (defaultLang.Equals("big5", StringComparison.CurrentCultureIgnoreCase)) { defaultLang = "zh-cht"; } else if (defaultLang.Equals("gb", StringComparison.CurrentCultureIgnoreCase)) { defaultLang = "zh-chs"; } Session.Add("lang", defaultLang); }
protected void Page_Init(object sender, EventArgs e) { Session["LastURL"] = Request.Url.PathAndQuery; Session["CurrentURI"] = Request.Url; if (!Request.AppRelativeCurrentExecutionFilePath.Equals("~/ESS_EmpChangePassword.aspx")) { if (Session["ForceChangePassword"] != null) { HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "~/ESS_EmpChangePassword.aspx"); } } user = WebUtils.GetCurUser(Session); //WebUtils.SetSessionLanguage(Session, user); //lblVersionNo.Text = ProductVersion.CURRENT_PROGRAM_VERSION; HROne.ProductLicense productLicense = WebUtils.productLicense(Session); if (productLicense != null && productLicense.ProductType == HROne.ProductLicense.ProductLicenseType.iMGR) { Page.Title = "iStaff"; } }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } DBFilter empPayrollFilter = new DBFilter(); empPayrollFilter.add(new Match("EmpID", CurID)); empPayrollFilter.add(new Match("EmpPayStatus", "=", "C")); if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ESS_PAYSLIP_AUTO_RELEASE).Equals("N", StringComparison.CurrentCultureIgnoreCase)) { DBFilter payBatchFilter = new DBFilter(); payBatchFilter.add(new Match("PayBatchIsESSPaySlipRelease", true)); empPayrollFilter.add(new IN("PayBatchID", "SELECT pb.PayBatchID FROM " + EPayrollBatch.db.dbclass.tableName + " pb", payBatchFilter)); } string strPeriodStartDate = ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ESS_PAYSLIP_START_DATE); if (!IsPostBack) { DBFilter yearFilter = new DBFilter(); yearFilter.add(new IN("PayPeriodID", "Select distinct PayPeriodID from EmpPayroll", empPayrollFilter)); yearFilter.add("Year(PayPeriodFr)", false); DateTime dtPeriodStartDate; if (DateTime.TryParse(strPeriodStartDate, out dtPeriodStartDate)) { yearFilter.add(new Match("PayPeriodFr", ">=", dtPeriodStartDate)); } Year.Items.Clear(); DataTable table = yearFilter.loadData(dbConn, "Select Distinct Year(PayPeriodFr) from PayrollPeriod"); //dbConn.GetDataTable("Select Distinct Year(PayPeriodFr) from PayrollPeriod where PayPeriodID in (Select distinct PayPeriodID from EmpPayroll where EmpID=" + CurID + " and EmpPayStatus ='C') order by Year(PayPeriodFR) desc"); foreach (DataRow row in table.Rows) { Year.Items.Add(row[0].ToString()); } if (Year.Items.Count > 0) { Year.SelectedIndex = 0; } } DateTime payPeriodFr = new DateTime(); DateTime payPeriodTo = new DateTime(); if (!string.IsNullOrEmpty(Year.SelectedValue)) { payPeriodFr = new DateTime(int.Parse(Year.SelectedValue), 1, 1); payPeriodTo = new DateTime(int.Parse(Year.SelectedValue), 12, 31); } // binding.add(EmpNo); DBFilter payPeriodFilter = new DBFilter(); if (!payPeriodFr.Ticks.Equals(0) && !payPeriodTo.Ticks.Equals(0)) { payPeriodFilter.add(new Match("PayPeriodFr", ">=", payPeriodFr)); payPeriodFilter.add(new Match("PayPeriodFr", "<=", payPeriodTo)); DateTime dtPeriodStartDate; if (DateTime.TryParse(strPeriodStartDate, out dtPeriodStartDate)) { payPeriodFilter.add(new Match("PayPeriodFr", ">=", dtPeriodStartDate)); } } payPeriodFilter.add(new IN("PayPeriodID", "Select distinct PayPeriodID from " + EEmpPayroll.db.dbclass.tableName, empPayrollFilter)); binding.add(new DropDownVLBinder(EPayrollPeriod.db, PayPeriodID, EPayrollPeriod.VLPayrollPeriod, payPeriodFilter)); binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } }
public static bool ValidateUser(DatabaseConnection dbConn, string username, string encryptedPassword, bool throwException, out bool ChangePasswordRequired, out EESSUser user) { string message = string.Empty; ChangePasswordRequired = false; user = null; if (dbConn == null) { if (throwException) { message = HROne.Common.WebUtility.GetLocalizedString("Invalid User Name or Password"); throw new Exception(message); } return(false); } DBFilter filter = new DBFilter(); OR orEmpNoTerms = new OR(); orEmpNoTerms.add(new Match("EmpNo", username)); DBFieldTranscoder empNoTranscoder = EESSUser.db.getField("EmpNo").transcoder; if (empNoTranscoder != null) { orEmpNoTerms.add(new Match("EmpNo", empNoTranscoder.toDB(username.ToUpper()))); } filter.add(orEmpNoTerms); ArrayList list = EESSUser.db.select(dbConn, filter); if (list.Count == 0) { if (throwException) { message = HROne.Common.WebUtility.GetLocalizedString("Invalid User Name / Password"); throw new Exception(message); } return(false); } { user = (EESSUser)list[0]; ChangePasswordRequired = false; if (string.IsNullOrEmpty(user.EmpPW)) { ChangePasswordRequired = true; if (!(user.EmpHKID == "()") && !string.IsNullOrEmpty(user.EmpHKID)) { user.EmpPW = WebUtils.PasswordHash(user.EmpHKID.Substring(0, (user.EmpHKID.Length - 3))); } else { user.EmpPW = WebUtils.PasswordHash(user.EmpPassportNo); } } //if (user.EmpPW == WebUtils.PasswordHash(user.EmpPassportNo)) //{ // if (!user.EmpPW.Equals(Password.Text)) // { // Prompt.Text = "Invalid User Name / Password"; // return; // } // else // { // user.EmpPW = WebUtils.PasswordHash(Password.Text); // EESSUser.db.update(user); // } //} //else if (!user.EmpPW.Equals(encryptedPassword)) { if (throwException) { message = HROne.Common.WebUtility.GetLocalizedString("Invalid User Name / Password"); throw new Exception(message); } return(false); } EEmpTermination empTerm = EEmpTermination.GetObjectByEmpID(dbConn, user.EmpID); if (empTerm != null) { if (throwException) { if (empTerm.EmpTermLastDate < AppUtils.ServerDateTime().Date) { message = HROne.Common.WebUtility.GetLocalizedString("User is terminated"); throw new Exception(message); } return(false); } } } return(true); }
protected void Page_Load(object sender, EventArgs e) { if (!WebUtils.CheckAccess(Response, Session)) { return; } binding = new Binding(dbConn, db); binding.add(EmpID); binding.add(EmpNo); binding.add(EmpAlias); binding.add(EmpEngSurname); binding.add(EmpEngOtherName); binding.add(EmpHKID); binding.add(EmpChiFullName); binding.add(new LabelVLBinder(db, EmpGender, Values.VLGender)); binding.add(EmpDateOfBirth); binding.add(EmpDateOfJoin); binding.add(EmpServiceDate); binding.add(new LabelVLBinder(db, EmpMaritalStatus, Values.VLMaritalStatus)); binding.add(EmpPlaceOfBirth); binding.add(EmpPassportNo); binding.add(EmpPassportIssuedCountry); binding.add(EmpNationality); binding.add(EmpPassportExpiryDate); binding.add(EmpHomePhoneNo); binding.add(EmpMobileNo); binding.add(EmpOfficePhoneNo); binding.add(EmpEmail); binding.add(EmpInternalEmail); binding.add(EmpNoticePeriod); binding.add(new LabelVLBinder(db, EmpNoticeUnit, Values.VLEmpUnit)); binding.add(EmpResAddr); binding.add(new LabelVLBinder(db, EmpResAddrAreaCode, Values.VLArea)); binding.add(EmpCorAddr); binding.add(EmpProbaPeriod); binding.add(new LabelVLBinder(db, EmpProbaUnit, Values.VLEmpUnit)); binding.add(EmpProbaLastDate); binding.init(Request, Session); HROne.Common.WebUtility.WebControlsLocalization(this, this.Controls); EESSUser user = WebUtils.GetCurUser(Session); if (user != null) { CurID = user.EmpID; } if (!Page.IsPostBack) { if (CurID > 0) { loadObject(); } else { } } }