protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsOrder", PowerCheckType.Single); OrderSearchInfo orderSearch = new OrderSearchInfo(); orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); orderSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); this.EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); DataTable table = OrderBLL.StatisticsOrderArea(orderSearch); string[] strArray = new string[] { "33FF66", "FF6600", "FFCC33", "CC3399", "CC7036", "349802", "066C93" }; int index = 0; foreach (DataRow row in table.Rows) { object result = this.result; this.result = string.Concat(new object[] { result, " <set value='", row["Count"], "' name='", this.GetProvinceName(row["RegionID"].ToString()), "' color='", strArray[index], "' />" }); index++; if (index == 6) { index = 0; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadAdminLog", PowerCheckType.Single); int count = 0; var adminList = AdminBLL.ReadList(1, 1000, ref count); AdminId.DataSource = adminList; AdminId.DataTextField = "Name"; AdminId.DataValueField = "ID"; AdminId.DataBind(); AdminId.Items.Insert(0, new ListItem("所有管理员", string.Empty)); int adminId = RequestHelper.GetQueryString <int>("AdminId"); string logType = RequestHelper.GetQueryString <string>("LogType"); DateTime startAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); DateTime endAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); AdminId.Text = adminId.ToString(); LogType.Text = logType; StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); var data = AdminLogBLL.ReadList(CurrentPage, PageSize, ref Count, logType, startAddDate, endAddDate, adminId); BindControl(data, RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsUser", PowerCheckType.Single); Sex.DataSource = EnumHelper.ReadEnumList <SexType>(); Sex.DataValueField = "Value"; Sex.DataTextField = "ChineseName"; Sex.DataBind(); Sex.Items.Insert(0, new ListItem("所有", string.Empty)); UserSearchInfo userSearch = new UserSearchInfo(); userSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); userSearch.Sex = RequestHelper.GetQueryString <int>("Sex"); DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate"); DateTime endDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate")); UserName.Text = userSearch.UserName; StartDate.Text = RequestHelper.GetQueryString <string>("StartDate"); EndDate.Text = RequestHelper.GetQueryString <string>("EndDate"); Sex.Text = RequestHelper.GetQueryString <int>("Sex").ToString(); string userConsumeType = RequestHelper.GetQueryString <string>("UserConsumeType"); userConsumeType = (userConsumeType == string.Empty) ? "OrderCount" : userConsumeType; UserConsumeType.Text = userConsumeType; BindControl(UserBLL.StatisticsUserConsume(CurrentPage, PageSize, userSearch, ref Count, userConsumeType, startDate, endDate), RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsOrder", PowerCheckType.Single); OrderSearchInfo orderSearch = new OrderSearchInfo(); orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); orderSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); DataTable dt = OrderBLL.StatisticsOrderArea(orderSearch); result += "["; if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { string cityName = GetProvinceName(dr["RegionID"].ToString()); if (cityName == "") { cityName = "其他"; } statusArr = statusArr + "'" + cityName + "',"; result += " {value:" + dr["Count"] + ", name:'" + cityName + "'},"; } statusArr = statusArr.Substring(0, statusArr.Length - 1); result = result.Substring(0, result.Length - 1); } result += "]"; } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsUser", PowerCheckType.Single); this.Sex.DataSource = EnumHelper.ReadEnumList <SexType>(); this.Sex.DataValueField = "Value"; this.Sex.DataTextField = "ChineseName"; this.Sex.DataBind(); this.Sex.Items.Insert(0, new ListItem("Ыљга", string.Empty)); UserSearchInfo userSearch = new UserSearchInfo(); userSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); userSearch.Sex = RequestHelper.GetQueryString <int>("Sex"); userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate"); userSearch.EndRegisterDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate")); this.UserName.Text = userSearch.UserName; this.StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate"); this.EndRegisterDate.Text = RequestHelper.GetQueryString <string>("EndRegisterDate"); this.Sex.Text = RequestHelper.GetQueryString <int>("Sex").ToString(); string queryString = RequestHelper.GetQueryString <string>("UserOrderType"); queryString = (queryString == string.Empty) ? "LoginTimes" : queryString; this.UserOrderType.Text = queryString; base.BindControl(UserBLL.StatisticsUserActive(base.CurrentPage, base.PageSize, userSearch, ref this.Count, queryString), this.RecordList, this.MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadRebate", PowerCheckType.Single); int distributorId = RequestHelper.GetQueryString <int>("distributorId"); UserInfo distributor = UserBLL.Read(distributorId); StartTime.Text = RequestHelper.GetQueryString <string>("StartTime"); EndTime.Text = RequestHelper.GetQueryString <string>("EndTime"); UserName.Text = HttpUtility.UrlDecode((distributor.Id > 0?distributor.UserName: RequestHelper.GetQueryString <string>("UserName")), System.Text.Encoding.UTF8); Mobile.Text = RequestHelper.GetQueryString <string>("Mobile"); var dataList = RebateBLL.SearchList( CurrentPage, PageSize, new RebateSearchInfo { Distributor_Id = distributorId, StartTime = RequestHelper.GetQueryString <DateTime>("StartTime"), EndTtime = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndTime")), UserName = HttpUtility.UrlEncode(RequestHelper.GetQueryString <string>("UserName"), System.Text.Encoding.UTF8), Mobile = RequestHelper.GetQueryString <string>("Mobile") }, ref Count); //Task.Run(()=> { //var userList = UserBLL.SearchList(new UserSearchInfo { }); //dataList.ForEach(k => k.Buyer_UserName = HttpUtility.UrlDecode(((userList.FirstOrDefault(a=>a.Id==k.User_Id)??new UserInfo())).UserName, System.Text.Encoding.UTF8)); //}); dataList.ForEach(k => k.UserName = HttpUtility.UrlDecode(k.UserName, System.Text.Encoding.UTF8)); dataList.ForEach(k => k.Buyer_UserName = HttpUtility.UrlDecode(k.Buyer_UserName, System.Text.Encoding.UTF8)); BindControl(dataList, RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadProduct", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); //this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); //this.BrandID.DataTextField = "Name"; //this.BrandID.DataValueField = "ID"; //this.BrandID.DataBind(); //this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); //this.ClassID.Text = RequestHelper.GetQueryString<string>("ClassID"); //this.BrandID.Text = RequestHelper.GetQueryString<string>("BrandID"); //this.Key.Text = RequestHelper.GetQueryString<string>("Key"); //this.StartAddDate.Text = RequestHelper.GetQueryString<string>("StartAddDate"); //this.EndAddDate.Text = RequestHelper.GetQueryString<string>("EndAddDate"); ProductSearchInfo product = new ProductSearchInfo(); product.Key = RequestHelper.GetQueryString <string>("Key"); product.ClassID = RequestHelper.GetQueryString <string>("ClassID"); product.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); product.IsSale = 0; product.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); product.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); base.PageSize = 10; List <ProductInfo> dataSource = ProductBLL.SearchProductList(base.CurrentPage, base.PageSize, product, ref this.Count); base.BindControl(dataSource, this.RecordList, this.MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsProduct", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsSale = 1; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassID = RequestHelper.GetQueryString <string>("ClassID"); productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); string queryString = RequestHelper.GetQueryString <string>("ProductOrderType"); queryString = (queryString == string.Empty) ? "SellCount" : queryString; productSearch.ProductOrderType = queryString; this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StartDate.Text = RequestHelper.GetQueryString <string>("StartDate"); this.EndDate.Text = RequestHelper.GetQueryString <string>("EndDate"); this.ProductOrderType.Text = queryString; DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate"); DateTime endDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate")); base.BindControl(ProductBLL.StatisticsProductSale(base.CurrentPage, base.PageSize, productSearch, ref this.Count, startDate, endDate), this.RecordList, this.MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ProductBatchEdit", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); string queryString = RequestHelper.GetQueryString <string>("Action"); if (queryString != null) { if (!(queryString == "UnionEdit")) { if (queryString == "search") { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassID = RequestHelper.GetQueryString <string>("ClassID"); productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); this.EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); base.BindControl(ProductBLL.SearchProductList(productSearch), this.RecordList); } } else { this.UnionEdit(); } } this.userGradeList = UserGradeBLL.ReadUserGradeCacheList(); foreach (UserGradeInfo info3 in this.userGradeList) { if (this.userGradeIDList == string.Empty) { this.userGradeIDList = info3.ID.ToString(); this.userGradeNameList = info3.Name; } else { this.userGradeIDList = this.userGradeIDList + "," + info3.ID.ToString(); this.userGradeNameList = this.userGradeNameList + "," + info3.Name; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadUser", PowerCheckType.Single); string action = RequestHelper.GetQueryString <string>("Action"); int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { switch (action) { case "Delete": CheckAdminPower("DeleteUser", PowerCheckType.Single); UserBLL.Delete(id); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("User"), id); break; default: break; } } //会员类型 usertype.DataSource = EnumHelper.ReadEnumList <UserType>(); usertype.DataTextField = "ChineseName"; usertype.DataValueField = "Value"; usertype.DataBind(); ListItem lt = new ListItem("--所有会员--", ""); usertype.Items.Insert(0, lt); UserSearchInfo userSearch = new UserSearchInfo(); userSearch.UserName = HttpUtility.UrlEncode(RequestHelper.GetQueryString <string>("UserName"), System.Text.Encoding.UTF8); userSearch.Mobile = RequestHelper.GetQueryString <string>("Mobile"); userSearch.Status = RequestHelper.GetQueryString <int>("Status"); userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate"); userSearch.EndRegisterDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate")); userSearch.UserType = RequestHelper.GetQueryString <int>("Type"); usertype.SelectedValue = userSearch.UserType.ToString(); UserName.Text = HttpUtility.UrlDecode(userSearch.UserName, System.Text.Encoding.UTF8); Mobile.Text = userSearch.Mobile; StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate"); EndRegisterDate.Text = RequestHelper.GetQueryString <string>("EndRegisterDate"); status = userSearch.Status; PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]); var userList = UserBLL.SearchListAndUserGrade(CurrentPage, PageSize, userSearch, ref Count); //Count = userList.Count; AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString(); userList.ForEach(k => k.UserName = System.Web.HttpUtility.UrlDecode(k.UserName, System.Text.Encoding.UTF8)); //userList = userList.Skip((CurrentPage - 1) * PageSize).Take(PageSize).ToList(); BindControl(userList, RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = RequestHelper.GetQueryString <int>("ID"); string Action = RequestHelper.GetQueryString <string>("Action"); if (Action == "Search") { string searchName = RequestHelper.GetQueryString <string>("username"); string searchCompanyName = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("companyname").Trim()); string searchPostName = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("postname").Trim()); DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate"); DateTime endDate = RequestHelper.GetQueryString <DateTime>("EndDate"); int pageCount = RequestHelper.GetQueryString <int>("PageCount"); if (pageCount > 0) { base.PageSize = pageCount; this.PageCount.Text = pageCount.ToString(); } CompanyName.Text = searchCompanyName; SearchName.Text = searchName; PostName.Text = searchPostName; if (startDate != DateTime.MinValue) { SearchStartDate.Text = startDate.ToString("d"); } if (endDate != DateTime.MinValue) { SearchEndDate.Text = endDate.ToString("d"); } base.CheckAdminPower("ReadTestPaper", PowerCheckType.Single); PostPassInfo postpassSearch = new PostPassInfo(); postpassSearch.SearchStartDate = startDate; postpassSearch.CreateDate = ShopCommon.SearchEndDate(endDate); postpassSearch.PostName = searchPostName; if (!string.IsNullOrEmpty(searchCompanyName)) { postpassSearch.InCompanyID = CompanyBLL.ReadCompanyIdStr(searchCompanyName, 1); } if (!string.IsNullOrEmpty(searchName)) { UserSearchInfo user = new UserSearchInfo(); user.RealName = searchName; postpassSearch.InUserID = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(user)); if (string.IsNullOrEmpty(postpassSearch.InUserID)) { postpassSearch.InUserID = "0"; } } base.BindControl(PostPassBLL.ReadPostPassList(postpassSearch, base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager); } } }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProduct", PowerCheckType.Single); RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass(); RegionID.ClassID = "|1|27|607|"; foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Key.Text = RequestHelper.GetQueryString <string>("Key"); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); IsSpecial.Text = RequestHelper.GetQueryString <string>("IsSpecial"); IsNew.Text = RequestHelper.GetQueryString <string>("IsNew"); IsHot.Text = RequestHelper.GetQueryString <string>("IsHot"); IsTop.Text = RequestHelper.GetQueryString <string>("IsTop"); List <ProductInfo> productList = new List <ProductInfo>(); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.IsSpecial = RequestHelper.GetQueryString <int>("IsSpecial"); productSearch.IsNew = RequestHelper.GetQueryString <int>("IsNew"); productSearch.IsHot = RequestHelper.GetQueryString <int>("IsHot"); productSearch.IsSale = (int)BoolType.True; productSearch.IsTop = RequestHelper.GetQueryString <int>("IsTop"); productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); productSearch.IsDelete = 0;//没有逻辑删除的商品 PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]); AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString(); productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count); BindControl(productList, RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadProduct", PowerCheckType.Single); if (isSale < 0) { isSale = 1; //默认为上架课程 } foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); //this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); //this.BrandID.DataTextField = "Name"; //this.BrandID.DataValueField = "ID"; //this.BrandID.DataBind(); //this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); //this.BrandID.Text = RequestHelper.GetQueryString<string>("BrandID"); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.Key.Text = RequestHelper.GetQueryString <string>("Key"); this.IsSpecial.Text = RequestHelper.GetQueryString <string>("IsSpecial"); this.IsNew.Text = RequestHelper.GetQueryString <string>("IsNew"); this.IsHot.Text = RequestHelper.GetQueryString <string>("IsHot"); this.IsTop.Text = RequestHelper.GetQueryString <string>("IsTop"); ProductSearchInfo product = new ProductSearchInfo(); product.Key = RequestHelper.GetQueryString <string>("Key"); product.ClassID = RequestHelper.GetQueryString <string>("ClassID"); product.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); product.IsSpecial = RequestHelper.GetQueryString <int>("IsSpecial"); product.IsNew = RequestHelper.GetQueryString <int>("IsNew"); product.IsHot = RequestHelper.GetQueryString <int>("IsHot"); product.IsSale = isSale; product.IsTop = RequestHelper.GetQueryString <int>("IsTop"); product.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); product.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); product.IsSpecialTestSetting = RequestHelper.GetQueryString <int>("IsSpecialTestSetting"); //product.IsComplete = RequestHelper.GetQueryString<int>("IsComplete"); List <ProductInfo> dataSource = ProductBLL.SearchProductList(base.CurrentPage, base.PageSize, product, ref this.Count); //把列表中的产品的更新时间属性都读取出来 attributeRecordList = AttributeRecordBLL.ReadList("3", ProductBLL.ReadProductIdStr(dataSource)); base.BindControl(dataSource, this.RecordList, this.MyPager); } }
private UserSearchInfo SearchCondition() { UserSearchInfo userSearch = new UserSearchInfo(); if (companyID >= 0) { userSearch.InCompanyID = companyID.ToString(); } userSearch.RealName = RequestHelper.GetQueryString <string>("RealName"); userSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); userSearch.Email = RequestHelper.GetQueryString <string>("Email"); userSearch.Mobile = RequestHelper.GetQueryString <string>("Mobile"); userSearch.Sex = RequestHelper.GetQueryString <int>("Sex"); userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate"); userSearch.EndRegisterDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate")); userSearch.Status = RequestHelper.GetQueryString <int>("Status"); return(userSearch); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadUserApply", PowerCheckType.Single); UserApplySearchInfo userApply = new UserApplySearchInfo(); userApply.Status = RequestHelper.GetQueryString <int>("Status"); userApply.Number = RequestHelper.GetQueryString <string>("Number"); userApply.StartApplyDate = RequestHelper.GetQueryString <DateTime>("StartApplyDate"); userApply.EndApplyDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndApplyDate")); userApply.UserName = RequestHelper.GetQueryString <string>("UserName"); this.Status.Text = userApply.Status.ToString(); this.Number.Text = userApply.Number; this.StartApplyDate.Text = RequestHelper.GetQueryString <string>("StartApplyDate"); this.EndApplyDate.Text = RequestHelper.GetQueryString <string>("EndApplyDate"); this.UserName.Text = RequestHelper.GetQueryString <string>("UserName"); base.BindControl(UserApplyBLL.SearchUserApplyList(base.CurrentPage, base.PageSize, userApply, ref this.Count), this.RecordList, this.MyPager); } }
protected override void PageLoad() { base.PageLoad(); base.Title = "最小学习量达成分析表"; base.CheckUserPower("ReadEMSReport", PowerCheckType.Single); TestPaperInfo testPaperSearch = new TestPaperInfo(); testPaperSearch.TestMinDate = startDate; testPaperSearch.TestMaxDate = ShopCommon.SearchEndDate(endDate); testPaperSearch.Scorse = score; testPaperSearch.IsPass = isPass; testPaperSearch.PaperName = courseName; if (companyID < 0) { testPaperSearch.CompanyIdCondition = base.ExistsSonCompany ? base.SonCompanyID : base.UserCompanyID.ToString(); } else { testPaperSearch.CompanyIdCondition = companyID.ToString(); } if (!string.IsNullOrEmpty(realName) || !string.IsNullOrEmpty(userName)) { UserSearchInfo user = new UserSearchInfo(); user.RealName = realName; user.UserName = userName; user.InCompanyID = testPaperSearch.CompanyIdCondition; testPaperSearch.UserIdCondition = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(user)); if (string.IsNullOrEmpty(testPaperSearch.UserIdCondition)) { testPaperSearch.UserIdCondition = "0"; } } //if (!string.IsNullOrEmpty(courseName)) //{ // testPaperSearch.Condition = "[CateID] in (select ID from [_Product] where [Name] like '%" + courseName + "%')"; //} testPaperList = TestPaperBLL.ReadList(testPaperSearch, base.CurrentPage, base.PageSize, ref this.Count); base.BindPageControl(ref base.CommonPager); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsUser", PowerCheckType.Single); UserSearchInfo userSearch = new UserSearchInfo(); userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate"); userSearch.EndRegisterDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate")); StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate"); EndRegisterDate.Text = RequestHelper.GetQueryString <string>("EndRegisterDate"); DataTable dt = UserBLL.StatisticsUserStatus(userSearch); string[] color = { "33FF66", "FF6600", "FFCC33", "CC3399" }; int i = 0; bool find = false; result += "["; foreach (EnumInfo temp in EnumHelper.ReadEnumList <JWShop.Entity.UserStatus>()) { statusArr = statusArr + "'" + temp.ChineseName + "',"; find = false; foreach (DataRow dr in dt.Rows) { if (Convert.ToInt16(dr["Status"]) == temp.Value) { result += " {value:" + dr["Count"] + ", name:'" + temp.ChineseName + "'},"; find = true; break; } } if (!find) { result += " {value:0, name:'" + temp.ChineseName + "'},"; } i++; } statusArr = statusArr.Substring(0, statusArr.Length - 1); result = result.Substring(0, result.Length - 1); result += "]"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsSale", PowerCheckType.Single); foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "Id"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Name.Text = RequestHelper.GetQueryString <string>("Name"); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); UserName.Text = RequestHelper.GetQueryString <string>("UserName"); OrderNumber.Text = RequestHelper.GetQueryString <string>("OrderNumber"); ProductSearchInfo productSearch = new ProductSearchInfo(); OrderSearchInfo orderSearch = new OrderSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.InProductId = RequestHelper.GetQueryString <string>("ProductID"); orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); orderSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); orderSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); orderSearch.OrderNumber = RequestHelper.GetQueryString <string>("OrderNumber"); BindControl(OrderDetailBLL.StatisticsSaleDetail(CurrentPage, PageSize, orderSearch, productSearch, ref Count), RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadUserMessage", PowerCheckType.Single); this.classID = RequestHelper.GetQueryString <int>("MessageClass"); UserMessageSeachInfo userMessage = new UserMessageSeachInfo(); userMessage.MessageClass = RequestHelper.GetQueryString <int>("MessageClass"); userMessage.Title = RequestHelper.GetQueryString <string>("Title"); userMessage.StartPostDate = RequestHelper.GetQueryString <DateTime>("StartPostDate"); userMessage.EndPostDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndPostDate")); userMessage.UserName = RequestHelper.GetQueryString <string>("UserName"); userMessage.IsHandler = RequestHelper.GetQueryString <int>("IsHandler"); this.MessageClass.Text = RequestHelper.GetQueryString <string>("MessageClass"); this.Title.Text = RequestHelper.GetQueryString <string>("Title"); this.StartPostDate.Text = RequestHelper.GetQueryString <string>("StartPostDate"); this.EndPostDate.Text = RequestHelper.GetQueryString <string>("EndPostDate"); this.UserName.Text = RequestHelper.GetQueryString <string>("UserName"); this.IsHandler.Text = RequestHelper.GetQueryString <string>("IsHandler"); base.BindControl(UserMessageBLL.SearchUserMessageList(base.CurrentPage, base.PageSize, userMessage, ref this.Count), this.RecordList, this.MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadUserMessage", PowerCheckType.Single); classID = RequestHelper.GetQueryString <int>("MessageClass"); UserMessageSeachInfo userMessageSearch = new UserMessageSeachInfo(); userMessageSearch.MessageClass = RequestHelper.GetQueryString <int>("MessageClass"); userMessageSearch.Title = RequestHelper.GetQueryString <string>("Title"); userMessageSearch.StartPostDate = RequestHelper.GetQueryString <DateTime>("StartPostDate"); userMessageSearch.EndPostDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndPostDate")); userMessageSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); userMessageSearch.IsHandler = RequestHelper.GetQueryString <int>("IsHandler"); MessageClass.Text = RequestHelper.GetQueryString <string>("MessageClass"); Title.Text = RequestHelper.GetQueryString <string>("Title"); StartPostDate.Text = RequestHelper.GetQueryString <string>("StartPostDate"); EndPostDate.Text = RequestHelper.GetQueryString <string>("EndPostDate"); UserName.Text = RequestHelper.GetQueryString <string>("UserName"); IsHandler.Text = RequestHelper.GetQueryString <string>("IsHandler"); BindControl(UserMessageBLL.SearchList(CurrentPage, PageSize, userMessageSearch, ref Count), RecordList, MyPager); } }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProduct", PowerCheckType.Single); foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Key.Text = RequestHelper.GetQueryString <string>("Key"); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.IsSale = 2;//草稿 productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); productSearch.IsDelete = 0;//没有逻辑删除的商品 PageSize = 10; List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count); BindControl(productList, RecordList, MyPager); } }
/// <summary> /// 导出按钮点击方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ExportButton_Click(object sender, EventArgs e) { _url = "http://" + HttpContext.Current.Request.Url.Host + ((HttpContext.Current.Request.Url.Port == 80) ? "" : (":" + HttpContext.Current.Request.Url.Port)) + this.ApplicationPath; //获取省市 string[] strRegions = RegionID.ClassID.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); if (strRegions.Length >= 2) { _province = RegionBLL.ReadRegionCache(Convert.ToInt32(strRegions[1])).RegionName.Replace("省", ""); } if (strRegions.Length >= 3) { _city = RegionBLL.ReadRegionCache(Convert.ToInt32(strRegions[2])).RegionName.Replace("市", ""); } ; ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.IsSpecial = RequestHelper.GetQueryString <int>("IsSpecial"); productSearch.IsNew = RequestHelper.GetQueryString <int>("IsNew"); productSearch.IsHot = RequestHelper.GetQueryString <int>("IsHot"); productSearch.IsSale = (int)BoolType.True; productSearch.IsTop = RequestHelper.GetQueryString <int>("IsTop"); productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); //待导出商品列表 ExportList = ProductBLL.SearchList(productSearch); if (ExportList.Count <= 0) { ScriptHelper.Alert("请至少选择一个商品"); } else { DoExport(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadWithdraw", PowerCheckType.Single); //状态 var list = EnumHelper.ReadEnumList <Withdraw_Status>(); foreach (EnumInfo item in list) { Status.Items.Add(new ListItem(item.ChineseName, item.Value.ToString())); } Status.Items.Insert(0, new ListItem("请选择", string.Empty)); int distributorId = RequestHelper.GetQueryString <int>("distributorId"); UserInfo distributor = UserBLL.Read(distributorId); StartTime.Text = RequestHelper.GetQueryString <string>("StartTime"); EndTime.Text = RequestHelper.GetQueryString <string>("EndTime"); UserName.Text = HttpUtility.UrlDecode((distributor.Id > 0 ? distributor.UserName : RequestHelper.GetQueryString <string>("UserName")), System.Text.Encoding.UTF8); Mobile.Text = RequestHelper.GetQueryString <string>("Mobile"); Status.Text = RequestHelper.GetQueryString <string>("Status"); var dataList = WithdrawBLL.SearchList( CurrentPage, PageSize, new WithdrawSearchInfo { Distributor_Id = distributorId, StartTime = RequestHelper.GetQueryString <DateTime>("StartTime"), EndTtime = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndTime")), UserName = HttpUtility.UrlEncode(RequestHelper.GetQueryString <string>("UserName"), System.Text.Encoding.UTF8), Mobile = RequestHelper.GetQueryString <string>("Mobile"), Status = RequestHelper.GetQueryString <int>("Status") }, ref Count); dataList.ForEach(k => k.UserName = HttpUtility.UrlDecode(k.UserName, System.Text.Encoding.UTF8)); BindControl(dataList, RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsProduct", PowerCheckType.Single); foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); string productOrderType = RequestHelper.GetQueryString <string>("ProductOrderType"); productOrderType = (productOrderType == string.Empty) ? "SellCount" : productOrderType; productSearch.ProductOrderType = productOrderType; ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Name.Text = RequestHelper.GetQueryString <string>("Name"); StartDate.Text = RequestHelper.GetQueryString <string>("StartDate"); EndDate.Text = RequestHelper.GetQueryString <string>("EndDate"); ProductOrderType.Text = productOrderType; DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate"); DateTime endDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate")); BindControl(ProductBLL.StatisticsProductSale(CurrentPage, PageSize, productSearch, ref Count, startDate, endDate), RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsUser", PowerCheckType.Single); UserSearchInfo userSearch = new UserSearchInfo(); userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate"); userSearch.EndRegisterDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate")); this.StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate"); this.EndRegisterDate.Text = RequestHelper.GetQueryString <string>("EndRegisterDate"); DataTable table = UserBLL.StatisticsUserStatus(userSearch); string[] strArray = new string[] { "33FF66", "FF6600", "FFCC33", "CC3399" }; int index = 0; bool flag = false; foreach (EnumInfo info2 in EnumHelper.ReadEnumList <UserStatus>()) { flag = false; foreach (DataRow row in table.Rows) { if (Convert.ToInt16(row["Status"]) == info2.Value) { object result = this.result; this.result = string.Concat(new object[] { result, " <set value='", row["Count"], "' name='", info2.ChineseName, "' color='", strArray[index], "' />" }); flag = true; break; } } if (!flag) { string str = this.result; this.result = str + " <set value='0' name='" + info2.ChineseName + "' color='" + strArray[index] + "' />"; } index++; } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsSale", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); this.EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); this.UserName.Text = RequestHelper.GetQueryString <string>("UserName"); this.OrderNumber.Text = RequestHelper.GetQueryString <string>("OrderNumber"); ProductSearchInfo productSearch = new ProductSearchInfo(); OrderSearchInfo orderSearch = new OrderSearchInfo(); productSearch.IsSale = 1; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassID = RequestHelper.GetQueryString <string>("ClassID"); productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); productSearch.InProductID = RequestHelper.GetQueryString <string>("ProductID"); orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); orderSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); orderSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); orderSearch.OrderNumber = RequestHelper.GetQueryString <string>("OrderNumber"); base.BindControl(OrderDetailBLL.StatisticsSaleDetail(base.CurrentPage, base.PageSize, orderSearch, productSearch, ref this.Count), this.RecordList, this.MyPager); } }
//public Distributor() //{ // if (all_users == null) // { // all_users = UserBLL.ReadList(); // } //} protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadDistributor", PowerCheckType.Single); TaskFactory tFactory = Task.Factory; List <Task> taskList = new List <Task>(); taskList.Add(tFactory.StartNew(() => { if (all_users == null) { all_users = UserBLL.ReadList(); } })); //Task t1 =new Task(()=> { // if (all_users == null) // { // all_users = UserBLL.ReadList(); // } //}) ; //t1.Start(); string action = RequestHelper.GetQueryString <string>("Action"); int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { switch (action) { default: break; } } UserSearchInfo userSearch = new UserSearchInfo(); userSearch.UserName = HttpUtility.UrlEncode(RequestHelper.GetQueryString <string>("UserName"), System.Text.Encoding.UTF8); userSearch.Mobile = RequestHelper.GetQueryString <string>("Mobile"); userSearch.UserType = RequestHelper.GetQueryString <int>("usertype") == int.MinValue ? 3 : RequestHelper.GetQueryString <int>("usertype"); //分销商状态,默认1--正常 userSearch.Distributor_Status = RequestHelper.GetQueryString <int>("distributor_Status") == int.MinValue?1: RequestHelper.GetQueryString <int>("distributor_Status"); userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate"); userSearch.EndRegisterDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate")); UserName.Text = HttpUtility.UrlDecode(userSearch.UserName, System.Text.Encoding.UTF8); Mobile.Text = userSearch.Mobile; StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate"); EndRegisterDate.Text = RequestHelper.GetQueryString <string>("EndRegisterDate"); usertype = userSearch.UserType; distributor_Status = userSearch.Distributor_Status; PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]); userList = UserBLL.SearchList(CurrentPage, PageSize, userSearch, ref Count); //while (all_users == null) //{ // Thread.Sleep(100); // continue; //} //等待任务完成 Task.WaitAll(taskList.ToArray()); //推荐人用户名 userList.ForEach(k => k.Recommend_UserName = (all_users.FirstOrDefault(a => a.Id == k.Recommend_UserId) ?? new UserInfo()).UserName); userList.ForEach(k => k.Recommend_UserName = HttpUtility.UrlDecode(k.Recommend_UserName, System.Text.Encoding.UTF8)); userList.ForEach(k => k.Recommend_UserName = !string.IsNullOrWhiteSpace(k.Recommend_UserName) ? k.Recommend_UserName : "******"); AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString(); userList.ForEach(k => k.UserName = HttpUtility.UrlDecode(k.UserName, System.Text.Encoding.UTF8)); var distributorGradeList = DistributorGradeBLL.ReadList(); userList.ForEach(k => k.Distributor_Grade_Title = (distributorGradeList.Where(d => k.Total_Commission >= d.Min_Amount && k.Total_Commission < d.Max_Amount).FirstOrDefault() ?? new DistributorGradeInfo()).Title); BindControl(userList, RecordList, MyPager); } }
protected void ExportButton_Click(object sender, EventArgs e) { ProductSearchInfo productSearch = new ProductSearchInfo(); OrderSearchInfo orderSearch = new OrderSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.Name = ShopCommon.ConvertToT <string>(Name.Text); productSearch.ClassId = ShopCommon.ConvertToT <string>(ClassID.Text); productSearch.BrandId = ShopCommon.ConvertToT <int>(BrandID.Text); orderSearch.StartAddDate = ShopCommon.ConvertToT <DateTime>(StartAddDate.Text); orderSearch.EndAddDate = ShopCommon.SearchEndDate(ShopCommon.ConvertToT <DateTime>(EndAddDate.Text)); orderSearch.UserName = ShopCommon.ConvertToT <string>(UserName.Text); orderSearch.OrderNumber = ShopCommon.ConvertToT <string>(OrderNumber.Text); var data = OrderDetailBLL.StatisticsSaleDetail(1, 1000, orderSearch, productSearch, ref Count); NPOI.HSSF.UserModel.HSSFWorkbook book = new NPOI.HSSF.UserModel.HSSFWorkbook(); NPOI.SS.UserModel.ISheet sheet = book.CreateSheet("Sheet1"); sheet.DefaultColumnWidth = 18; sheet.CreateFreezePane(0, 1, 0, 1); NPOI.SS.UserModel.IRow row = sheet.CreateRow(0); row.Height = 20 * 20; row.CreateCell(0).SetCellValue("时间"); row.CreateCell(1).SetCellValue("单号"); row.CreateCell(2).SetCellValue("商品名称"); row.CreateCell(3).SetCellValue("数量"); row.CreateCell(4).SetCellValue("金额"); row.CreateCell(5).SetCellValue("用户名"); //设置表头格式 var headFont = book.CreateFont(); headFont.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold; headFont.FontHeightInPoints = 10; var headStyle = book.CreateCellStyle(); headStyle.SetFont(headFont); headStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; headStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; headStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; headStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; headStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; foreach (var cell in row.Cells) { cell.CellStyle = headStyle; } foreach (DataRow dr in data.Rows) { NPOI.SS.UserModel.IRow dataRow = sheet.CreateRow(data.Rows.IndexOf(dr) + 1); dataRow.CreateCell(0).SetCellValue(Convert.ToString(dr["AddDate"])); dataRow.CreateCell(1).SetCellValue(Convert.ToString(dr["OrderNumber"])); dataRow.CreateCell(2).SetCellValue(Convert.ToString(dr["Name"])); dataRow.CreateCell(3).SetCellValue(Convert.ToString(dr["BuyCount"])); dataRow.CreateCell(4).SetCellValue(Convert.ToString(dr["Money"])); dataRow.CreateCell(5).SetCellValue(Convert.ToString(dr["UserName"])); var style = book.CreateCellStyle(); style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left; foreach (var cell in dataRow.Cells) { cell.CellStyle = style; } } System.IO.MemoryStream ms = new System.IO.MemoryStream(); book.Write(ms); Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}.xls", DateTime.Now.ToString("yyyyMMddHHmmssfff"))); Response.BinaryWrite(ms.ToArray()); book = null; ms.Close(); ms.Dispose(); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //设置默认值 if (string.IsNullOrEmpty(action)) { groupID = "36"; state = ((int)UserState.Normal).ToString(); } if (!string.IsNullOrEmpty(action) && companyID > 0) { ShowArea.Style.Add("display", ""); company = CompanyBLL.ReadCompany(companyID); companyName = company.CompanyName; startDate = Convert.ToDateTime(RequestHelper.GetQueryString <string>("SearchStartDate")); endDate = Convert.ToDateTime(RequestHelper.GetQueryString <string>("SearchEndDate")); SearchStartDate.Text = startDate.ToString("d"); SearchEndDate.Text = endDate.ToString("d"); endDate = ShopCommon.SearchEndDate(endDate); //计算周数 WeekNum = (endDate - startDate).Days / 7; if ((endDate - startDate).Days % 7 > 0) { WeekNum = WeekNum + 1; } if (base.IsGroupCompany(company.GroupId)) { StringBuilder TotalTable = new StringBuilder(); //调取所有用户列表 UserSearchInfo userSearch = new UserSearchInfo(); userSearch.InCompanyID = CompanyBLL.ReadCompanyIdList(companyID.ToString()); userSearch.Condition = "Order by [CompanyID] Desc"; List <UserInfo> userAllList = UserBLL.SearchUserList(userSearch); //调取所有考试记录 TestPaperInfo testPaperSearch = new TestPaperInfo(); testPaperSearch.CompanyIdCondition = userSearch.InCompanyID; testPaperSearch.Condition = "[UserID] in (select [ID] from [_User] where [CompanyID] in (" + userSearch.InCompanyID + "))"; List <TestPaperInfo> TestPaperAllList = TestPaperBLL.NewReadList(testPaperSearch); PostPassInfo postPassSearch = new PostPassInfo(); postPassSearch.CreateDate = endDate; postPassSearch.InCompanyID = userSearch.InCompanyID; List <PostPassInfo> postPassList = PostPassBLL.ReadPostPassList(postPassSearch); TotalTable.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); TotalTable.Append("<thead>"); TotalTable.Append("<tr class=\"listTableHead\">"); TotalTable.Append("<th>单店</th>"); TotalTable.Append("<th>总人数</th>"); TotalTable.Append("<th>应学习人数</th>"); TotalTable.Append("<th>学习总人数</th>"); TotalTable.Append("<th>通过本岗位总人数</th>"); TotalTable.Append("<th>通过本岗位在职人数</th>"); TotalTable.Append("<th>正在学习他岗位人数</th>"); TotalTable.Append("<th>已通过认证人数</th>"); TotalTable.Append("<th>完成多岗位认证的人数</th>"); TotalTable.Append("<th>项目启动时间</th>"); TotalTable.Append("</tr>\r\n"); List <CompanyInfo> companyList = CompanyBLL.ReadCompanyListByParentID(companyID.ToString()); foreach (CompanyInfo companyItem in companyList) { Dictionary <int, int> userDic = new Dictionary <int, int>(); List <UserInfo> currentCompanyUserList = userAllList.FindAll(delegate(UserInfo tempUser) { return(tempUser.CompanyID == companyItem.CompanyId); }); int manyPostNum = 0; Dictionary <int, int> studyUserDic = new Dictionary <int, int>(); //有学习的人 Dictionary <int, int> passPostUserDic = new Dictionary <int, int>(); //通过认证的人 Dictionary <int, int> passSelfPostUserDic = new Dictionary <int, int>(); //通过本职岗位的人 Dictionary <int, int> passSelfPostAndInCompanyUserDic = new Dictionary <int, int>(); //通过本职岗位还在职的人 Dictionary <int, int> passOtherPostUserDic = new Dictionary <int, int>(); //通过其他岗位的人 foreach (UserInfo userItem in currentCompanyUserList) { foreach (TestPaperInfo testpaper in TestPaperAllList) { if (userItem.ID == testpaper.UserId && !studyUserDic.ContainsKey(userItem.ID)) { studyUserDic[userItem.ID] = userItem.ID; break; } } foreach (PostPassInfo postpass in postPassList) { if (postpass.UserId == userItem.ID) { if (passPostUserDic.ContainsKey(userItem.ID)) { passPostUserDic[userItem.ID] = passPostUserDic[userItem.ID] + 1; } else { passPostUserDic[userItem.ID] = 1; } if (postpass.PostId == userItem.WorkingPostID) { passSelfPostUserDic[userItem.ID] = userItem.ID; if (userItem.Status != (int)UserState.Del) { passSelfPostAndInCompanyUserDic[userItem.ID] = userItem.ID; } } if (postpass.PostId != userItem.WorkingPostID) { passOtherPostUserDic[userItem.ID] = userItem.ID; } } } } foreach (int item in passPostUserDic.Values) { if (item > 1) { manyPostNum++; } } TotalTable.Append("<tr class=\"listTableMain\">"); TotalTable.Append("<td>" + companyItem.CompanySimpleName + "</td>"); TotalTable.Append("<td>" + currentCompanyUserList.Count + "</td>"); TotalTable.Append("<td>" + currentCompanyUserList.FindAll(delegate(UserInfo tempUser) { return(tempUser.Status != (int)UserState.Del); }).Count + "</td>"); TotalTable.Append("<td>" + studyUserDic.Count + "</td>"); TotalTable.Append("<td>" + passSelfPostUserDic.Count + "</td>"); TotalTable.Append("<td>" + passSelfPostAndInCompanyUserDic.Count + "</td>"); TotalTable.Append("<td>" + passOtherPostUserDic.Count + "</td>"); TotalTable.Append("<td>" + passPostUserDic.Count + "</td>"); TotalTable.Append("<td>" + manyPostNum + "</td>"); TotalTable.Append("<td>" + (!string.IsNullOrEmpty(companyItem.PostStartDate.ToString()) ? Convert.ToDateTime(companyItem.PostStartDate).ToString("d") : "") + "</td>"); TotalTable.Append("</tr>\r\n"); } TotalTable.Append("</table>\r\n"); groupResult.Add(company.CompanySimpleName + "合计"); groupResult.Add(0); groupResult.Add(0); groupResult.Add(0); groupResult.Add(""); groupResult.Add(""); groupResult.Add(""); groupResult.Add(0); string dataHtml = GetTheadHtml(company); TotalTable.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); TotalTable.Append("<tr class=\"listTableHead\">"); TotalTable.Append("<td colspan=\"7\">" + company.CompanySimpleName + " [" + startDate.ToString("d") + "—" + endDate.AddDays(-1).ToString("d") + "]"); TotalTable.Append("</td></tr>\r\n"); TotalTable.Append("<tr class=\"listTableHead\">\r\n"); TotalTable.Append("<td>公司名</td>"); TotalTable.Append("<td>参加岗位考试人数</td>"); TotalTable.Append("<td>最小学习量<br />学习达标人数</td>"); TotalTable.Append("<td>最小学习量<br />学习未达标人数</td>"); TotalTable.Append("<td>最小学习量<br />学习达成率</td>"); TotalTable.Append("<td>学霸</td>"); TotalTable.Append("<td>学习数量</td>"); TotalTable.Append("</tr>\r\n"); CompanyInfo companySearch = new CompanyInfo(); companySearch.Field = "CompanyId"; companySearch.Condition = CompanyBLL.ReadCompanyIdList(companyID.ToString()); companySearch.State = 0; companySearch.GroupIdCondition = "0,3"; List <CompanyInfo> sonCompanyList = CompanyBLL.ReadCompanyList(companySearch); //List<CompanyInfo> sonCompanyList = CompanyBLL.ReadCompanyListByCompanyId(CompanyBLL.ReadCompanyIdList(companyID.ToString())); foreach (CompanyInfo info in sonCompanyList) { if (info.CompanyId != companyID && !string.IsNullOrEmpty(info.PostStartDate.ToString()) && Convert.ToDateTime(info.PostStartDate) < endDate) { dataHtml += HtmlOut1(info, ref TotalTable); } } TotalTable.Append("<tr class=\"listTableFoot\">\r\n"); TotalTable.Append("<td>" + groupResult[0] + "</td>"); TotalTable.Append("<td>" + groupResult[1] + "</td>"); TotalTable.Append("<td>" + groupResult[2] + "</td>"); TotalTable.Append("<td>" + groupResult[3] + "</td>"); TotalTable.Append("<td>" + (double.Parse(groupResult[2].ToString()) / double.Parse(groupResult[1].ToString())).ToString("P") + "</td>"); TotalTable.Append("<td>" + groupResult[6] + "</td>"); TotalTable.Append("<td>" + groupResult[7] + "</td>"); TotalTable.Append("</tr>\r\n"); TotalTable.Append("</table>\r\n"); TotalTable.Append("<div style=\"line-height:25px; text-align:left; font-size:14px; margin-bottom:50px;\"><p style=\"text-align:left; font-size:14px; line-heigh:30px; margin-top:20px;\">4S店每人每周完成1-2小时的基础学习,将带动公司提升“百年老店”运营,建议高标为100%,低标为70%。"); if (!string.IsNullOrEmpty(groupResult[4].ToString())) { TotalTable.Append("<br /><br />目前:<span style=\"color:#00b050;\">" + groupResult[4] + "</span> 达至 <span style=\"color:#00b050;\">100%</span> ,表现良好,予以肯定。"); } if (!string.IsNullOrEmpty(groupResult[5].ToString())) { TotalTable.Append("<br /><br /><span style=\"color:#FF0000;\">" + groupResult[5] + "</span> 达成率尚不足 <span style=\"color:#FF0000;\">70%</span> ,请相关部门领导关注下属自主学习时间的妥善安排。"); } TotalTable.Append("</p></div>\r\n"); this.ReportList.InnerHtml = TotalTable.ToString() + dataHtml + GetTfootHtml(); } else { StringBuilder TotalTable = null; this.ReportList.InnerHtml = GetTheadHtml(company) + HtmlOut1(company, ref TotalTable) + GetTfootHtml(); } } } }
protected override void PageLoad() { base.PageLoad(); base.Title = "最小学习量达成分析表"; base.CheckUserPower("ReadEMSReport", PowerCheckType.Single); string logPath = ServerHelper.MapPath(@"\Log\"); TxtLog log = new TxtLog(logPath); Stopwatch time2 = new Stopwatch(); time2.Start(); if (CompanyID < 0) { CompanyID = base.UserCompanyID; } CompanyInfo company = CompanyBLL.ReadCompany(CompanyID); PostList = PostBLL.ReadPostListByPostId(company.Post); if (base.ExistsSonCompany) { userGroupList = AdminGroupBLL.ReadAdminGroupList(CompanyID, UserBLL.ReadUserGroupIDByCompanyID(base.SonCompanyID)); } else { userGroupList = AdminGroupBLL.ReadAdminGroupList(CompanyID, UserBLL.ReadUserGroupIDByCompanyID(CompanyID.ToString())); } //设置默认岗位(去除待考岗位) //if (string.IsNullOrEmpty(PostIdCondition)) PostIdCondition = StringHelper.SubString(company.Post, "197"); //if (string.IsNullOrEmpty(StudyPostIdCondition)) StudyPostIdCondition = StringHelper.SubString(company.Post, "197"); //用户权限组默认给考试人员 if (string.IsNullOrEmpty(groupID)) { groupID = "36"; } if (Action == "Search") { if (EndDate == DateTime.MinValue) { EndDate = DateTime.Today; } EndDate = ShopCommon.SearchEndDate(EndDate); if (base.CompareUserPower("ManageGroupCompany", PowerCheckType.Single) && base.IsGroupCompany(company.GroupId)) { List <CompanyInfo> sonCompanyList = base.SonCompanyList; //减少使用递归方法的频率 if (CompanyID != base.UserCompanyID) { sonCompanyList = CompanyBLL.ReadCompanyListByCompanyId(CompanyBLL.ReadCompanyIdList(CompanyID.ToString())); } GroupResult.Add(company.CompanySimpleName + "合计"); GroupResult.Add(0); GroupResult.Add(0); GroupResult.Add(0); GroupResult.Add(""); GroupResult.Add(""); StringBuilder TotalTable = new StringBuilder(); TotalTable.AppendLine("<table class=\"evaluation_sheet\">"); TotalTable.AppendLine("<tr>"); TotalTable.AppendLine("<th colspan=\"5\">" + company.CompanySimpleName + " [" + StartDate.ToString("d") + "—" + EndDate.AddDays(-1).ToString("d") + "]"); TotalTable.Append("</th>"); TotalTable.AppendLine("</tr>"); TotalTable.AppendLine("<tr>"); TotalTable.AppendLine("<th>公司名</th>"); TotalTable.AppendLine("<th>参加岗位考试人数</th>"); TotalTable.AppendLine("<th>最小学习量<br />学习达标人数</th>"); TotalTable.AppendLine("<th>最小学习量<br />学习未达标人数</th>"); TotalTable.AppendLine("<th>最小学习量<br />学习达成率</th>"); TotalTable.AppendLine("</tr>"); foreach (CompanyInfo info in sonCompanyList) { if (info.CompanyId != CompanyID && !string.IsNullOrEmpty(info.PostStartDate.ToString()) && Convert.ToDateTime(info.PostStartDate) < EndDate) { TotalTable.Append(HtmlOut1(info, "TotalTable")); } } TotalTable.AppendLine("<tr>"); TotalTable.AppendLine("<td>" + GroupResult[0] + "</td>"); TotalTable.AppendLine("<td>" + GroupResult[1] + "</td>"); TotalTable.AppendLine("<td>" + GroupResult[2] + "</td>"); TotalTable.AppendLine("<td>" + GroupResult[3] + "</td>"); TotalTable.AppendLine("<td>" + (double.Parse(GroupResult[2].ToString()) / double.Parse(GroupResult[1].ToString())).ToString("P") + "</td>"); TotalTable.AppendLine("</tr>"); TotalTable.AppendLine("</table>"); TotalTable.Append("<div style=\"line-height:25px; text-align:left; font-size:14px;\"><p style=\"text-align:left; font-size:14px; line-heigh:30px; margin-top:20px;\">4S店每人每周完成1-2小时的基础学习,将带动公司提升“百年老店”运营,建议高标为100%,低标为70%。"); if (!string.IsNullOrEmpty(GroupResult[4].ToString())) { TotalTable.Append("<br /><br />目前:<span style=\"color:#00b050;\">" + GroupResult[4] + "</span> 达至 <span style=\"color:#00b050;\">100%</span> ,表现良好,予以肯定。"); } if (!string.IsNullOrEmpty(GroupResult[5].ToString())) { TotalTable.Append("<br /><br /><span style=\"color:#FF0000;\">" + GroupResult[5] + "</span> 达成率尚不足 <span style=\"color:#FF0000;\">70%</span> ,请相关部门领导关注下属自主学习时间的妥善安排。"); } TotalTable.Append("</p></div>\r\n"); ReportContentHtml = TotalTable.ToString(); } else { ReportContentHtml = HtmlOut1(company, ""); } } time2.Stop(); log.Write("总执行时间为:" + time2.Elapsed.TotalSeconds); }