public Task <XtrfResult <CustomerPerson> > UpdatePerson(long personId, CustomerPerson person) { if ((person?.Contact?.Phones?.Count ?? 0) > 3) { person.Contact.Sms = person.Contact.Phones[3]; person.Contact.Phones.RemoveAt(3); } return(Put <CustomerPerson>(new ExecuteParams($"/customers/persons/{personId}", person))); }
public RedirectResult Edit(CustomerPersonDTO data) { CustomerPerson cp = _customerPerson.GetById(data.Id); cp.Name = data.Name; cp.SurName = data.Surname; cp.Phone = data.Phone; cp.MobilePhone = data.Mphone; cp.Email = data.Email; cp.Title = data.Title; cp.CustomerID = data.CustomerID; _customerPerson.Update(cp); return(Redirect("/CRMarea/Customer/List")); }
public ActionResult Edit(int?id) { CustomerPersonVM model = new CustomerPersonVM(); CustomerPerson custo = _customerPerson.GetById((int)id); model.CustomerPer.Id = custo.ID; model.CustomerPer.Name = custo.Name; model.CustomerPer.Surname = custo.SurName; model.CustomerPer.Phone = custo.Phone; model.CustomerPer.Mphone = custo.MobilePhone; model.CustomerPer.Email = custo.Email; model.CustomerPer.Title = custo.Title; model.Customers = _custService.GetActive(); return(View(model)); }
public RedirectResult Add(CustomerPerson data) { _customerPerson.Add(data); return(Redirect("/CRMarea/Customer/List")); }
public Task <XtrfResult <CustomerPerson> > CreateNewPerson(CustomerPerson newPerson) => Post <CustomerPerson>(new ExecuteParams("/customers/persons", newPerson));