예제 #1
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        PageErrors errors = PageErrors.getErrors(db, Page.Master);

        errors.clear();

        EShiftDutyCode o = new EShiftDutyCode();

        o.ShiftDutyCodeID = CurID;
        db.select(dbConn, o);
        WebUtils.StartFunction(Session, FUNCTION_CODE);
        db.delete(dbConn, o);
        WebUtils.EndFunction(dbConn);

        HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "ShiftDutyCode_List.aspx");
    }
예제 #2
0
    protected bool loadObject()
    {
        obj = new EShiftDutyCode();
        bool isNew = WebFormWorkers.loadKeys(db, obj, DecryptedRequest);

        if (!db.select(dbConn, obj))
        {
            return(false);
        }

        Hashtable values = new Hashtable();

        db.populate(obj, values);
        binding.toControl(values);
        return(true);
    }
    // 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 void Save_Click(object sender, EventArgs e)
    {
        EShiftDutyCode c = new EShiftDutyCode();

        Hashtable values = new Hashtable();

        binding.toValues(values);

        PageErrors errors = PageErrors.getErrors(db, Page.Master);

        errors.clear();

        db.validate(errors, values);

        if (!errors.isEmpty())
        {
            return;
        }

        db.parse(values, c);
        if (!AppUtils.checkDuplicate(dbConn, db, c, errors, "ShiftDutyCode"))
        {
            return;
        }

        WebUtils.StartFunction(Session, FUNCTION_CODE);
        if (CurID < 0)
        {
            db.insert(dbConn, c);
            CurID = c.ShiftDutyCodeID;
        }
        else
        {
            db.update(dbConn, c);
        }
        WebUtils.EndFunction(dbConn);

        HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "ShiftDutyCode_View.aspx?ShiftDutyCodeID=" + CurID);
    }