示例#1
0
        public IActionResult Edit(long id, [Bind("RackLocationID,LocationID,RackID,RackNo")] RackLocation rackLocation)
        {
            if (id != rackLocation.RackLocationID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    service.Update(rackLocation);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RackLocationExists(rackLocation.RackLocationID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LocationID"] = new List <SelectListItem>(service.GetSelectListLocation());
            ViewData["RackID"]     = new List <SelectListItem>(service.GetSelectListRack());
            return(View(rackLocation));
        }
示例#2
0
 public async Task <IActionResult> UpdateBrand(RackLocation_Main_Dto rackDto)
 {
     if (await _service.Update(rackDto))
     {
         return(NoContent());
     }
     return(BadRequest($"Updating rack {rackDto.Rack_Location} failed on save"));
 }
示例#3
0
        public async Task <IActionResult> UpdateBrand(RackLocation_Main_Dto rackDto)
        {
            var updateBy = User.FindFirst(ClaimTypes.Name).Value;

            rackDto.Updated_By = updateBy;
            if (await _service.Update(rackDto))
            {
                return(NoContent());
            }
            return(BadRequest($"Updating rack {rackDto.Rack_Location} failed on save"));
        }