public void OnUpdate(AprajitaRetailsContext db, StaffAdvancePayment salPayment)
        {
            var old = db.StaffAdvancePayments.Where(c => c.StaffAdvancePaymentId == salPayment.StaffAdvancePaymentId).Select(d => new { d.Amount, d.PaymentDate, d.PayMode }).FirstOrDefault();

            if (old != null)
            {
                UpdateOutAmount(db, old.Amount, old.PayMode, old.PaymentDate, true);
            }
            UpdateOutAmount(db, salPayment.Amount, salPayment.PayMode, salPayment.PaymentDate, false);
            HRMBot.NotifyStaffPayment(db, "", salPayment.EmployeeId, salPayment.Amount, "Advance Payment: " + salPayment.Details);
        }
 public void OnInsert(AprajitaRetailsContext db, SalaryPayment salPayment)
 {
     UpdateOutAmount(db, salPayment.Amount, salPayment.PayMode, salPayment.PaymentDate, false);
     HRMBot.NotifyStaffPayment(db, "", salPayment.EmployeeId, salPayment.Amount, "Salary payment for month of " + salPayment.SalaryMonth + "  details: " + salPayment.Details);
     ;
 }
 public void OnInsert(AprajitaRetailsContext db, StaffAdvancePayment salPayment)
 {
     UpdateOutAmount(db, salPayment.Amount, salPayment.PayMode, salPayment.PaymentDate, false);
     HRMBot.NotifyStaffPayment(db, "", salPayment.EmployeeId, salPayment.Amount, "Advance Payment: " + salPayment.Details);
 }