public void AddCustomer(Customer dataModel) { if (customerValidation.ValidateCustomer(dataModel)) { customerDAL.Add(dataModel); } }
public void AddCustomer(Customer customer) { if (_realPersonCheck.CheckIfRealPerson(customer)) { _customerDAL.Add(customer); } else { throw new Exception("Not a real person!"); } }
public IActionResult Create([Bind("Id,Name,Email,Username,Pwd,LastName")] Customer customer) { if (ModelState.IsValid) { try { _context.Add(customer); } catch (Exception) { ModelState.AddModelError("CustAddError", "Creating the customer failed change username/email."); return(View(customer)); } logger.LogInformation($"Successfully created customer"); return(RedirectToAction(nameof(Index))); } return(RedirectToAction("Create", customer)); }
public IResult Insert(Customer customer) { //if (customer.UserId > 0) //{ // _customerDAL.Add(customer); // return new SuccessResult(Messages.CustomerAdded); //} //return new ErrorResult(Messages.CustomerNotAddedUserId); //if (customer.UserId > 0) //{ // _customerDAL.Add(customer); // return new SuccessResult(Messages.CustomerAdded); //} //return new ErrorResult(Messages.CustomerNotAddedUserId); //ValidationTool.Validate(new CustomerValidator(), customer); _customerDAL.Add(customer); return(new SuccessResult(Messages.CustomerAdded)); }
public Customers Add(Customers entity) { try { var customer = _CustomerDAL.GetAll(); var IsThere = (from c in customer where c.Email == entity.Email && c.FirstName == entity.FirstName && c.LastName == entity.LastName select c.ID).FirstOrDefault(); if (IsThere == 0) { _CustomerDAL.Add(entity); return(entity); } else { return(Get(IsThere)); } } catch (Exception) { return(entity); } }
{ // Metot parametresi eklemekten ileri seviye olan constructor'a eklemekte bulur. // Henüz öğrenilmedi. public void Add(ICustomerDAL customerDAL) // ICustomerDAL veri tipi ile onu kullanan her tipin kullanılması sağlanır. { customerDAL.Add(); // Seçilen, gönderilen tipin Add()'i çalışır. }
public IResult Add(NCustomer customer) { _iCustomerDal.Add(customer); return(new SuccessResult(Messages.CustomerAdded)); }
public static int AddCustomer(Customer data) { return CustomerDB.Add(data); }
public IResult Add(Customer customer) { _customerDAL.Add(customer); return(new SuccessResult()); }
public IResult Add(Customer customer) { _customerDAL.Add(customer); return(new SuccessResult(Messages.CustomerAdded)); }
public IResult Add(Customer customer) { customer.FindexScore = _random.Next(0, 1900); _customerDAL.Add(customer); return(new SuccessResult()); }