public static void AddArbitraryOwnPayment(ArbitraryPaymentModel model, Repositories rep, int customerId) { OwnArbitraryPayment p = new OwnArbitraryPayment(); p.BankCode = model.BankName; p.CardAccountID = model.AccountCardId; p.CustomerID = customerId; p.Recipient = model.Recipient; p.RecipientAccount = model.RecipientAccount; p.Target = model.Target; p.UNP = model.UNP; p.Name = "Произвольный платеж " + model.RecipientAccount; rep.OwnArbitraryPayments.Add(p); rep.SaveChanges(); }
public static ArbitraryPaymentModel ArbitraryOwnPaymentToModel(int paymentId, Repositories rep) { OwnArbitraryPayment p = rep.OwnArbitraryPayments.GetSingle(paymentId); if (p == null) { return(null); } ArbitraryPaymentModel model = new ArbitraryPaymentModel(); model.AccountCardId = p.CardAccountID; model.BankName = p.BankCode; model.Recipient = p.Recipient; model.RecipientAccount = p.RecipientAccount; model.Target = p.Target; model.UNP = p.UNP; model.FromOwnPayments = true; return(model); }