private int CreateGurantor(int p, Guarantor guarantor) { guarantor.LoanId = p; _db.Guarantors.Add(guarantor); _db.SaveChanges(); return guarantor.GuarantorId; }
private int UpdateGurantor(Guarantor p) { var x = _db.Guarantors.Find(p.GuarantorId); x.Name = p.Name; x.PhoneNumber = p.PhoneNumber; x.NameOnCheque = p.NameOnCheque; x.ChequeNumber = p.ChequeNumber; x.Bank = p.Bank; x.Status = p.Status; _db.SaveChanges(); return p.GuarantorId; }
private static bool IsNullOrEmpty(Guarantor guarantor) { if (guarantor.ChequeNumber != "" || guarantor.NameOnCheque != "" || guarantor.Name != "") return false; return true; }