Esempio n. 1
0
        public ActionResult EndCleanOrder(CleanOrderDto dto)
        {
            var cleanOrderDto = _orderService.GetById(dto.Id);
            var id            = User.Identity.GetUserId();
            var guid          = new Guid(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;
            cleanOrderDto.Istaked    = true;
            var rom = _RoomService.GetById(Convert.ToInt32(cleanOrderDto.Room_ID));

            cleanOrderDto.Roomnu = rom.RoomNum;
            _orderService.edit(cleanOrderDto);


            rom.isneedclean = false;
            rom.Isrequisted = false;
            _RoomService.Edit(rom);
            MysqlFetchingRoomData.SetCleanStatus(rom.RoomNum, rom.isneedclean);

            roomrecDto roomrecDto = new roomrecDto();

            roomrecDto.Room_Id = (int)cleanOrderDto.Room_ID;
            roomrecDto.Recoed  = _userService.GetById(guid).FullName.ToString() + "تم إنهاء طلب تنظيف من العامل   ";
            _roomrec.Add(roomrecDto);
            return(RedirectToAction("getAllEquipmentsForcleaningEmp", "Equipment", new { Rid = rom.Id }));
        }
Esempio n. 2
0
        public ActionResult takeCleanOrder(CleanOrderDto ordd)
        {
            var dto = _orderService.GetById(ordd.Id);

            dto.startdate = DateTimeHelper.ConvertDateToString(Utils.ServerNow.Date, DateFormats.DD_MM_YYYY) + " " + DateTimeHelper.ConvertTimeToString(Utils.ServerNow.TimeOfDay, TimeFormats.HH_MM_AM);
            var id      = User.Identity.GetUserId();
            var guid    = new Guid(id);
            var userdto = _userService.GetById(guid);

            dto.Istaked    = true;
            userdto.IsBusy = true;
            dto.isFinished = false;
            _userService.Edit(userdto, guid);
            _orderService.edit(dto);
            TempData["ord"] = dto.Id;
            var rom = _RoomService.GetById(Convert.ToInt32(dto.Room_ID));

            MysqlFetchingRoomData.setincleaning(rom.RoomNum.ToString(), false);

            roomrecDto roomrecDto = new roomrecDto();

            roomrecDto.Room_Id = Convert.ToInt32(_orderService.GetById(dto.Id).Room_ID);
            roomrecDto.Recoed  = "تم أستلام   طلب تنظيف من  العامل   " + _userService.GetById(guid).FullName.ToString();
            _roomrec.Add(roomrecDto);

            return(RedirectToAction("EndCleanOrder", new { Oid = dto.Id }));
        }
Esempio n. 3
0
        public int Add(roomrecDto roomrecDto)
        {
            RoomRec roomRec = new RoomRec();

            roomRec.Room     = _unitOfWork.RoomRepository.FindById(roomrecDto.Room_Id);
            roomRec.Recoed   = roomrecDto.Recoed;
            roomRec.Datetime = DateTime.Now.ToString("G");
            _unitOfWork.roomrecRepository.Add(roomRec);
            _unitOfWork.SaveChanges();
            return(roomRec.Id);
        }
Esempio n. 4
0
        public ActionResult AddRoom(RoomDto dto, int hid, int tid)
        {
            dto.RoomType_id   = tid;
            dto.HotelBlock_id = hid;
            // if()
            int        i          = _roomService.Add(dto);
            roomrecDto roomrecDto = new roomrecDto();

            roomrecDto.Room_Id = i;
            roomrecDto.Recoed  = "تم أضافة الغرفة ";
            _RoomRecServices.Add(roomrecDto);

            return(RedirectToAction("AddEquipment", "Equipment", new { Rid = i }));
        }
Esempio n. 5
0
        public ActionResult Edit(RoomDto roomDto, int hid, int tid)
        {
            if (ModelState.IsValid)
            {
                roomDto.RoomType_id   = tid;
                roomDto.HotelBlock_id = hid;
                _roomService.Edit(roomDto, true);

                roomrecDto roomrecDto = new roomrecDto();
                roomrecDto.Room_Id = roomDto.Id;
                roomrecDto.Recoed  = "تم تعديل  الغرفة ";
                _RoomRecServices.Add(roomrecDto);
                return(RedirectToAction("getAllRoom", "Room"));
            }
            return(View(roomDto));
        }
Esempio n. 6
0
        public ActionResult sendOrderToemp(CleanOrderDto dto, string eid)
        {
            if (ModelState.IsValid)
            {
                dto             = _orderService.GetById(dto.Id);
                dto.cleaningEmp = _userService.GetById(new Guid(eid)).UserId;

                _orderService.edit(dto);

                roomrecDto roomrecDto = new roomrecDto();
                roomrecDto.Room_Id = (int)(dto.Room_ID);
                roomrecDto.Recoed  = "تم أرسال  طلب تنظيف الى العامل   " + _userService.GetById(new Guid(eid)).FullName.ToString();
                _roomrec.Add(roomrecDto);
            }
            return(RedirectToAction("Getallformosh"));
        }
Esempio n. 7
0
        public ActionResult AddOrder(CleanOrderDto dto, int rid)
        {
            dto.Hoster        = Guid.Parse(User.Identity.GetUserId());
            dto.Creation_Date = DateTimeHelper.ConvertDateToString(Utils.ServerNow.Date, DateFormats.DD_MM_YYYY);
            dto.Creation_Time = DateTimeHelper.ConvertTimeToString(Utils.ServerNow.TimeOfDay, TimeFormats.HH_MM_AM);
            dto.Creation_At   = DateTimeHelper.ConvertDateToString(Utils.ServerNow.Date, DateFormats.DD_MM_YYYY) + " " + DateTimeHelper.ConvertTimeToString(Utils.ServerNow.TimeOfDay, TimeFormats.HH_MM_AM);
            dto.Room_ID       = rid;
            dto.moshId        = _fixOrderServices.getmoshbyroomId((int)rid);
            int i    = _orderService.addOrder(dto);
            var room = _RoomService.GetById(rid);

            room.Isrequisted = true;
            _RoomService.Edit(room);

            roomrecDto roomrecDto = new roomrecDto();

            roomrecDto.Room_Id = rid;
            roomrecDto.Recoed  = "  تم أضافة طلب تنظيف على الغرفة  ";
            _roomrec.Add(roomrecDto);
            //NotifictationDto dto1 = new NotifictationDto();
            //dto1.senderId = Guid.Parse(User.Identity.GetUserId());
            //dto1.RevieverId = _RoomService.getMangerIdForRoom(Convert.ToInt32( rid));
            //var roomnum = _RoomService.GetById(dto.Room_ID.Value).RoomNum;

            //var s1 = "الغرفة رقم";
            //var s2 = roomnum;
            //var s3 = " بحاجة الى ";
            //var s4 = "&";
            //var s5 = i;
            //var s6 = "تنظيف";

            //dto1.NotDateTime = DateTimeHelper.ConvertDateToString(Utils.ServerNow.Date, DateFormats.DD_MM_YYYY);
            //dto1.Room_ID = dto.Room_ID;
            //_notifictationService.Add(dto1);
            return(RedirectToAction("getAllRoom", "Room"));
        }