コード例 #1
0
        public void UpdateFloor(FloorDto floorDto, long adminId)
        {
            ValidateFloor(floorDto, adminId);
            var floor = _floorService.Find(floorDto.FloorId);

            floor.FloorName = floorDto.FloorName;
            _floorService.Update(floor);
            SaveChanges();
        }
コード例 #2
0
 //Floor button - Add floor, Edit floor and Save (Depending on settings page state)
 // Consider this button as "save button" for now
 private void FloorButtonCommand()
 {
     if (SettingsModes.Editing == _currentMode)
     {
         if (false == CheckIfNameIsValid())
         {
             return;
         }
         UpdateFloorFromUI(_floor);
         _floorService.Update(_floor);
         _currentMode = SettingsModes.Preview;
     }
     else if (SettingsModes.CreatingNew == _currentMode)
     {
         if (false == CheckIfNameIsValid())
         {
             return;
         }
         UpdateFloorFromUI(_floor);
         _floorService.Add(_floor);
         _currentMode = SettingsModes.Preview;
     }
     else
     {
         _currentMode = SettingsModes.CreatingNew;
         _floor       = _floorService.CreateEmptyFloor(DefaultFloorName);
         LoadFloor(_floor);
     }
 }
コード例 #3
0
        public async Task <IHttpActionResult> Update([FromBody] FloorTrimViewModel viewmodel)
        {
            var model = Mapper.Map <Floor>(viewmodel);
            await _floorService.Update(model);

            return(Ok());
        }
コード例 #4
0
        public IActionResult Edit(long id, [Bind("FloorID,Ref,Name,Sequence")] Floor floor)
        {
            if (id != floor.FloorID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    service.Update(floor);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FloorExists(floor.FloorID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(floor));
        }
コード例 #5
0
ファイル: FloorController.cs プロジェクト: basharnaim/ERP
 public JavaScriptResult Edit(FloorViewModel rackvm)
 {
     try
     {
         _floorService.Update(Mapper.Map <Floor>(rackvm));
         return(JavaScript($"ShowResult('{"Data updated successfully."}','{"success"}','{"redirect"}','{"/APanel/Floor"}')"));
     }
     catch (Exception ex)
     {
         return(JavaScript($"ShowResult('{ex.Message}','failure')"));
     }
 }
コード例 #6
0
        // PUT: api/Floors
        public void Put([FromBody] FloorDTO floorDTO)
        {
            Floor floor = GetFloorFromDTO(floorDTO);

            Service.Update(floor);
        }
コード例 #7
0
        public IHttpActionResult Put(FloorDto floorDto)
        {
            _service.Update(floorDto);

            return(Ok());
        }