public async Task CreateAsync(ProjectBusinessIM item) { var project = _mapper.Map <ProjectBusiness>(item); //project.CreatedDate = DateTime.Now; //project.CreatedBy = await _sessionStorageService.GetItemAsync<string>("username"); await _db.AddAsync(project); await _db.SaveChangesAsync(); }
public async Task CreateAsync(PaymentlogIM item) { var pl = _mapper.Map <Paymentlog>(item); pl.CreatedDate = DateTime.Now; pl.CreatedBy = await _sessionStorageService.GetItemAsync <string>("username"); await _db.AddAsync(pl); await _db.SaveChangesAsync(); }
public async Task CreateCustomerAsync(CustomerIM item) { var customer = _mapper.Map <Customer>(item); customer.CreatedDate = DateTime.Now; customer.CreatedBy = await _sessionStorageService.GetItemAsync <string>("username"); await _db.AddAsync(customer); await _db.SaveChangesAsync(); }
public async Task AddProjectUsers(UserProject item) { if (!_db.UserProjects.Any(d => d.ProjectId == item.ProjectId && d.UserId == item.UserId)) { _db.UserProjects.Add(item); await _db.SaveChangesAsync(); } }
public async Task CreateCategoryAsync(LinkCategoryIM item) { var category = _mapper.Map <LinkCategory>(item); category.CreatedDate = DateTime.Now; category.CreatedBy = await _sessionStorageService.GetItemAsync <string>("username"); await _db.AddAsync(category); await _db.SaveChangesAsync(); }