public static void AddMobileOwnPayment(MobilePaymentModel model, Repositories rep, int customerId) { OwnMobilePayment p = new OwnMobilePayment(); p.CardAccountID = model.CardAccountID; p.CustomerID = customerId; p.MobileProvider = model.Provider; p.Number = model.Phone; p.Name = model.Provider + " " + model.Phone; rep.OwnMobilePayments.Add(p); rep.SaveChanges(); }
public static MobilePaymentModel MobileOwnPaymentToModel(int paymentId, Repositories rep) { OwnMobilePayment p = rep.OwnMobilePayments.GetSingle(paymentId); if (p == null) { return(null); } MobilePaymentModel model = new MobilePaymentModel(); model.CardAccountID = p.CardAccountID; model.Phone = p.Number; model.Provider = p.MobileProvider; model.FromOwnPayments = true; return(model); }