예제 #1
0
        public ActionResult DetailList(int?staffId)
        {
            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "StaffFamily", "Staff");
            if (staffId != null)
            {
                ViewBag.Staff = staffsRepository.GetvwStaffsById(staffId.Value);

                IEnumerable <StaffFamilyViewModel> q = StaffFamilyRepository.GetAllStaffFamily().Where(x => x.StaffId == staffId)
                                                       .Select(item => new StaffFamilyViewModel
                {
                    Id             = item.Id,
                    CreatedUserId  = item.CreatedUserId,
                    CreatedDate    = item.CreatedDate,
                    ModifiedUserId = item.ModifiedUserId,
                    ModifiedDate   = item.ModifiedDate,
                    Name           = item.Name,
                    StaffId        = item.StaffId,
                    Address        = item.Address,
                    Birthday       = item.Birthday,
                    Correlative    = item.Correlative,
                    Gender         = item.Gender,
                    Phone          = item.Phone,
                    IsDependencies = item.IsDependencies
                }).OrderByDescending(m => m.ModifiedDate).ToList();

                return(View(q));
            }
            return(View());
        }
예제 #2
0
        public ViewResult Index(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IQueryable <StaffFamilyViewModel> q = StaffFamilyRepository.GetAllStaffFamily().Where(x => x.StaffId == StaffId)
                                                  .Select(item => new StaffFamilyViewModel
            {
                Id            = item.Id,
                CreatedUserId = item.CreatedUserId,
                //CreatedUserName = item.CreatedUserName,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate   = item.ModifiedDate,
                Name           = item.Name,
                StaffId        = item.StaffId,
                Address        = item.Address,
                Birthday       = item.Birthday,
                Correlative    = item.Correlative,
                Gender         = item.Gender,
                Phone          = item.Phone,
                IsDependencies = item.IsDependencies
            }).OrderByDescending(m => m.ModifiedDate);

            ViewBag.SuccessMessage    = TempData["SuccessMessage"];
            ViewBag.FailedMessage     = TempData["FailedMessage"];
            ViewBag.AlertMessage      = TempData["AlertMessage"];
            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "StaffFamily", "Staff");
            //ViewBag.AccessRightEdit = SecurityFilter.AccessRight("Edit", "Technique", "Staff");
            //ViewBag.AccessRightDelete = SecurityFilter.AccessRight("Delete", "Technique", "Staff");
            return(View(q));
        }
예제 #3
0
        public ViewResult Index(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IQueryable <TechniqueViewModel> q = TechniqueRepository.GetAllTechnique().Where(x => x.StaffId == StaffId)
                                                .Select(item => new TechniqueViewModel
            {
                Id            = item.Id,
                CreatedUserId = item.CreatedUserId,
                //CreatedUserName = item.CreatedUserName,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate = item.ModifiedDate,
                Name         = item.Name,
                IdCardDate   = item.IdCardDate,
                IdCardIssued = item.IdCardIssued,
                Rank         = item.Rank,
                StaffId      = item.StaffId
            }).OrderByDescending(m => m.ModifiedDate);

            ViewBag.SuccessMessage    = TempData["SuccessMessage"];
            ViewBag.FailedMessage     = TempData["FailedMessage"];
            ViewBag.AlertMessage      = TempData["AlertMessage"];
            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "Technique", "Staff");
            //ViewBag.AccessRightEdit = SecurityFilter.AccessRight("Edit", "Technique", "Staff");
            //ViewBag.AccessRightDelete = SecurityFilter.AccessRight("Delete", "Technique", "Staff");
            return(View(q));
        }
예제 #4
0
        public ViewResult List(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IQueryable <DayOffViewModel> q = DayOffRepository.GetAllvwDayOff().Where(x => x.StaffId == StaffId)
                                             .Select(item => new DayOffViewModel
            {
                Id            = item.Id,
                CreatedUserId = item.CreatedUserId,
                //CreatedUserName = item.CreatedUserName,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate    = item.ModifiedDate,
                DayEnd          = item.DayEnd,
                DayStart        = item.DayStart,
                Quantity        = item.Quantity,
                QuantityNotUsed = item.QuantityNotUsed,
                StaffId         = item.StaffId,
                TypeDayOffId    = item.TypeDayOffId,
                NameSymbol      = item.NameSymbol,
                //Pay=item.Pay,
                TypeDayOffQuantity = item.TypeDayOffQuantity,
                Code       = item.Code,
                CodeStaff  = item.CodeStaff,
                CodeSymbol = item.CodeSymbol
            }).OrderByDescending(m => m.ModifiedDate);


            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "DayOff", "Staff");
            return(View(q));
        }
예제 #5
0
        public ViewResult Index(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IEnumerable <WorkingProcessViewModel> q = WorkingProcessRepository.GetAllWorkingProcess().Where(x => x.StaffId == StaffId)
                                                      .Select(item => new WorkingProcessViewModel
            {
                Id            = item.Id,
                CreatedUserId = item.CreatedUserId,
                //CreatedUserName = item.CreatedUserName,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate      = item.ModifiedDate,
                Name              = item.Name,
                DayEnd            = item.DayEnd,
                DayStart          = item.DayStart,
                BonusDisciplineId = item.BonusDisciplineId,
                Email             = item.Email,
                Phone             = item.Phone,
                Position          = item.Position,
                StaffId           = item.StaffId,
                WorkPlace         = item.WorkPlace
            }).OrderByDescending(m => m.ModifiedDate).ToList();

            foreach (var item in q)
            {
                if (item.BonusDisciplineId > 0)
                {
                    var code = bonusDesciplineRepository.GetBonusDisciplineById(item.BonusDisciplineId.Value);
                    if (code != null)
                    {
                        item.BonusDiscipline = code.Code;
                    }
                    else
                    {
                        item.BonusDiscipline = "Đã xóa";
                    }
                }
                else
                {
                    item.BonusDiscipline = "Chưa có";
                }
            }
            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "WorkingProcess", "Staff");
            return(View(q));
        }
예제 #6
0
        public ViewResult Index(string BranchId)
        {
            //if (BranchId != null && BranchId.Value > 0)
            //{
            //    ViewBag.BoolOffice = branchRepository.GetBranchById(BranchId.Value).IsOfficeOfAcademicAffairs;
            //}
            var list = staffRepository.GetvwAllStaffs().Where(x => ("," + BranchId + ",").Contains("," + x.DrugStore + ",") == true);
            IEnumerable <StaffsViewModel> q = list.Select(item => new StaffsViewModel
            {
                Id             = item.Id,
                CreatedUserId  = item.CreatedUserId,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                ModifiedDate   = item.ModifiedDate,
                Phone          = item.Phone,
                Email          = item.Email,
                //BranchCode = item.BranchCode,
                //BranchName = item.BranchName,
                //Sale_BranchId = item.Sale_BranchId,
                Birthday     = item.Birthday,
                Code         = item.Code,
                Name         = item.Name,
                PositionId   = item.PositionId,
                PositionName = item.PositionName,
                PositionCode = item.PositionCode
            }).ToList();

            //var position = CategoryRepository.GetAllCategories().Where(x => x.Code == "position");
            //foreach (var item in q)
            //{
            //    if (!string.IsNullOrEmpty(item.Position))
            //    {
            //        item.PositionName = position.Where(x => x.Value == item.PositionId).FirstOrDefault().Name;
            //    }
            //}
            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "Staffs", "Staff");
            ViewBag.AccessRightEdit   = SecurityFilter.AccessRight("Edit", "Staffs", "Staff");
            ViewBag.AccessRightDelete = SecurityFilter.AccessRight("Delete", "Staffs", "Staff");

            ViewBag.AlertMessage = TempData["AlertMessage"];
            ViewBag.BranchId     = BranchId;
            //ViewBag.SchoolId = SchoolId;
            return(View(q));
        }
예제 #7
0
        public ViewResult List(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IQueryable <BonusDisciplineViewModel> q = BonusDisciplineRepository.GetAllvwBonusDiscipline().Where(x => x.StaffId == StaffId)
                                                      .Select(item => new BonusDisciplineViewModel
            {
                Id              = item.Id,
                CreatedUserId   = item.CreatedUserId,
                CreatedUserName = item.CreatedUserName,
                CreatedDate     = item.CreatedDate,
                ModifiedUserId  = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate       = item.ModifiedDate,
                Category           = item.Category,
                DayDecision        = item.DayDecision,
                DayEffective       = item.DayEffective,
                Formality          = item.Formality,
                Note               = item.Note,
                PlaceDecisions     = item.PlaceDecisions,
                Reason             = item.Reason,
                StaffId            = item.StaffId,
                Code               = item.Code,
                BranchDepartmentId = item.BranchDepartmentId,
                BranchName         = item.BranchName,
                CodeName           = item.CodeName,
                Name               = item.Name,
                Position           = item.Position,
                Sale_BranchId      = item.Sale_BranchId,
                Staff_DepartmentId = item.Staff_DepartmentId,
                Gender             = item.Gender,
                ProfileImage       = item.ProfileImage,
                StaffCode          = item.StaffCode,
                Birthday           = item.Birthday,
                PlaceDecisionsName = item.PlaceDecisionsName
            }).OrderByDescending(m => m.ModifiedDate);

            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "BonusDiscipline", "Staff");
            return(View(q));
        }
예제 #8
0
        public ViewResult Index(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IQueryable <ProcessPayViewModel> q = ProcessPayRepository.GetAllProcessPay().Where(x => x.StaffId == StaffId)
                                                 .Select(item => new ProcessPayViewModel
            {
                Id            = item.Id,
                CreatedUserId = item.CreatedUserId,
                //CreatedUserName = item.CreatedUserName,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate = item.ModifiedDate,
                DayDecision  = item.DayDecision,
                DayEffective = item.DayEffective,
                StaffId      = item.StaffId,
                CodePay      = item.CodePay,
                BasicPay     = item.BasicPay
            }).OrderByDescending(m => m.ModifiedDate);

            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "ProcessPay", "Staff");
            return(View(q));
        }
예제 #9
0
        public ViewResult Index(int?StaffId)
        {
            ViewBag.StaffId = StaffId;
            IQueryable <BankViewModel> q = BankRepository.GetAllBank().Where(x => x.StaffId == StaffId)
                                           .Select(item => new BankViewModel
            {
                Id            = item.Id,
                CreatedUserId = item.CreatedUserId,
                //CreatedUserName = item.CreatedUserName,
                CreatedDate    = item.CreatedDate,
                ModifiedUserId = item.ModifiedUserId,
                //ModifiedUserName = item.ModifiedUserName,
                ModifiedDate = item.ModifiedDate,
                Name         = item.Name,
                NameBank     = item.NameBank,
                BranchName   = item.BranchName,
                CodeBank     = item.CodeBank,
                StaffId      = item.StaffId
            }).OrderByDescending(m => m.ModifiedDate);

            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "Bank", "Staff");
            return(View(q));
        }
예제 #10
0
        public ActionResult Diagrams()
        {
            var list      = BranchRepository.GetAllBranch();
            var liststaff = staffRepository.GetAllStaffs().ToList();

            IEnumerable <BranchViewModel> q = list.Where(x => x.ParentId == null).Select(item => new BranchViewModel
            {
                Id = item.Id,
                //CreatedUserId = item.CreatedUserId,
                //CreatedDate = item.CreatedDate,
                //ModifiedUserId = item.ModifiedUserId,
                //ModifiedDate = item.ModifiedDate,
                Name = item.Name,
                Code = item.Code,
                //Address = item.Address,
                //WardId = item.WardId,
                //DistrictId = item.DistrictId,
                //CityId = item.CityId,
                //Phone = item.Phone,
                //Email = item.Email,
                Type     = item.Type,
                ParentId = item.ParentId,
                //MaxDebitAmount=item.MaxDebitAmount
            }).ToList();

            foreach (var item in q)
            {
                item.TotalDepartment = list.Where(x => x.ParentId == item.Id).Count();
                //item.TotalStaff = staffRepository.GetvwAllStaffs().Where(x => x.Sale_BranchId == item.Id).Count();
            }
            ViewBag.AccessRightCreate = SecurityFilter.AccessRight("Create", "Branch", "Staff");
            ViewBag.AccessRightEdit   = SecurityFilter.AccessRight("Edit", "Branch", "Staff");
            ViewBag.AccessRightDelete = SecurityFilter.AccessRight("Delete", "Branch", "Staff");
            ViewBag.AlertMessage      = TempData["AlertMessage"];

            //var branchDepartment = branchDepartmentRepository.GetAllBranchDepartment().ToList();

            var CongTy = settingRepository.GetAlls()
                         .Where(item => item.Code == "settingprint" && item.Key == "companyName")
                         .OrderBy(item => item.Note).ToList();

            if (CongTy.Count() > 0)
            {
                TreeNode Node = new TreeNode("");
                var      _a   = new BranchViewModel()
                {
                    Name = CongTy.Where(x => x.Key == "companyName").FirstOrDefault().Value,
                    Id   = -1
                };

                TreeNode _node = new TreeNode(_a.Name);
                _node.Id        = _a.Id;
                _node.TableName = typeof(TreeNode).Name;
                _node.GuidId    = Guid.NewGuid().ToString();
                _node.ParentId  = null;

                //FormatNode(_node, q.OrderBy(n => n.ParentId), q.Where(n => n.ParentId == null).OrderBy(n => n.IsOfficeOfAcademicAffairs), liststaff);
                //Chi nhánh
                foreach (var branch in q)
                {
                    TreeNode _node_chinhanh = new TreeNode(branch.Name);
                    _node_chinhanh.Id        = branch.Id;
                    _node_chinhanh.TableName = typeof(BranchViewModel).Name;
                    _node_chinhanh.GuidId    = Guid.NewGuid().ToString();
                    _node_chinhanh.TypeName  = "Branch";
                    _node_chinhanh.ParentId  = _node.Id;

                    //Thêm phòng ban
                    var deparmentByBranchs = list.Where(n => n.ParentId != null && n.ParentId == branch.Id).ToList();
                    if (deparmentByBranchs != null && deparmentByBranchs.Count() > 0)
                    {
                        foreach (var branchDeparment in deparmentByBranchs)
                        {
                            TreeNode _node_phongban = new TreeNode(branchDeparment.Name);
                            _node_phongban.Id        = branchDeparment.Id;
                            _node_phongban.TableName = typeof(BranchViewModel).Name;
                            _node_phongban.GuidId    = Guid.NewGuid().ToString();
                            _node_phongban.ParentId  = branch.Id;
                            _node_phongban.TypeName  = "DrugStore";
                            _node_chinhanh.ChildNode.Add(_node_phongban);
                        }
                    }

                    _node.ChildNode.Add(_node_chinhanh);
                }

                //Phòng ban (Nhân viên)
                Node.ChildNode.Add(_node);
                ViewBag.TreeNode = Node;
            }
            else
            {
                ViewBag.FailedMessage = "Chưa có thông tin khởi tạo của Công ty";
            }

            return(View(q));
        }