public void CreatePriceTaskList(CreatePriceTaskListInputDto input) { Logger.InfoFormat("CreatePriceTaskList() - Started."); var data = new MS_PriceTaskList { projectID = input.projectID, priceListFile = input.priceListFile }; Logger.DebugFormat("CreatePriceTaskList() - Start Insert MS_PriceTaskList. Parameters sent: {0} " + "projectID = {1}{0} " + "priceListFile = {2}{0}" , Environment.NewLine, input.projectID, input.priceListFile); _contextProp.MS_PriceTaskList.Add(data); _contextProp.SaveChanges(); Logger.InfoFormat("CreatePriceTaskList() - Finished."); }
private void AddIfNotExists(LK_RentalStatus rentalStatus) { if (_context.LK_RentalStatus.Any(l => l.rentalStatusCode == rentalStatus.rentalStatusCode)) { return; } _context.LK_RentalStatus.Add(rentalStatus); _context.SaveChanges(); }
private void AddIfNotExists(MS_Department department) { if (_context.MS_Department.Any(l => l.departmentCode == department.departmentCode)) { return; } _context.MS_Department.Add(department); _context.SaveChanges(); }
private void AddIfNotExists(MS_Detail detail) { if (_context.MS_Detail.Any(l => l.detailCode == detail.detailCode)) { return; } _context.MS_Detail.Add(detail); _context.SaveChanges(); }
private void AddIfNotExists(MS_Country country) { if (_context.MS_Country.Any(l => l.countryCode == country.countryCode)) { return; } _context.MS_Country.Add(country); _context.SaveChanges(); }
public void Create() { new RentalStatusCreator(_context).Create(); new DepartmentCreator(_context).Create(); new CountryCreator(_context).Create(); new DetailCreator(_context).Create(); _context.SaveChanges(); }