public bool AddPaymentType(AddPaymentTypeCommand newPaymentType) { using (var db = new SqlConnection(_connectionString)) { var sql = @"INSERT INTO [dbo].[PaymentType] ([Name]) VALUES (@name)"; return(db.Execute(sql, newPaymentType) == 1); } }
public void Add(AddPaymentTypeCommand newPaymentTypeCommand) { var userRepo = new UserRepository(); var user = userRepo.GetByUid(FirebaseUserId); var paymentType = new PaymentType(); paymentType.Id = -1; paymentType.UserId = user.Id; paymentType.ProfileName = newPaymentTypeCommand.ProfileName; paymentType.ServiceName = newPaymentTypeCommand.ServiceName; _repo.AddPaymentType(paymentType); }
public void Create(AddPaymentTypeCommand newPaymentType) { var repo = new PaymentTypeRepository(); repo.AddPaymentType(newPaymentType); }