Esempio n. 1
0
        public ActionResult PersonsEntryList(string loginid, int page = 1)
        {
            if (!string.IsNullOrEmpty(loginid))
            {
                ViewBag.LoginID = loginid;
            }
            else
            {
                ViewBag.LoginID = "";
            }
            CustomerOutsourc custOut = custOutDAL.GetModelByID(Convert.ToInt32(loginid));
            int?types = null;

            if (custOut != null)
            {
                types        = custOut.Type;
                ViewBag.Type = types;
            }

            List <PersonsEntrySet> list = null;

            if (types != null)
            {
                switch (types)
                {
                case 1:
                    #region  外包公司
                    OutsourcingCompany outsourcing = outCompanyDAL.GetOutsourcingCompany(custOut.CompanyUserName);
                    if (outsourcing != null)
                    {
                        list = personEntryDAL.GetModelList(outsourcing.CompnayId);
                    }
                    else
                    {
                        list = new List <PersonsEntrySet>();
                    }
                    #endregion
                    break;

                case 2:
                    #region  客户公司
                    Outsourcing.EF.CustomerCompnay customer = customerCompnayDAL.GetModel(custOut.CompanyUserName);
                    if (customer != null)
                    {
                        list = personEntryDAL.GetModelList(customer.CompnayId, 2);
                    }
                    else
                    {
                        list = new List <PersonsEntrySet>();
                    }
                    #endregion
                    break;
                }
            }
            Models.PersonsEntrySetViewModel viewModel = new Models.PersonsEntrySetViewModel();
            viewModel.PersonsEntrySets = list.Where(m => m.ResignedDate == null).ToPagedList(page, 8);
            return(View(viewModel));
        }
Esempio n. 2
0
        /// <summary>
        /// 所属的公司的查询
        /// </summary>
        /// <param name="loginid"></param>
        /// <param name="type"></param>
        /// <param name="StaffName"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult RecManagements(string loginid, string type, string StaffName, int page = 1)
        {
            if (!string.IsNullOrEmpty(loginid))
            {
                ViewBag.LoginID = loginid;
            }
            else
            {
                ViewBag.LoginID = "";
            }
            if (!string.IsNullOrEmpty(type))
            {
                ViewBag.Type = type;
            }
            else
            {
                ViewBag.Type = "";
            }
            int outID = Convert.ToInt32(Session["ID"]);

            Models.PersonsEntrySetViewModel viewModel   = new Models.PersonsEntrySetViewModel();
            List <PersonsEntrySet>          requirement = null;

            if (!string.IsNullOrWhiteSpace(StaffName))
            {
                StaffName             = HttpUtility.UrlDecode(StaffName);
                requirement           = personEntryDAL.QueryModelList(string.Format("  b. like '%{0}%'", StaffName));
                ViewBag.CurrentFilter = StaffName;
            }
            else
            {
                requirement = personEntryDAL.QueryModelList(string.Format("   b.IsDelete=1", outID));
            }
            viewModel.PersonsEntrySets = requirement.ToPagedList(page, 6);
            return(View(viewModel));
        }