Ejemplo n.º 1
0
        public PartialViewResult ChangeDonVi(string DONVI_ID)
        {
            DM_NGUOIDUNGBusiness = Get <DM_NGUOIDUNGBusiness>();
            List <SelectListItem> ListNguoiDung = DM_NGUOIDUNGBusiness.GetByPhongBan(DONVI_ID.ToListInt(','), 0, new List <int>())
                                                  .Select(x => new SelectListItem
            {
                Text  = x.HOTEN,
                Value = x.ID.ToString()
            }).ToList();

            return(PartialView("_ListNhanVien", ListNguoiDung));
        }
Ejemplo n.º 2
0
        //private List<>
        #endregion
        #region Các hàm partialview
        public PartialViewResult GetUserPhongBan(int id)
        {
            DM_NGUOIDUNGBusiness   = Get <DM_NGUOIDUNGBusiness>();
            CCTC_THANHPHANBusiness = Get <CCTC_THANHPHANBusiness>();
            var        model = new DungLuongLuuTruModel();
            List <int> Ids   = CCTC_THANHPHANBusiness.GetDSChild(id).Select(x => x.ID).ToList();

            Ids.Add(id);
            var lstUser = DM_NGUOIDUNGBusiness.GetByPhongBan(Ids, 0, new List <int>());
            var node    = CCTC_THANHPHANBusiness.Find(id);

            model.Item          = node;
            model.ListNguoiDung = lstUser;
            return(PartialView("_DsNguoiDungPartial", model));
        }
Ejemplo n.º 3
0
        public ActionResult DanhGiaChatLuong()
        {
            CCTC_THANHPHANBusiness = Get <CCTC_THANHPHANBusiness>();
            DM_NGUOIDUNGBusiness   = Get <DM_NGUOIDUNGBusiness>();
            AssignUserInfo();
            // Chỉ lấy các khối đơn vị
            ReportViewModel model = new ReportViewModel();

            if (IsInActivities(currentUser.ListThaoTac, PermissionVanbanModel.DONVI))
            {
                List <SelectListItem> LstCoCauToChuc = CCTC_THANHPHANBusiness.repository.All().Where(x => x.PARENT_ID == currentUser.DeptParentID && x.ID != currentUser.DM_PHONGBAN_ID).Select(
                    x => new SelectListItem()
                {
                    Text  = x.NAME,
                    Value = x.ID.ToString(),
                }).ToList();
                model.LstCoCauToChuc    = LstCoCauToChuc;
                model.LstDonVi          = new List <SelectListItem>();
                model.HasRoleAssignUnit = true;
                model.LstNhanVien       = new List <SelectListItem>();
            }
            else if (IsInActivities(currentUser.ListThaoTac, PermissionVanbanModel.PHONGBAN))
            {
                CCTC_THANHPHAN DonVi = CCTC_THANHPHANBusiness.Find(currentUser.DM_PHONGBAN_ID);
                if (DonVi != null)
                {
                    SelectListItem selectListItem = new SelectListItem();
                    selectListItem.Text     = DonVi.NAME;
                    selectListItem.Value    = DonVi.ID.ToString();
                    selectListItem.Selected = true;
                    List <SelectListItem> selectListItems = new List <SelectListItem>();
                    selectListItems.Add(selectListItem);
                    model.LstCoCauToChuc = selectListItems;
                    model.LstDonVi       = CCTC_THANHPHANBusiness.GetDataByParent(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0, 0);
                }
                else
                {
                    model.LstCoCauToChuc = new List <SelectListItem>();
                    model.LstDonVi       = new List <SelectListItem>();
                }
                model.HasRoleAssignDepartment = true;
                model.LstNhanVien             = new List <SelectListItem>();
                if (model.LstDonVi.Count == 0 && currentUser.DM_PHONGBAN_ID.HasValue)
                {
                    List <int> LstTmpDonVi = new List <int>();
                    LstTmpDonVi.Add(currentUser.DM_PHONGBAN_ID.Value);
                    model.LstNhanVien = DM_NGUOIDUNGBusiness.GetByPhongBan(LstTmpDonVi, 0, new List <int>())
                                        .Select(x => new SelectListItem
                    {
                        Text  = x.HOTEN,
                        Value = x.ID.ToString()
                    }).ToList();
                }
            }
            else if (IsInActivities(currentUser.ListThaoTac, PermissionVanbanModel.CANHAN))
            {
                CCTC_THANHPHAN DonVi = CCTC_THANHPHANBusiness.Find(currentUser.DM_PHONGBAN_ID);
                if (DonVi != null)
                {
                    SelectListItem selectListItem = new SelectListItem();
                    selectListItem.Text     = DonVi.NAME;
                    selectListItem.Value    = DonVi.ID.ToString();
                    selectListItem.Selected = true;
                    List <SelectListItem> selectListItems = new List <SelectListItem>();
                    selectListItems.Add(selectListItem);
                    model.LstDonVi    = selectListItems;
                    model.LstNhanVien = DM_NGUOIDUNGBusiness.GetDsNguoiDung(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0);
                }
                else
                {
                    model.LstDonVi = new List <SelectListItem>();
                }
                model.HasRoleAssignChuyenVien = true;
            }
            return(View(model));
        }