Exemplo n.º 1
0
        public ActionResult Detail(int id)
        {
            var hoso        = HoSoCongViecRepository.Single(id);
            var init        = InitModel();
            var coQuanInfos = CoQuanRepository.GetAll().Select(x => x.ToDataInfo());

            var model = new EditCongViecViewModel
            {
                Id                      = id,
                UsersInfos              = init.UsersInfos,
                LinhVucCongViecInfos    = init.LinhVucCongViecInfos,
                TrangThaiCongViecInfos  = init.TrangThaiCongViecInfos,
                CoQuanInfos             = coQuanInfos,
                LinhVucCongViecId       = hoso.LinhVucCongViecId,
                VanBanLienQuanViewModel = hoso.CongViecVanBanResults.ToList(),
                QuaTrinhXuLyViewModel   = hoso.CongViecQuaTrinhXuLyResult.ToList(),
                NgayHetHan              = hoso.NgayHetHan,
                NgayKhoiTao             = hoso.NgayTao,
                NoiDungCongViec         = hoso.NoiDung,
                TrangThaiCongViecId     = hoso.TrangThaiCongViecId,
                UserPhuTrachId          = hoso.UserPhuTrachId,
                UserXuLyChinhId         = hoso.UserXuLyId,
                UsersPhoiHopId          = hoso.CongViecPhoiHopResult.Select(x => x.UserId).ToArray(),
                DanhGiaCongViec         =
                    hoso.DanhGiaCongViec.HasValue
                        ? (EnumDanhGiaCongViec)hoso.DanhGiaCongViec.Value
                        : EnumDanhGiaCongViec.LEVEL0,
                JsonFiles = GetPathFiles(EnsureFolderCongViec(id))
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Add()
        {
            var init  = InitModel();
            var model = new AddCongViecViewModel
            {
                UsersInfos              = init.UsersInfos,
                LinhVucCongViecInfos    = init.LinhVucCongViecInfos,
                TrangThaiCongViecInfos  = init.TrangThaiCongViecInfos,
                VanBanLienQuanViewModel = new List <InitVanBanViewModel>
                {
                    new InitVanBanViewModel
                    {
                        CoQuanInfos = CoQuanRepository.GetAll().Select(x => x.ToDataInfo())
                    }
                },
                QuaTrinhXuLyViewModel = new List <InitQuaTrinhXuLyViewModel>
                {
                    new InitQuaTrinhXuLyViewModel
                    {
                        Gio       = 0,
                        Ngay      = new DateTime(),
                        NoiDung   = string.Empty,
                        NguoiThem = UserName
                    }
                },
                Guid = Guid.NewGuid().ToString()
            };

            return(View(model));
        }
Exemplo n.º 3
0
        public PartialViewResult CoQuanLienQuan(int?id)  //id: tacNghiepId
        {
            var model = CoQuanRepository.GetAll().GroupBy(x => x.NhomCoQuan, x => x, (key, cq) =>
                                                          new InitCoQuanCoLienQuan
            {
                NhomCoQuan  = key,
                CoQuanInfos = cq.Select(q => q.ToDataInfo()).ToList(),
            });

            return(PartialView("_PartialPageGroupListBodies", model));
        }
Exemplo n.º 4
0
        public PartialViewResult List(int?page)
        {
            var nhom  = NhomCoQuanRepository.GetAll().Select(x => x.ToDataInfo());
            var items = CoQuanRepository.GetAll().Select(x => x.ToDataViewModel().Update(u =>
            {
                u.NhomCoQuanInfos = nhom;
                u.NhomCoQuanInfo  = NhomCoQuanRepository.GetById(x.NhomCoQuanId).ToDataInfo();
            })).ToList();

            var pageNumber = page ?? 1;

            return(PartialView(items.ToPagedList(pageNumber, TechOfficeConfig.PAGESIZE)));
        }
Exemplo n.º 5
0
        public ActionResult Create()
        {
            var cvs   = ChucVuRepository.GetAll().Select(x => x.ToDataInfo()).ToList();
            var roles = RoleRepository.GetAll().Select(x => x.ToRoleViewModel()).ToList();
            var cqs   = CoQuanRepository.GetAll().Select(x => x.ToDataInfo()).ToList();

            var userInfo = new AddUserViewModel
            {
                RoleInfos   = roles,
                ChucVuInfos = cvs,
                CoQuanInfos = cqs,
            };

            return(View(userInfo));
        }
Exemplo n.º 6
0
        private ThuTucViewModel IniViewModel()
        {
            _listLinhVucThuTuc = LinhVucThuTucRepository.GetAll().OrderByDescending(x => x.Id);
            _listLinhVucThuTuc.ToList().ForEach(x =>
            {
                x.Ten = string.Format("{0}{1}", GetNameMultiple(x), x.Ten);
            });

            var data = new ThuTucViewModel
            {
                CoQuanInfos       = CoQuanRepository.GetAll().Select(x => x.ToDataInfo()),
                LinhVucThuTucInfo = _listLinhVucThuTuc.OrderBy(x => x.Id).Select(x => x.ToDataInfo()),
            };

            return(data);
        }
Exemplo n.º 7
0
        private InitThuTucViewModel CreateVanBanModel(string thuTucCongViec, int?coQuanId, int?linhVucCongViecId)
        {
            var model = new InitThuTucViewModel
            {
                LinhVucThuTucInfo = LinhVucThuTucRepository.GetAll().Select(x => x.ToDataInfo()),
                CoQuanInfos       = CoQuanRepository.GetAll().Select(x => x.ToDataInfo()),
                ValueSearch       = new ValueSearchViewModel
                {
                    ThuTucCongViec  = thuTucCongViec,
                    CoQuanId        = coQuanId,
                    LinhVucThuTucId = linhVucCongViecId,
                    Page            = 1,
                },
            };

            return(model);
        }
Exemplo n.º 8
0
        public ActionResult StatisticAndSearch()
        {
            //var items = HoSoCongViecRepository.Statistic();
            //get list users belong phongnoivu
            var users =
                UserRepository.GetUsersByCoQuanId(TechOfficeConfig.IDENTITY_PHONGNOIVU).Select(x => x.ToDataInfo());
            var linhVucs           = LinhVucCongViecRepository.GetAll().Select(x => x.ToDataInfo());
            var coquan             = CoQuanRepository.GetAll().Select(x => x.ToDataInfo());
            var trangThaiCongViecs = TrangThaiCongViecRepository.GetAll().Select(x => x.ToDataInfo());

            var model = new InitValueStatictisSearchViewModel
            {
                From                   = DateTime.Now.AddMonths(-1),
                To                     = DateTime.Now,
                UserInfoNoiVu          = users,
                LinhVucCongViecInfos   = linhVucs,
                CoQuanInfos            = coquan,
                TrangThaiCongViecInfos = trangThaiCongViecs
            };

            return(View(model));
        }
Exemplo n.º 9
0
        public ActionResult Edit(int id)
        {
            var user     = UserRepository.Single(id);
            var chucvu   = ChucVuRepository.GetAll().Select(x => x.ToDataInfo());
            var coQuan   = CoQuanRepository.GetAll().Select(x => x.ToDataInfo());
            var userRole = UserRoleRepository.GetRolesByUserId(id);

            var roles = RoleRepository.GetAll().ToList();

            roles.ForEach(x =>
            {
                userRole.ToList().ForEach(y =>
                {
                    if (y.RoleId == x.Id)
                    {
                        x.IsChecked = true;
                    }
                });
            });


            AddUserViewModel model = new AddUserViewModel
            {
                Id          = user.Id,
                FullName    = user.HoVaTen,
                UserName    = user.UserName,
                IsLocked    = user.IsLocked,
                ChucVuId    = user.ChucVuId,
                ChucVuInfos = chucvu,
                CoQuanId    = user.CoQuanId,
                CoQuanInfos = coQuan,
                CreateDate  = user.CreateDate,
                CreatedBy   = user.CreatedBy,
                RoleInfos   = roles.Select(x => x.ToRoleViewModel()).ToList(),
            };

            return(View(model));
        }