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

        errors.clear();

        EPaymentCalculationFormula o = new EPaymentCalculationFormula();

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

        HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "PaymentCalculationFormula_List.aspx");
    }
Esempio n. 2
0
    protected bool loadObject()
    {
        obj = new EPaymentCalculationFormula();
        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);
    }
    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 = "";
            }
        }
    }
Esempio n. 4
0
    protected void Save_Click(object sender, EventArgs e)
    {
        EPaymentCalculationFormula c = new EPaymentCalculationFormula();

        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, "PayCalFormulaCode"))
        {
            return;
        }

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

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