示例#1
0
        public PartialViewResult EditFastLichCongTac(int year, int month, int day, int hour = 0, int minute = 0, long id = 0)
        {
            AssignUserInfo();
            lichCongTacBusiness   = Get <LICHCONGTACBusiness>();
            dmNguoiDungBusiness   = Get <DM_NGUOIDUNGBusiness>();
            dmDanhMucDataBusiness = Get <DM_DANHMUC_DATABusiness>();

            EditLichCongTacViewModel model = new EditLichCongTacViewModel();
            List <long> groupLanhDaoIds    = new List <long>();
            long        userId             = 0;

            if (id > 0)
            {
                LICHCONGTAC entity = lichCongTacBusiness.Find(id);
                if (entity != null && entity.IS_DELETE != true && entity.NGAY_CONGTAC.IsOldWeek() == false)
                {
                    model  = new EditLichCongTacViewModel(entity);
                    userId = entity.LANHDAO_ID.GetValueOrDefault();
                }
            }
            else
            {
                LICHCONGTAC entity = new LICHCONGTAC();
                entity.NGAY_CONGTAC = new DateTime(year, month, day);
                entity.GIO_CONGTAC  = hour;
                entity.PHUT_CONGTAC = minute;
                model = new EditLichCongTacViewModel(entity);
            }
            model.groupOfLanhDaos     = dmNguoiDungBusiness.GetDropDownByDeptParentId(currentUser.DeptParentID.GetValueOrDefault(), userId);
            model.groupOfDestinations = dmDanhMucDataBusiness.GetGroupTextByCode(DMLOAI_CONSTANT.DIEM_DEN);
            model.isPopUp             = true;
            return(PartialView("_EditFastLichCongTac", model));
        }
示例#2
0
        public ActionResult CreateLichCongTac(long idVanBanDen = 0)
        {
            AssignUserInfo();
            hscvVanBanDenBusiness = Get <HSCV_VANBANDENBusiness>();
            cctcThanhPhanBusiness = Get <CCTC_THANHPHANBusiness>();
            dmNguoiDungBusiness   = Get <DM_NGUOIDUNGBusiness>();
            dmDanhMucDataBusiness = Get <DM_DANHMUC_DATABusiness>();
            wfLogBusiness         = Get <WF_LOGBusiness>();

            EditLichCongTacViewModel model = new EditLichCongTacViewModel();
            long userId = 0;

            if (idVanBanDen > 0)
            {
                HSCV_VANBANDEN entityVanBanDen = hscvVanBanDenBusiness.Find(idVanBanDen);
                if (entityVanBanDen != null && entityVanBanDen.NGUOITAO == currentUser.ID && hscvVanBanDenBusiness.CheckIsFinish(entityVanBanDen.ID))
                {
                    LICHCONGTAC calendar = new LICHCONGTAC();
                    calendar.TIEUDE       = entityVanBanDen.TRICHYEU;
                    calendar.NGAY_CONGTAC = entityVanBanDen.NGAYCONGTAC ?? DateTime.Now;
                    calendar.GIO_CONGTAC  = entityVanBanDen.GIO_CONGTAC.GetValueOrDefault();
                    calendar.PHUT_CONGTAC = entityVanBanDen.PHUT_CONGTAC.GetValueOrDefault();
                    model = new EditLichCongTacViewModel(calendar);
                    model.entityLichCongTac = calendar;

                    //lấy người xử lý cuối làm người chủ trì công tác
                    DM_NGUOIDUNG_BO lastProcessor = wfLogBusiness.GetFinalProcessor(entityVanBanDen.ID, MODULE_CONSTANT.VANBANDEN);
                    userId = lastProcessor.ID;
                }
                else
                {
                    return(Redirect("/Home/UnAuthor"));
                }
            }
            else if (SessionManager.HasValue("CreateCalendarOfTheDay"))
            {
                LICHCONGTAC entityCalendar = (LICHCONGTAC)SessionManager.GetValue("CreateCalendarOfTheDay");
                model = new EditLichCongTacViewModel(entityCalendar);

                SessionManager.Remove("CreateCalendarOfTheDay");
            }
            model.groupOfLanhDaos     = dmNguoiDungBusiness.GetDropDownByDeptParentId(currentUser.DeptParentID.GetValueOrDefault(), userId);
            model.groupOfDestinations = dmDanhMucDataBusiness.GetGroupTextByCode(DMLOAI_CONSTANT.DIEM_DEN);
            return(View("EditLichCongTac", model));
        }
示例#3
0
        public ActionResult UpdateLichCongTac(long id)
        {
            AssignUserInfo();
            JsonResultBO editResult = new JsonResultBO(true);

            cctcThanhPhanBusiness = Get <CCTC_THANHPHANBusiness>();
            dmNguoiDungBusiness   = Get <DM_NGUOIDUNGBusiness>();
            lichCongTacBusiness   = Get <LICHCONGTACBusiness>();
            dmDanhMucDataBusiness = Get <DM_DANHMUC_DATABusiness>();

            LICHCONGTAC entity = lichCongTacBusiness.Find(id);

            if (entity != null && entity.IS_DELETE != true && entity.NGAY_CONGTAC.IsOldWeek() == false)
            {
                EditLichCongTacViewModel model = new EditLichCongTacViewModel(entity);
                model.groupOfLanhDaos     = dmNguoiDungBusiness.GetDropDownByDeptParentId(currentUser.DeptParentID.GetValueOrDefault(), entity.LANHDAO_ID.GetValueOrDefault());
                model.groupOfDestinations = dmDanhMucDataBusiness.GetGroupTextByCode(DMLOAI_CONSTANT.DIEM_DEN);
                return(View("EditLichCongTac", model));
            }
            return(Redirect("/Home/UnAuthor"));
        }