예제 #1
0
        public bool SetOrderAsFinished(int oid)
        {
            try
            {
                var cleanOrderDto = _fixOrderServices.GetById(oid);
                var userdto       = _userService.GetById(new Guid(User.Identity.GetUserId()));
                userdto.IsBusy = false;
                _userService.Edit(userdto, new Guid(User.Identity.GetUserId()));
                cleanOrderDto.enddate    = DateTimeHelper.ConvertDateToString(Utils.ServerNow.Date, DateFormats.DD_MM_YYYY) + " " + DateTimeHelper.ConvertTimeToString(Utils.ServerNow.TimeOfDay, TimeFormats.HH_MM_AM);
                cleanOrderDto.isFinished = true;
                _fixOrderServices.edit(cleanOrderDto);

                var rom = _roomService.GetById(Convert.ToInt32(cleanOrderDto.Room_ID));
                //rom. = false;
                rom.Isrequistedfix = false;
                rom.IsNeedfix      = false;
                _roomService.Edit(rom);
                MysqlFetchingRoomData.SetFixStatus(rom.RoomNum, rom.IsNeedfix);
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
예제 #2
0
        public ActionResult CheckedToggleFix(int id, int Rid, int Oid)
        {
            _equipmentService.checkedToggleFix(id);
            var room = _roomService.GetById(Rid);

            room.IsNeedfix = !room.IsNeedfix;
            _roomService.Edit(room);
            MysqlFetchingRoomData.SetFixStatus(room.RoomNum, room.IsNeedfix);
            return(RedirectToAction("EndCleanOrder", new { Rid = Rid, Oid = Oid, Msg = "" }));
        }
예제 #3
0
        public ActionResult CheckedToggle(int id, int Rid)
        {
            _equipmentService.checkedToggle(id);
            var room = _roomService.GetById(Rid);

            room.IsNeedfix = !room.IsNeedfix;
            _roomService.Edit(room);

            MysqlFetchingRoomData.SetFixStatus(room.RoomNum, room.IsNeedfix);
            return(RedirectToAction("getAllEquipmentsForcleaningEmp", new { Rid = Rid }));
        }
예제 #4
0
        public ActionResult EndCleanOrder1(int id)
        {
            var cleanOrderDto = _fixOrderServices.GetById(id);
            var userdto       = _userService.GetById(new Guid(User.Identity.GetUserId()));

            userdto.IsBusy = false;
            _userService.Edit(userdto, new Guid(User.Identity.GetUserId()));
            cleanOrderDto.enddate    = DateTimeHelper.ConvertDateToString(Utils.ServerNow.Date, DateFormats.DD_MM_YYYY) + " " + DateTimeHelper.ConvertTimeToString(Utils.ServerNow.TimeOfDay, TimeFormats.HH_MM_AM);
            cleanOrderDto.isFinished = true;
            _fixOrderServices.edit(cleanOrderDto);

            var rom = _roomService.GetById(Convert.ToInt32(cleanOrderDto.Room_ID));

            rom.IsNeedfix      = false;
            rom.Isrequistedfix = false;
            _roomService.Edit(rom);
            MysqlFetchingRoomData.SetFixStatus(rom.RoomNum, rom.IsNeedfix);
            return(RedirectToAction("Check", "Equipment", rom.Id));
        }