public void Create() { var sm = new TradeCode { trade_code = this.trade_code }; _tradeCodeService.CreateTradeCode(sm); }
public void Edit() { var st = new TradeCode { Id = this.Id, trade_code = this.trade_code }; _tradeCodeService.EditTradeCode(st); }
public async Task <IActionResult> Assign(TradeCodeViewModel model, Guid ApplicationUserId) { ApplicationUser user = await UserManagerService.FindByIdAsync(ApplicationUserId.ToString()); TradeCode tradeCode = TradeCodeService.ReturnSingleTradeCode(model.TradeCodeToAssign.Id); RepairOperative RepairOperative = new RepairOperative { ApplicationUser = user, Id = Guid.NewGuid(), TradeCode = tradeCode }; TradeCodeService.AssignTradeCode(RepairOperative); TradeCodeService.SaveChanges(); return(RedirectToAction("Manage", new { ApplicationUserId = ApplicationUserId })); }