/// <summary> /// Добавление/обновление простых клиентов /// </summary> /// <param name="model">Модель клиентов</param> public void EditCustom(PhysicalClient model) { if (model.Id == 0) { model.Id = IdGenarator(); physicalClients.Add(model); DataWork.AddData.AddPhysical(model); CustomersList.Add(CustomFactory.GetCustomerFactory(model)); } else { Customers itemcustomer = CustomersList.Single(s => s.Id == model.Id); itemcustomer.Changed(model); DataWork.UpdateData.UpdatePhysical(model); } }
/// <summary> /// Добавление/обновление данных юр.лиц /// </summary> /// <param name="model">Модель данных</param> public void EditCustom(Busines model) { if (model.Id == 0) { model.Id = IdGenarator(); busines.Add(model); DataWork.AddData.AddBusines(model); CustomersList.Add(CustomFactory.GetCustomerFactory(model)); } else { var itemcustomer = CustomersList.Single(s => s.Id == model.Id); itemcustomer.Changed(model); DataWork.UpdateData.UpdateBusines(model); } }