Example #1
0
        public ActionResult ModifyHeadImg()
        {
            var currentCpy = GetCurrentUser();

            ViewData.Model = CompanyBll.LoadEntities(c => c.Id == currentCpy.Id).FirstOrDefault();
            return(View());
        }
Example #2
0
        public ActionResult Get_CpyPackage(int limit, int offset, string gameName, DateTime?startday, DateTime?endday)
        {
            var currentCpy = GetCurrentUser();
            var allCpy     = CompanyBll.LoadEntities(c => c.Id > 0).Select(c => new { c.Id, c.CompanyName });
            var allPackage = PackageBll.LoadEntities(p => p.Id > 0).Select(p => new { p.CompanyId, p.Type, p.EndDate, p.StartDate, p.State, p.GameName, p.GiftName, p.ServerName, p.Id });
            var data       = from c in allCpy
                             join p in allPackage on c.Id equals p.CompanyId
                             where p.CompanyId == currentCpy.Id
                             select new { p.EndDate, p.StartDate, p.State, p.GameName, p.GiftName, p.ServerName, p.Id, c.CompanyName, p.Type };

            if (!string.IsNullOrEmpty(gameName))
            {
                data = data.Where(d => d.GameName.Contains(gameName));
            }
            if (startday.HasValue || endday.HasValue)
            {
                endday = endday.Value.AddDays(1);
                data   = data.Where(d => d.StartDate >= startday && d.EndDate <= endday);
            }
            var total = data.Count();
            var rows  = data.OrderByDescending(d => d.Id)

                        .Skip(offset).Take(limit).ToList();

            return(Json(new { total = total, rows = rows }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult UpdateEmail(FormCollection form)
        {
            //1.采集用户的输入
            string  oldemail = form["oldemail"].Trim();
            string  newemail = form["newemail"].Trim();
            Company cpy      = GetCurrentUser();

            cpy = CompanyBll.LoadEntities(c => c.Id == cpy.Id).FirstOrDefault();
            if (cpy.Email == oldemail)
            {
                //3.校验旧密码是否正确
                //根据guid拿到当前登录的用户

                if (cpy.Email == newemail)
                {
                    return(Content("exist"));
                }
                else
                {
                    //4.修改邮箱
                    cpy.Email = newemail;
                    if (CompanyBll.Update(cpy))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
            }
            return(Content("different"));
        }
Example #4
0
        public ActionResult EditCpyPwd()
        {
            //1.采集用户的输入
            string oldPwd = Request.Form["oldPwd"].Trim() as string;
            //  string Md5oldPwd = Md5Helper.GetMd5(oldPwd);
            string  newPwd     = Request.Form["newPwd"].Trim() as string;
            string  confirmPwd = Request.Form["confirmPwd"].Trim() as string;
            Company cpy        = GetCurrentUser();

            // string Md5confirmPwd = Md5Helper.GetMd5(confirmPwd);
            //2.校验两次输入的新密码是否正确
            //3.校验旧密码是否正确
            //根据guid拿到当前登录的用户
            cpy = CompanyBll.LoadEntities(c => c.Id == cpy.Id).FirstOrDefault();
            if (cpy.Pwd != oldPwd)
            {
                return(Content("different"));
            }
            else
            {
                cpy.Pwd = confirmPwd;
                if (CompanyBll.Update(cpy))
                {
                    return(Content("ok"));
                }
                else
                {
                    return(Content("no"));
                }
            }
        }
Example #5
0
 public ActionResult Edit(int id)
 {
     // int id
     //int id = int.Parse(Request["id"] ?? "1");
     ViewData.Model = CompanyBll.LoadEntities(c => c.Id == id).FirstOrDefault();
     return(View());
 }
Example #6
0
        public ActionResult CompanyDelete(int id)
        {
            var cpy = CompanyBll.LoadEntities(c => c.Id == id).FirstOrDefault();

            cpy.DelFlag = (short)Models.Enum.DelFlagEnum.Deleted;
            if (CompanyBll.Update(cpy))
            {
                return(Content("ok"));
            }
            else
            {
                return(Content("no"));
            }
            //if (string.IsNullOrEmpty(ids))
            //{
            //    return Content("empty");
            //}
            //string[] allIds = ids.Split(',');
            //List<int> idList = new List<int>();
            //foreach (var i in allIds)
            //{
            //    idList.Add(int.Parse(i));
            //}
            //if (CompanyBll.DeleteCompanys(idList) > 0)
            //{
            //    return Content("ok");
            //}
            //else {
            //    return Content("no");
            //}
        }
Example #7
0
        public ActionResult CheckUName()
        {
            string uName    = Request["uname"];
            var    cpyUname = CompanyBll.LoadEntities(c => c.UName == uName);

            return(Json(cpyUname, JsonRequestBehavior.AllowGet));
        }
Example #8
0
        public ActionResult RechargeTotal(DateTime?time)
        {
            int    id        = int.Parse(Request["id"]);
            int    pageIndex = int.Parse(Request["pageIndex"] ?? "1");
            int    pageSize  = int.Parse(Request["pageSize"] ?? "20");
            int    total     = 0;
            string comboName = Request["comboName"];
            var    param     = new RechargeParam()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                Total     = total,
                CompanyId = id,
                comboName = comboName,
                InTime    = time
            };

            ViewData.Model = CompanyBll.LoadEntities(r => r.Id == id).FirstOrDefault();
            var list = RechargeBll.LoadRechargeTotal(param).ToList();

            ViewBag.CurrentId     = id;
            ViewData["Recharge"]  = list;
            ViewData["pageCount"] = param.Total;
            ViewData["pageSize"]  = param.PageSize;
            ViewData["pageIndex"] = param.PageIndex;
            return(View());
        }
Example #9
0
 public ActionResult Manufacturer()
 {
     ViewBag.RecCompany = CompanyBll.ForumRecCompany();
     ViewBag.SeoCpy     = SeoBll.GetSeoData(3, "1");
     ViewData["advert"] = AdvertisementBll.GetAllTypeAdvert("3", 2);
     return(View());
 }
Example #10
0
        public ActionResult CompanyGameNum(int id)
        {
            int    pageIndex = int.Parse(Request["pageIndex"] ?? "1");
            int    pageSize  = int.Parse(Request["pageSize"] ?? "20");
            string gameName  = Request["gamename"];
            string type      = Request["type"];
            int    total     = 0;
            var    param     = new CpyGameParam()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                Total     = total,
                GameName  = gameName,
                CompanyId = id,
                Type      = type
            };
            var list = CompanyGameBll.LoadCpyGame(param).ToList();

            ViewData["CompanyGame"] = list;
            ViewData["pageCount"]   = param.Total;
            ViewData["pageSize"]    = param.PageSize;
            ViewData["pageIndex"]   = param.PageIndex;
            ViewBag.CurrentId       = id;
            ViewData.Model          = CompanyBll.LoadEntities(r => r.Id == id).FirstOrDefault();
            return(View());
        }
Example #11
0
        public void GetCompanyMemberInfoTest()
        {
            var companyBll = new CompanyBll();
            var memberInfo = companyBll.GetCompanyMemberInfo("112");

            Assert.AreEqual(memberInfo.ID, "112");
            Assert.AreEqual(memberInfo.Name, "Emp1");
        }
Example #12
0
        public void ComputeSalariesBasedOnPerformanceTest()
        {
            var companyBll = new CompanyBll();

            companyBll.ComputeSalariesBasedOnPerformances();
            var result = companyBll.GetTotalForSalaries();

            Assert.AreEqual(32218, result);
        }
Example #13
0
        public ActionResult Edit(FormCollection form, int id)
        {
            int sex = int.Parse(Request["sex"].ToString());

            var cpy = CompanyBll.LoadEntities(u => u.Id == id).FirstOrDefault();

            if (cpy != null)
            {
                if (form["logoImg"] == null)
                {
                    cpy.Email       = form["email"];
                    cpy.SystemName  = form["systemName"];
                    cpy.WebSite     = form["webSite"];
                    cpy.CompanyName = form["cpyName"];
                    cpy.Phone       = form["phone"];
                    cpy.Address     = form["address"];
                    cpy.CopanyMsg   = form["companyMsg"];
                    cpy.Contacts    = form["contacts"];
                    cpy.Office      = form["office"];
                    cpy.Moblie      = form["moblie"];
                    cpy.QQ          = form["qq"];
                    cpy.Sex         = sex;
                    cpy.InTime      = DateTime.Now;
                }
                else
                {
                    cpy.Email       = form["email"];
                    cpy.SystemName  = form["systemName"];
                    cpy.WebSite     = form["webSite"];
                    cpy.CompanyName = form["cpyName"];
                    cpy.Phone       = form["phone"];
                    cpy.Address     = form["address"];
                    cpy.CopanyMsg   = form["companyMsg"];
                    cpy.Contacts    = form["contacts"];
                    cpy.Office      = form["office"];
                    cpy.Moblie      = form["moblie"];
                    cpy.QQ          = form["qq"];
                    cpy.Sex         = sex;
                    cpy.Logo        = form["logoImg"];
                    cpy.InTime      = DateTime.Now;
                }


                if (CompanyBll.Update(cpy))
                {
                    return(Content("ok"));
                }
                else
                {
                    return(Content("修改失败"));
                }
            }
            return(Content("数据为空"));
        }
Example #14
0
        public ActionResult UdateCpyPersonalInfo(int id, string contacts, string office, string mobile, string qq, int sex)
        {
            var cpy = CompanyBll.LoadEntities(c => c.Id == id).FirstOrDefault();

            cpy.Contacts = contacts;
            cpy.Office   = office;
            cpy.Moblie   = mobile;
            cpy.QQ       = qq;
            cpy.Sex      = sex;
            CompanyBll.Update(cpy);
            return(Json(cpy, JsonRequestBehavior.AllowGet));
        }
Example #15
0
        public ActionResult FindPwd(string email)
        {
            var cpy = CompanyBll.LoadEntities(c => email.Equals(c.Email) || email.Equals(c.UName)).FirstOrDefault();

            if (cpy != null)
            {
                return(Json(new { Success = true, Tel = cpy.Moblie, Id = cpy.Id }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Success = false, Msg = "用户名或邮箱输入有误!" }, JsonRequestBehavior.AllowGet));
            }
        }
Example #16
0
        public ActionResult GetCompanyList()
        {
            int    pageIndex = int.Parse(Request["pageIndex"] ?? "1");
            int    pageSize  = int.Parse(Request["pageSize"] ?? "15");
            int    total     = 0;
            string key       = Request["key"];
            string py        = Request["py"];
            var    data      = CompanyBll.CompanyList(pageIndex, pageSize, out total, key, py);
            var    NavStr    = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, total);
            var    result    = new { Data = data, NavStr = NavStr };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #17
0
        public ActionResult UpdateCpyInfo(int id, string systemname, string website, string companyname, string phone, string address)
        {
            var cpy = CompanyBll.LoadEntities(c => c.Id == id).FirstOrDefault();

            cpy.SystemName  = systemname;
            cpy.WebSite     = website;
            cpy.CompanyName = companyname;
            cpy.Phone       = phone;
            cpy.Address     = address;
            cpy.State       = 2;
            CompanyBll.Update(cpy);
            return(Json(cpy, JsonRequestBehavior.AllowGet));
        }
Example #18
0
        /// <summary>
        /// 厂商详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult CpyDetails(int id)
        {
            int gameCount = 0;

            ViewData.Model    = CompanyBll.GetCpyDetails(id, out gameCount);
            ViewBag.gameCount = gameCount;
            //厂商相关的新游、热游、手游新闻
            ViewBag.CurrentCpyNews = CompanyBll.CurrentCpyNews(id);
            //当前厂商相关开服
            ViewBag.CurrentCpyService = OpenServiceBll.CurrentCpyService(id);
            //当前厂商礼包
            ViewBag.Package    = CompanyBll.CurrnetCpyPackage(id);
            ViewData["advert"] = AdvertisementBll.GetAllTypeAdvert("3", 2);
            return(View());
        }
        public ToUserFromStoreViewModel()
        {
            StoreBll           = new StoreBll();
            CompanyBll         = new CompanyBll();
            LocationBll        = new LocationBll();
            OperationBll       = new OperationBll();
            ToUserFromStore    = new ToUserFromStoreModel();
            Company            = new ObservableCollection <CompanyModel>();
            Location           = new ObservableCollection <LocationModel>();
            SearchCommand      = new RelayCommand <string>(OnSearch);
            SubmitCommand      = new RelayCommand(OnSubmit);
            OperationTypeEnums = new OperationTypeEnums();
            StatusEnums        = new StatusEnums();

            BindData();
        }
Example #20
0
        public ActionResult UpdateHeadImg(FormCollection form)
        {
            var    bigFile    = Request.Files["headImg"];
            string imgPath    = form["real_headimg"];
            var    currentCpy = GetCurrentUser();

            if (bigFile.ContentLength > 0)
            {
                // var file = Request.Files[0];
                //拿到文件的扩展名
                string extName = Path.GetExtension(bigFile.FileName);
                if (bigFile.ContentType == "image/jpeg" || bigFile.ContentType == "image/jpg" || bigFile.ContentType == "image/png"
                    )
                {
                    Random r = new Random();
                    //给文件取新名字
                    string fileName = DateTime.Now.ToString("yyyy-MM-dd") + r.Next(100, 1000) + extName;
                    //用户文件夹的物理路径(绝对路径)
                    String virthPath = "/Content/UserImg/" + fileName;
                    String name      = Server.MapPath(virthPath);
                    bigFile.SaveAs(name);

                    var cpy = CompanyBll.LoadEntities(c => c.Id == currentCpy.Id).FirstOrDefault();
                    cpy.Head = fileName;
                    CompanyBll.Update(cpy);
                    return(Content(fileName));//返回文件名
                }
                else
                {
                    return(Content("typeError"));
                }
            }
            else if (imgPath != "")
            {
                var cpy = CompanyBll.LoadEntities(c => c.Id == currentCpy.Id).FirstOrDefault();
                // string[] data =;
                cpy.Head = imgPath.Substring(13);
                CompanyBll.Update(cpy);
                return(Content(imgPath.Substring(13)));
            }
            else
            {
                return(Content("empty"));
            }
        }
Example #21
0
        // Constructor
        public ChangeUserViewModel()
        {
            CompanyBll   = new CompanyBll();
            LocationBll  = new LocationBll();
            OperationBll = new OperationBll();

            Company  = new ObservableCollection <CompanyModel>();
            Location = new ObservableCollection <LocationModel>();

            SearchCommand = new RelayCommand <string>(OnSearch);
            SubmitCommand = new RelayCommand(OnSubmit);
            CleanCommand  = new RelayCommand(onClean);

            OperationTypeEnums = new OperationTypeEnums();
            StatusEnums        = new StatusEnums();

            BindData();
        }
Example #22
0
        public ActionResult ChangeCompanyState(int id)
        {
            Company cpy = new Company()
            {
                Id = id,
            };

            if (cpy != null)
            {
                var cpyState = CompanyBll.LoadEntities(C => C.Id == id).FirstOrDefault();
                //当前用户状态等于0的改变为1
                if (cpyState.State == 0)
                {
                    cpyState.State = 1;

                    if (CompanyBll.Update(cpyState))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
                else
                {
                    cpyState.State = 0;
                    if (CompanyBll.Update(cpyState))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
            }
            else
            {
                return(Content("empty"));
            }
        }
Example #23
0
        /// <summary>
        /// 该厂商下的联运等游戏
        /// </summary>
        /// <returns></returns>
        public ActionResult JoinGame()
        {
            int    companyId = int.Parse(Request["id"]);
            string type      = Request["type"];
            int    pageIndex = int.Parse(Request["pageIndex"] ?? "1");
            int    pageSize  = int.Parse(Request["pageSize"] ?? "12");
            int    total     = 0;
            var    param     = new GameParam()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                Total     = total,
                Type      = type,
                CompanyId = companyId
            };
            var    data   = CompanyBll.currentCpyGame(param).ToList();
            string strNav = LaomaPager.ShowPageNavigate(param.PageSize, param.PageIndex, param.Total);
            var    result = new { Data = data, NavStr = strNav };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #24
0
        public ActionResult ResetCpyPwd(int id, string newPwd)
        {
            var cpy = CompanyBll.LoadEntities(c => c.Id == id).FirstOrDefault();

            if (cpy != null)
            {
                cpy.Pwd = newPwd;
                if (CompanyBll.Update(cpy))
                {
                    return(Content("ok,密码重置成功!"));
                }
                else
                {
                    return(Content("no,密码重置失败!"));
                }
            }
            else
            {
                return(Content("no,没有该用户相应的信息"));
            }
        }
        private void BindData()
        {
            var companies = CompanyBll.GetAllList(x => x.IsActive == true);

            foreach (var item in companies)
            {
                Company.Add(new CompanyModel()
                {
                    Id = item.Id, Name = item.Name, Number = item.Number
                });
            }

            var locations = LocationBll.GetAllList(x => x.IsActive == true);

            foreach (var item in locations)
            {
                Location.Add(new LocationModel()
                {
                    Id = item.Id, Name = item.Name
                });
            }
        }
Example #26
0
 public ActionResult Index()
 {
     ViewData["smallImg"]   = AdvertisementBll.GetAllTypeAdvert("2", 9);
     ViewData["advert"]     = AdvertisementBll.GetAllTypeAdvert("3", 2);
     ViewBag.IndexBigImg    = AdvertisementBll.GetAllTypeAdvert("1", 1);
     ViewBag.SiYe           = AdvertisementBll.GetAllTypeAdvert("4", 1);
     ViewData["recGame"]    = HomePageBll.GetAllTypeHomePage("11", 11);
     ViewData["joinCpy"]    = HomePageBll.GetAllTypeHomePage("12", 13);
     ViewData["SlideShow"]  = HomePageBll.GetAllTypeHomePage("7", 10);
     ViewData["TenTopArea"] = HomePageBll.GetAllTypeHomePage("10", 10);
     //网站首页所有新闻类型
     ViewData["allTypeNews"] = NewsBll.GetAllNewsIndex();
     //开测
     ViewData["TestInfo"] = TestBll.TestDataTen();
     //最爽礼包
     ViewData["NewestCoolPackage"] = PackageBll.NewestCoolPackage();
     //最热游戏
     ViewData["NewestHotGame"] = HomePageBll.GetAllTypeHomePage("13", 5);
     // 最强福利
     ViewBag.NewsetGameDemo = GameDemoBll.GetNewestGameDemo();
     //直播热点
     ViewData["DirectHot"]      = HomePageBll.GetAllTypeHomePage("5", 1);
     ViewData["threeDirectHot"] = NewsBll.AccondingTypeGetNews("5");
     //手游
     ViewData["MobileGame"]      = HomePageBll.GetAllTypeHomePage("6", 1);
     ViewData["threeMobileGame"] = NewsBll.AccondingTypeGetNews("6");
     //最赞攻略结合游戏库拿游戏的logo图
     ViewData["MostGreatRaiders"] = UserRaidersBll.GetMostGreatRaiders(10);
     //福利美图
     ViewData["NewestIndexRecGirls"] = BeautifulGirlsBll.NewestIndexRecGirls();
     //热游排行
     ViewBag.InLikeNumHotGame = GameBll.InLikeNumHotGame();
     //开服
     ViewBag.sevenData = OpenServiceBll.WillSevenDayService();
     //资讯排行
     ViewBag.LikeNumNews = NewsBll.InLikeNumNews();
     ViewBag.RecCpy      = CompanyBll.RecCompany();
     return(View());
 }
Example #27
0
        public ActionResult Clear_CpyState(string ids)
        {
            if (string.IsNullOrEmpty(ids))
            {
                return(Content("empty"));
            }
            string[]   allIds = ids.Split(',');
            List <int> idList = new List <int>();

            foreach (var item in allIds)
            {
                idList.Add(int.Parse(item));
            }
            if (CompanyBll.ClearSetState(idList) > 0)
            {
                return(Content("ok"));
            }
            else
            {
                return(Content("no"));
            }
        }
Example #28
0
 public ActionResult SignIn()
 {
     try
     {
         Company cpy = new Company()
         {
             UName       = Request["uname"],
             Email       = Request["email"],
             Pwd         = Request["pass"],
             SystemName  = Request["systemname"],
             WebSite     = Request["website"],
             CompanyName = Request["companyname"],
             Phone       = Request["phone"],
             Address     = Request["address"],
             Contacts    = Request["contacts"],
             Office      = Request["office"],
             Moblie      = Request["mobile"],
             Sex         = int.Parse(Request["sex"]),
             QQ          = Request["qq"],
             Head        = "3.jpg",
             // Logo="ssdss",
             State = 0,
             // CopanyMsg="sddsdsdsdsds",
             Rec_Forum_Index      = "0",
             Rec_Index_Time       = DateTime.Now,
             Rec_Index            = "0",
             Rec_Forum_Index_Time = DateTime.Now,
             DelFlag = 0,
             InTime  = DateTime.Now
         };
         cpy = CompanyBll.Add(cpy);
         return(Content("ok"));
     }
     catch (DbEntityValidationException dbex)
     {
         throw new Exception("注册出错了!!" + dbex.Message);
     }
 }
Example #29
0
        public ActionResult Rec_CpyChangeState(int id, string recParam)
        {
            //id: strId, recParam: "rec"
            Company cpy = new Company()
            {
                Id = id,
            };

            if (recParam == "rec")
            {
                var cpyState = CompanyBll.LoadEntities(u => u.Id == id).FirstOrDefault();
                //当前状态等于0的改变为1
                if (cpyState.Rec_Index == "0")
                {
                    cpyState.Rec_Index      = "1";
                    cpyState.Rec_Index_Time = DateTime.Now;
                    if (CompanyBll.Update(cpyState))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
                else
                {
                    cpyState.Rec_Index      = "0";
                    cpyState.Rec_Index_Time = DateTime.Now;
                    if (CompanyBll.Update(cpyState))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
            }
            else if (recParam == "recForum")
            {
                var cpyState = CompanyBll.LoadEntities(u => u.Id == id).FirstOrDefault();
                //当前状态等于0的改变为1
                if (cpyState.Rec_Forum_Index == "0")
                {
                    cpyState.Rec_Forum_Index      = "1";
                    cpyState.Rec_Forum_Index_Time = DateTime.Now;
                    if (CompanyBll.Update(cpyState))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
                else
                {
                    cpyState.Rec_Forum_Index      = "0";
                    cpyState.Rec_Forum_Index_Time = DateTime.Now;
                    if (CompanyBll.Update(cpyState))
                    {
                        return(Content("ok"));
                    }
                    else
                    {
                        return(Content("fail"));
                    }
                }
            }
            return(Content("no"));
        }
Example #30
0
        public ActionResult GetAllCompanyInfos()
        {
            int pageSize  = Request["rows"] == null ? 20 : int.Parse(Request["rows"]);
            int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int total     = 0;
            var cpy       = CompanyBll.LoadEntities(C => C.DelFlag == null || C.DelFlag == 0).Select(c => new { c.Id, c.UName, c.DelFlag, c.SystemName, c.Email, c.CompanyName, c.Phone, c.InTime, c.State, c.Rec_Index, c.Rec_Index_Time, c.Rec_Forum_Index, c.Rec_Forum_Index_Time });
            var cpygame   = CompanyGameBll.LoadEntities(c => c.Id > 0);
            var rech      = RechargeBll.LoadEntities(r => r.Id > 0);
            var query     = from c in cpy
                            let Games                         = (from g in cpygame where c.Id == g.CompanyId select g).Count()               //id对应的游戏总个数
                                                    let Total = (from r in rech where c.Id == r.CompanyId select(int?) r.Num - r.Used).Sum() //剩下的开服条数

                                                                select new
            {
                c.Id,
                c.UName,
                c.DelFlag,
                c.SystemName,
                c.Email,
                c.CompanyName,
                c.Phone,
                c.InTime,
                c.State,
                Games = Games,
                Total = Total ?? 0,
                c.Rec_Index,
                c.Rec_Index_Time,
                c.Rec_Forum_Index,
                c.Rec_Forum_Index_Time,
                //  g.CompanyId,
            };
            string uName       = Request["uName"];
            string systemName  = Request["systemName"];
            string companyName = Request["companyName"];
            string rec         = Request["rec"];
            string rec_index   = Request["rec_index"];

            if (!string.IsNullOrEmpty(uName))
            {
                query = query.Where(q => q.UName.Contains(uName));
            }
            if (!string.IsNullOrEmpty(systemName))
            {
                query = query.Where(q => q.SystemName.Contains(systemName));
            }
            if (!string.IsNullOrEmpty(companyName))
            {
                query = query.Where(q => q.CompanyName.Contains(companyName));
            }
            if (!string.IsNullOrEmpty(rec))//频道
            {
                query = query.Where(q => q.Rec_Forum_Index.Contains(rec));
            }
            if (!string.IsNullOrEmpty(rec_index))//shouye
            {
                query = query.Where(q => q.Rec_Index.Contains(rec_index));
            }
            total = query.Count();
            var allData = query.OrderByDescending(d => d.Id)
                          .Skip(pageSize * (pageIndex - 1))
                          .Take(pageSize).ToList();
            var result = new { total = total, rows = allData };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }