public WorkerWindow(WorkersDTO worker, BLL.BLL BLL_) { InitializeComponent(); LoadData(worker); this.worker = worker; this.BLL_ = BLL_; }
public bool ModifyWorker(WorkersDTO workersDTO) { var worker = mApplicationMapper.Map(workersDTO); var oldworker = mIWorkers.GetAll().Where(x => x.Id == worker.Id).FirstOrDefault(); oldworker.Surname = worker.Surname; oldworker.Name = worker.Name; oldworker.Section = worker.Section; oldworker.IsManager = worker.IsManager; return(mIWorkers.Modify(oldworker)); }
private void LoadData(WorkersDTO worker) { if (worker.Name == null) { Create_Update.Content = "Create"; } else { Create_Update.Content = "Update"; } Name.Text = worker.Name; Phone.Text = worker.Phone; ShopId.Text = worker.ShopId.ToString(); Surname.Text = worker.Surname; WorkerTypeId.Text = worker.WorkerTypeId.ToString(); }
public bool DeleteWorker(WorkersDTO workersDTO) { var worker = mApplicationMapper.Map(workersDTO); return(mIWorkers.Delete(worker)); }
public void AddNewWorker(WorkersDTO workersDTO) { var worker = mApplicationMapper.Map(workersDTO); mIWorkers.AddNew(worker); }
public Workers Map(WorkersDTO workers) => mMapper.Map <Workers>(workers);
public static WorkerDG Convert(WorkersDTO workersDTO) { return(new WorkerDG(workersDTO.Id, workersDTO.Name, workersDTO.Surname, workersDTO.Phone, workersDTO.ShopId, workersDTO.WorkerTypeId)); }
public WorkersViewModel Map(WorkersDTO workers) => mMapper.Map <WorkersViewModel>(workers);