Beispiel #1
0
        public string GetTreeGridJson(string id)
        {
            Companyhandling ch = new Companyhandling();

            List <company> group = ch.SearchSonCompany(id);

            return(group.ToTreeGrid());
        }
Beispiel #2
0
        public string GetTreeGridJson()
        {
            Companyhandling ch    = new Companyhandling();
            admin           a     = new Admin().GetAdminMsg(Convert.ToInt64(sc.GetHrSession()));
            List <company>  group = ch.SearchSonCompany(a.admin_CompanyID);

            return(group.ToTreeGrid());
        }
Beispiel #3
0
        //
        // GET: /Company/
        #region 暂时包起来吧

        public ActionResult Index(string id)
        {
            Companyhandling ch = new Companyhandling();

            //如果公司Id不存在

            if (!ch.IsheadCompanyIdExist(id))
            {
                ViewBag.id = id;
                return(View("NotFind"));
            }
            company com = ch.SearchCompany(id);

            ViewBag.company_Name  = com.company_Name;
            ViewBag.id            = id;
            ViewBag.companyStatus = new Companyhandling().GetCompnayStatus(id);
            return(View());
        }
Beispiel #4
0
        /// <summary>
        /// 员工管理
        /// </summary>
        /// <returns></returns>
        public ActionResult StaffManage(string id)
        {
            string comId     = Request["parameter0"];
            int    pageIndex = Convert.ToInt32(Request["parameter1"]);
            int    pageSize  = Convert.ToInt32(Request["parameter2"]);
            string pageClass = Request["parameter3"];
            long   totalNum  = 0;

            ViewBag.searchVal = "all";
            Companyhandling ch = new Companyhandling();

            //编号为COmid的公司不存在
            if (!ch.IsCompanyIdExist(comId))
            {
                return(View("NotFind"));
            }
            StaffHanding sh = new StaffHanding();

            //如果请求公司下属全部员工
            if (pageClass == "all")
            {
                List <staff> staffs = sh.SelectAllStaffByComID(comId, pageIndex, pageSize, out totalNum);
                ViewBag.staffs = staffs;
            }
            else if (pageClass == "search")
            {
                string name  = Request["parameter4"];
                string value = Request["parameter5"];
                if (name == "trueName")
                {
                    //按名称搜,返回所有结果
                    List <staff> staffs = sh.SearchAllStaffsByValue(comId, value);
                    pageIndex = 1;

                    totalNum       = staffs.Count;
                    ViewBag.staffs = staffs;
                }
                else if (name == "email")
                {
                    //按邮件搜,,返回所有结果
                    List <staff> staffs = sh.SearchAllStaffsByEmail(comId, value);
                    pageIndex      = 1;
                    totalNum       = staffs.Count;
                    ViewBag.staffs = staffs;
                }
            }
            else if (pageClass == "dep")
            {
                string       value  = Request["parameter4"];
                List <staff> staffs = sh.GetStaffByDepartment(comId, value);
                pageIndex = 1;

                totalNum       = staffs.Count;
                ViewBag.staffs = staffs;
            }
            else
            {//请求本公司员工
                List <staff> staffs = sh.SelectStaffByComID(comId, pageIndex, pageSize, out totalNum);
                ViewBag.staffs    = staffs;
                ViewBag.searchVal = "notAll";
            }
            ViewBag.pageIndex = pageIndex;

            ViewBag.pageSize = pageSize;

            ViewBag.totNum  = totalNum;
            ViewBag.id      = Request["dataId"].Split('#')[1];
            ViewBag.tableId = ViewBag.id + "1";
            ViewBag.ComId   = comId;
            return(PartialView());
        }