Beispiel #1
0
        public dynamic PutDeduction(DeductionPostVM d)
        {
            var deduction = db.HR_Employee_Deductions.Find(d.Id);

            deduction.Month          = d.Month;
            deduction.Year           = d.Year;
            deduction.Deduction_Date = (DateTime)d.Date;
            deduction.Employee_ID    = d.EmployeeId;
            deduction.DeducDay_Count = d.DayCount;
            deduction.Reason         = d.Reason;
            deduction.HrApprov       = null;
            deduction.User_ID        = d.UserId;
            deduction.Last_Update    = DateTime.Now;
            deduction.ManagerID      = d.ManagerId;
            var result = db.SaveChanges() > 0 ? true : false;

            return(new
            {
                result = result
            });
        }
Beispiel #2
0
        public dynamic PostDeduction(DeductionPostVM d)
        {
            var deduction = db.HR_Employee_Deductions.Add(new HR_Employee_Deductions
            {
                Deduction_Date = d.Date,
                Month          = d.Month,
                Year           = d.Year,
                ManagerID      = d.ManagerId,
                Employee_ID    = d.EmployeeId,
                HrApprov       = null,
                DeducDay_Count = d.DayCount,
                Reason         = d.Reason,
                User_ID        = d.UserId,
                Last_Update    = DateTime.Now
            });
            var result = db.SaveChanges() > 0 ? true : false;

            return(new
            {
                result = result,
                deduction = deduction.Deduction_ID
            });
        }