public void Add(Core.Customer domainCustomer) { var customer = _mapper.Map(domainCustomer); _context.Customers.AddObject(customer); _context.SaveChanges(); }
public IActionResult OnGet(int id) { Customer = customerData.GetCustomerById(id); if (Customer == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
// Add customer to GameZone Database public void AddCustomer(Core.Customer cust) { var entity = new Customer { FistName = cust.FirstName, LastName = cust.LastName }; _dbContext.Add(entity); }
public static Model.Customers MapCustomer(Core.Customer customers) { return(new Model.Customers { CustomerId = customers.CustomerId, LastName = customers.LastName, FirstName = customers.FirstName, StoreId = customers.StoreId, Phone = customers.Phone, Address = customers.Address, City = customers.City, State = customers.State, FullName = customers.FullName }); }
/// <summary> /// Возвращает запись поставщика из справочника. Если такой нет, то создает новую /// </summary> /// <param name="suppl"></param> /// <returns></returns> private Core.Customer GetSupplier(Inbound.СвЮЛ suppl) { Core.Customer cust = _Context.Customer.Where(c => c.INN == suppl.ИНН).FirstOrDefault(); if (cust == null) { cust = new Core.Customer(); cust.INN = suppl.ИНН; cust.KPP = suppl.КПП; cust.OKDP = suppl.ОКДП; cust.OKPO = suppl.ОКПО; cust.Name = suppl.Название; _Context.Customer.Add(cust); _Context.SaveChanges(); } return(cust); }
public Customer Map(Core.Customer customer) { if (customer == null) { return(null); } return(new Customer { Customer_ID = customer.Id, City = customer.City, Company_Name = customer.CompanyName, Phone = customer.Phone, Postal_Code = customer.PostalCode }); }
public IActionResult OnGet(int?id) { if (id.HasValue) { Customer = customerData.GetCustomerById(id.Value); if (Customer == null) { return(RedirectToPage("./NotFound")); } } else { Customer = new Core.Customer(); } var memberships = membershipData.GetMemberships().ToList().Select(p => new { Id = p.Id, Display = p.MembershipType }); Memberships = new SelectList(memberships, "Id", "Display"); Gender = htmlHelper.GetEnumSelectList <Gender>(); City = htmlHelper.GetEnumSelectList <City>(); return(Page()); }
/// <summary> /// Возвращает запись поставщика из справочника. Если такой нет, то создает новую /// </summary> /// <param name="suppl"></param> /// <returns></returns> private Core.Customer GetSupplier(Inbound.СвЮЛ suppl) { Core.Customer cust = _Context.Customer.Where(c=>c.INN == suppl.ИНН).FirstOrDefault(); if (cust == null) { cust = new Core.Customer(); cust.INN = suppl.ИНН; cust.KPP = suppl.КПП; cust.OKDP = suppl.ОКДП; cust.OKPO = suppl.ОКПО; cust.Name = suppl.Название; _Context.Customer.Add(cust); _Context.SaveChanges(); } return cust; }