protected bool loadObject() { obj = new EEmpTermination(); DBFilter filter = new DBFilter(); filter.add(new Match("EmpID", CurID)); ArrayList list = db.select(dbConn, filter); if (list.Count == 0) { return(false); } obj = (EEmpTermination)list[0]; Hashtable values = new Hashtable(); db.populate(obj, values); binding.toControl(values); if (!obj.EmpTermResignDate.Ticks.Equals(0) && obj.EmpTermNoticePeriod >= 0 && obj.EmpTermNoticeUnit != string.Empty) { ExpectedLastDate.Text = obj.GetExpectedLastEmploymentDate().ToString("yyyy-MM-dd"); } return(true); }
protected void UpdateLastDate() { EEmpTermination c = new EEmpTermination(); Hashtable values = new Hashtable(); binding.toValues(values); db.parse(values, c); if (!c.EmpTermResignDate.Ticks.Equals(0) && c.EmpTermNoticePeriod >= 0 && c.EmpTermNoticeUnit != string.Empty) { EmpTermLastDate.Value = c.GetExpectedLastEmploymentDate().ToString("yyyy-MM-dd"); ExpectedLastDate.Text = c.GetExpectedLastEmploymentDate().ToString("yyyy-MM-dd"); } else { ExpectedLastDate.Text = string.Empty; } }
protected bool loadObject() { DBFilter filter = new DBFilter(); filter.add(new Match("EmpID", CurEmpID)); filter.add(WebUtils.AddRankFilter(Session, "EmpID", true)); if (EEmpPersonalInfo.db.count(dbConn, filter) == 0) { if (CurEmpID <= 0) { return(false); } else { HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "~/AccessDeny.aspx"); } } DBFilter empTermFilter = new DBFilter(); empTermFilter.add(new Match("EmpID", CurEmpID)); ArrayList list = db.select(dbConn, empTermFilter); if (list.Count == 0) { obj = new EEmpTermination(); obj.EmpID = CurEmpID; obj.EmpTermID = -1; EEmpPersonalInfo p = new EEmpPersonalInfo(); p.EmpID = CurEmpID; EEmpPersonalInfo.db.select(dbConn, p); if (p.EmpNoticePeriod == 0 && p.EmpNoticeUnit == "") { obj.EmpTermNoticePeriod = 1; obj.EmpTermNoticeUnit = "D"; } else { obj.EmpTermNoticePeriod = p.EmpNoticePeriod; obj.EmpTermNoticeUnit = p.EmpNoticeUnit; } } else { obj = (EEmpTermination)list[0]; CurID = obj.EmpTermID; } if (!obj.EmpTermResignDate.Ticks.Equals(0) && obj.EmpTermNoticePeriod >= 0 && obj.EmpTermNoticeUnit != string.Empty) { ExpectedLastDate.Text = obj.GetExpectedLastEmploymentDate().ToString("yyyy-MM-dd"); } Hashtable values = new Hashtable(); db.populate(obj, values); binding.toControl(values); return(true); }