public Encashment EditEncashment(int id, decimal writeOff) { Encashment p = cont.Encashment.SingleOrDefault(ca => ca.Id == id); p.WriteOff = writeOff; cont.SaveChanges(); return(p); }
public Encashment AddEncashment(decimal writeOff, Branch branch) { Encashment p = new Encashment { Date = DateTime.Now, WriteOff = writeOff, Branch = branch, }; cont.Encashment.Add(p); cont.SaveChanges(); return(p); }