// Start 0000166, KuangWei, 2015-02-04 protected void init_ShiftDutyCodeDropdown() { if (ShiftDutyCode.Items.Count <= 0) { ShiftDutyCode.Items.Add(new ListItem("Not Selected", "0")); DBFilter m_filter = new DBFilter(); foreach (EShiftDutyCode o in EShiftDutyCode.db.select(dbConn, m_filter)) { string FromTime = o.ShiftDutyFromTime.ToString("HH:mm"); string ToTime = o.ShiftDutyToTime.ToString("HH:mm"); ShiftDutyCode.Items.Add(new ListItem(string.Format("{0} - {1} to {2}", o.ShiftDutyCode, FromTime, ToTime), o.ShiftDutyCodeID.ToString())); } DBFilter s_filter = new DBFilter(); s_filter.add(new Match("EmpRPID", CurID)); ArrayList list = EEmpRPWinson.db.select(dbConn, s_filter); if (list.Count > 0) { EEmpRPWinson winson = (EEmpRPWinson)list[0]; ShiftDutyCode.Items.FindByValue(winson.EmpRPShiftDutyID.ToString()).Selected = true; } } }
protected void init_PayCalFormulaCodeLabel() { EEmpRPWinson m_winsonRP = EEmpRPWinson.GetObjectByRPID(dbConn, CurID); if (m_winsonRP != null) { EPaymentCalculationFormula m_calFormula = EPaymentCalculationFormula.GetObject(dbConn, m_winsonRP.EmpRPPayCalFormulaID); if (m_calFormula != null) { PayCalFormulaCode.Text = m_calFormula.PayCalFormulaCode; } else { PayCalFormulaCode.Text = ""; } } }
// Start 0000166, KuangWei, 2015-02-05 protected void init_ShiftDutyCodeLabel() { EEmpRPWinson m_winsonRP = EEmpRPWinson.GetObjectByRPID(dbConn, CurID); if (m_winsonRP != null) { EShiftDutyCode m_shiftDutyCode = EShiftDutyCode.GetObject(dbConn, m_winsonRP.EmpRPShiftDutyID); if (m_shiftDutyCode != null) { ShiftDutyCode.Text = m_shiftDutyCode.ShiftDutyCode + " - " + m_shiftDutyCode.ShiftDutyFromTime.ToString("HH:mm") + " to " + m_shiftDutyCode.ShiftDutyToTime.ToString("HH:mm"); } else { ShiftDutyCode.Text = ""; } } }
protected bool saveToWinson(out string pErrorMsg) { int dutyCode = 0; int payCode = 0; if (!int.TryParse(ShiftDutyCode.SelectedValue, out dutyCode)) { pErrorMsg = "Missing Shift Duty Code"; return(false); } if (!int.TryParse(PayCalFormulaCode.SelectedValue, out payCode)) { pErrorMsg = "Missing Payment Calculation Formula Code"; return(false); } if ((dutyCode > 0) != (payCode > 0)) { pErrorMsg = "Shift Duty Code and Payment Calculation Formula are required"; return(false); } EEmpRPWinson m_winsonRP = EEmpRPWinson.GetObjectByRPID(dbConn, CurID); if (m_winsonRP != null) { m_winsonRP.EmpRPShiftDutyID = dutyCode; m_winsonRP.EmpRPPayCalFormulaID = payCode; EEmpRPWinson.db.update(dbConn, m_winsonRP); } else { m_winsonRP = new EEmpRPWinson(); m_winsonRP.EmpRPID = CurID; m_winsonRP.EmpRPShiftDutyID = dutyCode; m_winsonRP.EmpRPPayCalFormulaID = payCode; EEmpRPWinson.db.insert(dbConn, m_winsonRP); } pErrorMsg = ""; return(true); }
protected void init_PayCalFormulaCodeDropdown() { if (PayCalFormulaCode.Items.Count <= 0) { PayCalFormulaCode.Items.Add(new ListItem("Not Selected", "0")); DBFilter m_filter = new DBFilter(); foreach (EPaymentCalculationFormula o in EPaymentCalculationFormula.db.select(dbConn, m_filter)) { PayCalFormulaCode.Items.Add(new ListItem(o.PayCalFormulaCode, o.PayCalFormulaID.ToString())); } DBFilter s_filter = new DBFilter(); s_filter.add(new Match("EmpRPID", CurID)); ArrayList list = EEmpRPWinson.db.select(dbConn, s_filter); if (list.Count > 0) { EEmpRPWinson winson = (EEmpRPWinson)list[0]; PayCalFormulaCode.Items.FindByValue(winson.EmpRPPayCalFormulaID.ToString()).Selected = true; } } }