Ejemplo n.º 1
0
        public static PaycheckModeModel ToModel(Paycheck p)
        {
            PaycheckModeModel newPaycheck = new PaycheckModeModel();

            newPaycheck.Id            = p.Id;
            newPaycheck.paycheck_date = p.paycheck_date;
            newPaycheck.SetPayroll(p.payroll_id);
            newPaycheck.payment_type          = p.payment_type;
            newPaycheck.check_number          = p.check_number;
            newPaycheck.direct_deposit_number = p.direct_deposit_number;
            newPaycheck.Payroll = new BusinessEntities().Payrolls.Find(p.payroll_id);

            newPaycheck.SetTypeEnum();
            return(newPaycheck);
        }
Ejemplo n.º 2
0
        public static Paycheck ToBase(PaycheckModeModel model)
        {
            model.SetPaymentType();

            Paycheck newPaycheck = new Paycheck();

            newPaycheck.Id                    = model.Id;
            newPaycheck.paycheck_date         = model.paycheck_date;
            newPaycheck.payroll_id            = model.payroll_id;
            newPaycheck.payment_type          = model.payment_type;
            newPaycheck.check_number          = model.check_number;
            newPaycheck.direct_deposit_number = model.direct_deposit_number;
            newPaycheck.payment_amount        = model.payment_amount;

            return(newPaycheck);
        }