public void UpdateData(SalesMansModel _salesMansModel) { SalesMansData NewSalesManData = new SalesMansData(); NewSalesManData = Mapper.Map(_salesMansModel); Repository.UpdateData(NewSalesManData); }
public void UpdateData(SalesMansData salesMansData) { using (var db = new AppSalesMan2DbContext()) { var FoundSalesMan = SalesMansDatas.Where(x => x.SalesManID == salesMansData.SalesManID).FirstOrDefault(); if (FoundSalesMan == null) { return; } #region Mapowanie na SalesManData FoundSalesMan.FirstName = salesMansData.FirstName; FoundSalesMan.LastName = salesMansData.LastName; FoundSalesMan.Email = salesMansData.Email; FoundSalesMan.Department = salesMansData.Department; FoundSalesMan.Menager = salesMansData.Menager; FoundSalesMan.Phonenumber = salesMansData.Phonenumber; FoundSalesMan.Password = salesMansData.Password; #endregion SaveChanges(); } }
public SalesMansModel Map(SalesMansData salesMansData) { return(_Mapper.Map <SalesMansModel>(salesMansData)); }