コード例 #1
0
 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;
             }
         }
     }
 }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string date = RequestHelper.GetQueryString <string>("Date");

            year  = Convert.ToInt32(date.Split('|')[0]);
            month = Convert.ToInt32(date.Split('|')[1]);
            OrderSearchInfo orderSearch = new OrderSearchInfo();
            DateType        dateType    = DateType.Day;

            if (month == int.MinValue)
            {
                dateType = DateType.Month;
                orderSearch.StartAddDate = Convert.ToDateTime(year + "-01-01");
                orderSearch.EndAddDate   = Convert.ToDateTime(year + "-01-01").AddYears(1);
            }
            else
            {
                days = ShopCommon.CountMonthDays(year, month);
                orderSearch.StartAddDate = Convert.ToDateTime(year + "-" + month + "-01");
                orderSearch.EndAddDate   = Convert.ToDateTime(year + "-" + month + "-01").AddMonths(1);
            }
            DataTable dt = OrderBLL.StatisticsSaleTotal(orderSearch, dateType);

            foreach (DataRow dr in dt.Rows)
            {
                orderCountDic.Add(Convert.ToInt32(dr[0]), Convert.ToInt32(dr[1]));
                orderMoneyDic.Add(Convert.ToInt32(dr[0]), Convert.ToDecimal(dr[2]));
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
 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);
     }
 }
コード例 #7
0
 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 += "]";
     }
 }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string queryString = RequestHelper.GetQueryString <string>("Date");

            this.year  = Convert.ToInt32(queryString.Split(new char[] { '|' })[0]);
            this.month = Convert.ToInt32(queryString.Split(new char[] { '|' })[1]);
            OrderSearchInfo orderSearch = new OrderSearchInfo();
            DateType        day         = DateType.Day;

            if (this.month == -2147483648)
            {
                day = DateType.Month;
                orderSearch.StartAddDate = Convert.ToDateTime(this.year + "-01-01");
                orderSearch.EndAddDate   = Convert.ToDateTime(this.year + "-01-01").AddYears(1);
            }
            else
            {
                this.days = ShopCommon.CountMonthDays(this.year, this.month);
                orderSearch.StartAddDate = Convert.ToDateTime(string.Concat(new object[] { this.year, "-", this.month, "-01" }));
                orderSearch.EndAddDate   = Convert.ToDateTime(string.Concat(new object[] { this.year, "-", this.month, "-01" })).AddMonths(1);
            }
            DataTable table = OrderBLL.StatisticsOrderCount(orderSearch, day);

            foreach (DataRow row in table.Rows)
            {
                this.orderCountDic.Add(Convert.ToInt32(row[0]), Convert.ToInt32(row[1]));
            }
        }
コード例 #9
0
ファイル: ProductSale.aspx.cs プロジェクト: xuefuruanjian/ems
 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);
     }
 }
コード例 #10
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);
            }
        }
コード例 #11
0
        /// <summary>
        /// 拼团活动详情
        /// </summary>
        /// <returns></returns>
        public ActionResult GroupBuyDetail()
        {
            int          id     = RequestHelper.GetForm <int>("id");
            GroupBuyInfo entity = GroupBuyBLL.Read(id);

            if (entity.Id <= 0)
            {
                return(Json(new { ok = false, msg = "拼团商品不存在" }));
            }
            var product = ProductBLL.Read(entity.ProductId);

            if (product.Id <= 0)
            {
                return(Json(new { ok = false, msg = "拼团商品不存在" }));
            }
            if (product.OpenGroup != 1)
            {
                return(Json(new { ok = false, msg = "此商品暂不支持拼团" }));
            }
            //拼团状态
            entity.VirtualStatus = (entity.EndTime <DateTime.Now && entity.Quantity> entity.SignCount) ? -1 : (entity.StartTime <= DateTime.Now && entity.EndTime >= DateTime.Now && entity.Quantity > entity.SignCount) ? 0 : (entity.StartTime <= DateTime.Now && entity.EndTime >= DateTime.Now && entity.Quantity <= entity.SignCount) ? 1 : -1;
            //除团长以外其他参与者
            List <GroupSignInfo> signList = GroupSignBLL.ReadListByGroupId(id).Where(k => k.UserId != entity.Leader).ToList();

            #region 推荐商品
            int userGrade = UserGradeBLL.ReadByMoney(0).Id;
            int uid       = RequestHelper.GetForm <int>("uid");
            var user      = UserBLL.ReadUserMore(uid);
            if (user != null && user.Id > 0)
            {
                userGrade = UserGradeBLL.ReadByMoney(user.MoneyUsed).Id;
            }
            int hotCount     = 0;
            var prorecommend = ProductBLL.SearchList(1, 4, new ProductSearchInfo {
                IsSale = (int)BoolType.True, IsTop = (int)BoolType.True, IsDelete = (int)BoolType.False, NotInProductId = product.Id.ToString()
            }, ref hotCount);
            var prorelist = new List <ProductVirtualModel>();
            foreach (var item in prorecommend)
            {
                var vp = new ProductVirtualModel()
                {
                    id         = item.Id,
                    name       = item.Name,
                    img        = ShopCommon.ShowImage(item.Photo.Replace("Original", "150-150")),
                    imgbig     = ShopCommon.ShowImage(item.Photo.Replace("Original", "350-350")),
                    imgorg     = ShopCommon.ShowImage(item.Photo),
                    price      = ProductBLL.GetCurrentPrice(item.SalePrice, userGrade),
                    click      = item.ViewCount,
                    like       = item.LikeNum,
                    totalstore = item.StandardType == (int)ProductStandardType.Single ? ProductTypeStandardRecordBLL.GetSumStorageByProduct(item.Id) : item.TotalStorageCount,
                    //ordercount = item.OrderCount
                    //是否启用不限库存,分别计算销量
                    ordercount = item.UnlimitedStorage == 1 ? OrderBLL.GetProductOrderCountDaily(item.Id, item.StandardType, DateTime.Now) : item.OrderCount
                };
                prorelist.Add(vp);
            }
            #endregion
            return(Json(new { ok = true, entity = entity, product = product, signlist = signList, topproductlist = prorelist }));
        }
コード例 #12
0
ファイル: UpdateMobile.cs プロジェクト: skybluebin007/JW-Shop
        /// <summary>
        /// 修改手机号码
        /// </summary>
        protected void UpdateUserMobile()
        {
            string msg = string.Empty;

            try
            {
                UserInfo user = UserBLL.Read(base.UserId);
                user.Mobile = StringHelper.AddSafe(RequestHelper.GetForm <string>("Mobile"));
                string safeCode = RequestHelper.GetForm <string>("phoneVer");
                //手机短信验证码
                if (CookiesHelper.ReadCookie("MobileCode" + StringHelper.AddSafe(user.Mobile)) == null)
                {
                    msg = "error|校验码失效,请重新获取";
                }
                else
                {
                    string mobileCode = CookiesHelper.ReadCookie("MobileCode" + StringHelper.AddSafe(user.Mobile)).Value.ToString();
                    if (safeCode.ToLower() != mobileCode.ToLower())
                    {
                        msg = "error|校验码错误";
                    }
                    else
                    {
                        CookiesHelper.DeleteCookie("MobileCode" + StringHelper.AddSafe(user.Mobile));
                    }
                }
                if (msg == string.Empty)
                {
                    if (string.IsNullOrEmpty(user.Mobile))
                    {
                        msg = "error|请填写手机号码";
                    }
                    if (!ShopCommon.CheckMobile(user.Mobile))
                    {
                        msg = "error|手机号码错误";
                    }
                    if (!UserBLL.CheckMobile(user.Mobile, base.UserId))
                    {
                        msg = "error|手机号码已被其他会员注册";
                    }
                    else
                    {
                        UserBLL.Update(user);
                        msg = "ok|修改成功";
                    }
                }
                Response.Clear();
                Response.Write(msg);
            }
            catch (Exception ex)
            {
                Response.Clear();
                Response.Write("error|系统忙,请稍后重试");
            }
            finally {
                Response.End();
            }
        }
コード例 #13
0
 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;
             }
         }
     }
 }
コード例 #14
0
        public ActionResult GetBirthdayCoupon()
        {
            int count      = 0;
            var couponlist = CouponBLL.SearchList(1, 1, new CouponSearchInfo {
                Type = (int)CouponKind.BirthdayGet, CanUse = 1
            }, ref count);

            //如果有进行中的生日礼券,并且 用户本年度未领取生日礼券
            if (couponlist.Count > 0 && (user.HasBirthdayCoupon == 0 || (user.HasBirthdayCoupon != 0 && user.GetBirthdayCouponDate.Year != DateTime.Now.Year)))
            {
                UserCouponInfo userCoupon = UserCouponBLL.ReadLast(couponlist[0].Id);
                if (UserCouponBLL.UniqueUserCatch(user.Id, couponlist[0].Id))
                {
                    int startNumber = 0;
                    if (userCoupon.Id > 0)
                    {
                        string tempNumber = userCoupon.Number.Substring(3, 5);
                        while (tempNumber.Substring(0, 1) == "0")
                        {
                            tempNumber = tempNumber.Substring(1);
                        }
                        startNumber = Convert.ToInt32(tempNumber);
                    }
                    startNumber++;
                    int cpid = UserCouponBLL.Add(new UserCouponInfo
                    {
                        UserId   = user.Id,
                        UserName = user.UserName,
                        CouponId = couponlist[0].Id,
                        GetType  = (int)CouponType.CatchByUser,
                        Number   = ShopCommon.CreateCouponNo(couponlist[0].Id, startNumber),
                        Password = ShopCommon.CreateCouponPassword(startNumber),
                        IsUse    = (int)BoolType.False,
                        OrderId  = 0
                    });
                    //领取成功改变user表标识
                    if (cpid > 0)
                    {
                        Dictionary <string, object> dict = new Dictionary <string, object>();
                        dict.Add("[HasBirthdayCoupon]", 1);
                        dict.Add("[GetBirthdayCouponDate]", DateTime.Now);
                        UserBLL.UpdatePart("[usr]", dict, user.Id);
                        return(Json(new { ok = true }));
                    }
                    return(Json(new { ok = false, msg = "领取失败,请稍后重试" }));
                }
                else
                {
                    return(Json(new { ok = false, msg = "领取失败,您已领取过生日礼券" }));
                }
            }
            else
            {
                return(Json(new { ok = false, msg = "活动暂停或者您已领取过生日礼券" }));
            }
        }
コード例 #15
0
        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);
            }
        }
コード例 #16
0
ファイル: Cert.aspx.cs プロジェクト: xuefuruanjian/ems
        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);
                }
            }
        }
コード例 #17
0
 public ActionResult UpdateUserInfo()
 {
     if (user.Id <= 0)
     {
         return(Json(new { ok = false, msg = "无效的请求" }));
     }
     else
     {
         string birthdayBeforeUpdate = user.Birthday;
         string realName             = RequestHelper.GetForm <string>("realname");
         string birthDay             = RequestHelper.GetForm <string>("birthday");
         string email = RequestHelper.GetForm <string>("email");
         if (string.IsNullOrEmpty(realName))
         {
             return(Json(new { ok = false, msg = "请填写真实姓名" }));
         }
         if (string.IsNullOrEmpty(birthDay))
         {
             return(Json(new { ok = false, msg = "请填写生日" }));
         }
         if (Convert.ToDateTime(birthDay) >= DateTime.Now)
         {
             return(Json(new { ok = false, msg = "请填写真实生日" }));
         }
         if (!string.IsNullOrEmpty(email) && !ShopCommon.CheckEmail(email))
         {
             return(Json(new { ok = false, msg = "邮箱格式错误" }));
         }
         Dictionary <string, object> dict = new Dictionary <string, object>();
         dict.Add("[RealName]", StringHelper.Substring(realName, 18, false));
         dict.Add("[Birthday]", StringHelper.Substring(birthDay, 30, false));
         dict.Add("[Email]", StringHelper.Substring(email, 30, false));
         UserBLL.UpdatePart("[usr]", dict, user.Id);
         //如果是首次填写生日信息则赠送积分20
         if (string.IsNullOrEmpty(birthdayBeforeUpdate))
         {
             UserAccountRecordInfo uar = new UserAccountRecordInfo
             {
                 RecordType = (int)AccountRecordType.Point,
                 Money      = 0,
                 Point      = 20,
                 Date       = DateTime.Now,
                 IP         = ClientHelper.IP,
                 Note       = "填写生日赠送积分",
                 UserId     = user.Id,
                 UserName   = user.UserName
             };
             if (UserAccountRecordBLL.Add(uar) > 0)
             {
                 user.PointLeft += 20;
             }
         }
         return(Json(new { ok = true }));
     }
 }
コード例 #18
0
        public ActionResult GetCouponByUser()
        {
            int couponId = RequestHelper.GetForm <int>("couponId");

            if (uid > 0 && couponId > 0)
            {
                CouponInfo coupon = CouponBLL.Read(couponId);
                if (UserCouponBLL.UniqueUserCatch(uid, couponId))
                {
                    if (coupon.TotalCount - 1 < coupon.UsedCount)
                    {
                        return(Json(new { ok = false, msg = "优惠券余量不足" }));
                    }
                    UserCouponInfo userCoupon  = UserCouponBLL.ReadLast(couponId);
                    int            startNumber = 0;
                    if (userCoupon.Id > 0)
                    {
                        string tempNumber = userCoupon.Number.Substring(3, 5);
                        while (tempNumber.Substring(0, 1) == "0")
                        {
                            tempNumber = tempNumber.Substring(1);
                        }
                        startNumber = Convert.ToInt32(tempNumber);
                    }
                    startNumber++;
                    UserCouponInfo tmpCoupon = new UserCouponInfo();
                    tmpCoupon.CouponId = couponId;
                    tmpCoupon.GetType  = (int)CouponType.CatchByUser;
                    tmpCoupon.Number   = ShopCommon.CreateCouponNo(couponId, startNumber);
                    tmpCoupon.Password = ShopCommon.CreateCouponPassword(startNumber);
                    tmpCoupon.IsUse    = (int)BoolType.False;
                    tmpCoupon.OrderId  = 0;
                    tmpCoupon.UserId   = uid;
                    tmpCoupon.UserName = user.UserName;
                    if (UserCouponBLL.Add(tmpCoupon) > 0)
                    {//如果领取成功,增加优惠券的发放(领取)量
                        coupon.UsedCount++;
                        Dictionary <string, object> dict = new Dictionary <string, object>();
                        dict.Add("[UsedCount]", coupon.UsedCount);
                        CouponBLL.UpdatePart("[Coupon]", dict, coupon.Id);
                    }
                    return(Json(new { ok = true, msg = "领券成功" }));
                }
                else
                {
                    return(Json(new { ok = false, msg = "您已领过此优惠券" }));
                }
            }
            else
            {
                return(Json(new { ok = false, msg = "请先登录" }));
            }
        }
コード例 #19
0
ファイル: ProductAjax.cs プロジェクト: skybluebin007/JW-Shop
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();

            var queryClass = RequestHelper.GetQueryString <string>("cat").Split(',');
            int classLevel1 = 0, classLevel2 = 0, classLevel3 = 0;

            if (queryClass.Length > 0)
            {
                classLevel1 = ShopCommon.ConvertToT <int>(queryClass[0]);
            }
            if (queryClass.Length > 1)
            {
                classLevel2 = ShopCommon.ConvertToT <int>(queryClass[1]);
            }
            if (queryClass.Length > 2)
            {
                classLevel3 = ShopCommon.ConvertToT <int>(queryClass[2]);
            }
            int currentClassId = classLevel3 > 0 ? classLevel3 : classLevel2 > 0 ? classLevel2 : classLevel1;

            //商品列表
            currentPage = RequestHelper.GetQueryString <int>("Page");
            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int    pageSize = 6; int count = 0;
            string brandIds        = RequestHelper.GetQueryString <string>("brand");
            string attributeIds    = RequestHelper.GetQueryString <string>("at");
            string attributeValues = RequestHelper.GetQueryString <string>("ex");
            string orderField      = RequestHelper.GetQueryString <string>("sort");
            string orderType       = "";
            var    orderParams     = orderField.Split('_');

            if (orderParams.Length > 1)
            {
                orderField = orderParams[0];
                orderType  = orderParams[1];
            }
            int    minPrice  = RequestHelper.GetQueryString <int>("min");
            int    maxPrice  = RequestHelper.GetQueryString <int>("max");
            string keywords  = RequestHelper.GetQueryString <string>("kw");
            int    isNew     = RequestHelper.GetQueryString <int>("isNew");
            int    isHot     = RequestHelper.GetQueryString <int>("isHot");
            int    isSpecial = RequestHelper.GetQueryString <int>("isSpecial");
            int    isTop     = RequestHelper.GetQueryString <int>("isTop");

            productList = ProductBLL.SearchList(currentPage, pageSize, currentClassId, brandIds, attributeIds, attributeValues, orderField, orderType, minPrice, maxPrice, keywords, "", isNew, isHot, isSpecial, isTop, ref count, ref showAttributeList, ref showBrandList);
        }
コード例 #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("StatisticsOrder", PowerCheckType.Single);
         ShopCommon.BindYearMonth(this.Year, this.Month);
         int queryString = RequestHelper.GetQueryString <int>("Year");
         queryString = (queryString == -2147483648) ? DateTime.Now.Year : queryString;
         int num2 = RequestHelper.GetQueryString <int>("Month");
         this.Year.Text   = queryString.ToString();
         this.Month.Text  = num2.ToString();
         this.queryString = "?Date=" + queryString.ToString() + "|" + num2.ToString();
     }
 }
コード例 #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         CheckAdminPower("StatisticsUser", PowerCheckType.Single);
         ShopCommon.BindYearMonth(Year, Month);
         int year = RequestHelper.GetQueryString <int>("Year");
         year = (year == int.MinValue) ? DateTime.Now.Year : year;
         int month = RequestHelper.GetQueryString <int>("Month");
         Year.Text   = year.ToString();
         Month.Text  = month.ToString();
         queryString = "?Date=" + year.ToString() + "|" + month.ToString();
     }
 }
コード例 #22
0
        private void Submit()
        {
            int orderId       = RequestHelper.GetQueryString <int>("orderId");
            int orderDetailId = RequestHelper.GetQueryString <int>("orderDetailId");

            int     needRefundCount = RequestHelper.GetForm <int>("refund_count");
            decimal needRefundMoney = RequestHelper.GetForm <decimal>("refund_money");
            string  refundRemark    = StringHelper.AddSafe(RequestHelper.GetForm <string>("refund_remark"));

            OrderRefundInfo orderRefund = new OrderRefundInfo();

            orderRefund.RefundNumber = ShopCommon.CreateOrderRefundNumber();
            orderRefund.OrderId      = orderId;
            if (orderDetailId > 0)
            {
                orderRefund.OrderDetailId = orderDetailId;
                orderRefund.RefundCount   = needRefundCount;
            }
            orderRefund.Status       = (int)OrderRefundStatus.Submit;
            orderRefund.TmCreate     = DateTime.Now;
            orderRefund.RefundRemark = refundRemark;
            orderRefund.UserType     = 1;
            orderRefund.UserId       = base.UserId;
            orderRefund.UserName     = base.UserName;

            var refundMsg = JWRefund.VerifySubmitOrderRefund(orderRefund, needRefundMoney);

            if (refundMsg.CanRefund)
            {
                int id = OrderRefundBLL.Add(orderRefund);
                OrderRefundActionBLL.Add(new OrderRefundActionInfo
                {
                    OrderRefundId = id,
                    Status        = (int)BoolType.True,
                    Tm            = DateTime.Now,
                    UserType      = 1,
                    UserId        = base.UserId,
                    UserName      = base.UserName,
                    Remark        = "用户提交退款申请"
                });
                ResponseHelper.Write("ok|" + id);
                ResponseHelper.End();
            }
            else
            {
                ResponseHelper.Write("error|" + refundMsg.ErrorCodeMsg);
                ResponseHelper.End();
            }
        }
コード例 #23
0
        /// <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);
            }
        }
コード例 #24
0
ファイル: FlashBLL.cs プロジェクト: xuefuruanjian/ems
        public static void RebuildFile(int flashID)
        {
            StringBuilder builder = new StringBuilder();
            FlashInfo     info    = ReadFlash(flashID);

            if (info.ID > 0)
            {
                string str       = info.Width.ToString();
                string str2      = info.Height.ToString();
                string flashFile = ShopCommon.GetFlashFile(flashID.ToString());
                string title     = string.Empty;
                string uRL       = string.Empty;
                string fileName  = string.Empty;
                bool   flag      = true;
                builder.Append("var swf_width=" + str + ";\r\n");
                builder.Append("var swf_height=" + str2 + ";\r\n");
                List <FlashPhotoInfo> list = FlashPhotoBLL.ReadFlashPhotoByFlash(flashID);
                foreach (FlashPhotoInfo info2 in list)
                {
                    if (flag)
                    {
                        flag     = false;
                        title    = info2.Title;
                        uRL      = info2.URL;
                        fileName = info2.FileName;
                    }
                    else
                    {
                        title    = title + "|" + info2.Title;
                        uRL      = uRL + "|" + info2.URL;
                        fileName = fileName + "|" + info2.FileName;
                    }
                }
                builder.Append("var files='" + fileName + "';\r\n");
                builder.Append("var links='" + uRL + "';\r\n");
                builder.Append("var texts='" + title.Replace("'", "'").Replace("\"", "\\\"") + "';\r\n");
                builder.Append("document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+ swf_width +'\" height=\"'+ swf_height +'\">');\r\n");
                builder.Append("document.write('<param name=\"movie\" value=\"/Upload/FlashPhotoUpload/picturePlayer.swf\"><param name=\"quality\" value=\"high\">');\r\n");
                builder.Append("document.write('<param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"opaque\">');\r\n");
                builder.Append("document.write('<param name=\"FlashVars\" value=\"bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'\">');\r\n");
                builder.Append("document.write('<embed src=\"/Upload/FlashPhotoUpload/picturePlayer.swf\" wmode=\"opaque\" FlashVars=\"bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+' menu=\"false\" quality=\"high\" width=\"'+ swf_width +'\" height=\"'+ swf_height +'\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');\r\n");
                builder.Append("document.write('</object>'); \r\n");
                using (StreamWriter writer = new StreamWriter(ServerHelper.MapPath(flashFile), false, Encoding.UTF8))
                {
                    writer.Write(builder.ToString());
                }
            }
        }
コード例 #25
0
ファイル: AdBLL.cs プロジェクト: xuefuruanjian/ems
        public static void CreateAdFile(AdInfo ad)
        {
            AdClass class2 = new AdClass();

            class2.AdType    = (AdType)ad.AdClass;
            class2.Display   = ad.Display;
            class2.EndDate   = ad.EndDate;
            class2.FileName  = ServerHelper.MapPath(ShopCommon.GetAdFile(ad.ID.ToString()));
            class2.Height    = ad.Height;
            class2.IsEnabled = ad.IsEnabled;
            class2.StartDate = ad.StartDate;
            class2.Title     = ad.Title;
            class2.Url       = "/Ad.aspx?AdID=" + ad.ID.ToString() + "&URL=" + HttpContext.Current.Server.UrlEncode(ad.Url);
            class2.Width     = ad.Width;
            class2.MakeAdFile();
        }
コード例 #26
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            CheckAdminPower("OrderRefundApply", PowerCheckType.Single);

            int     orderId         = RequestHelper.GetQueryString <int>("orderId");
            int     orderDetailId   = RequestHelper.GetQueryString <int>("orderDetailId");
            decimal needRefundMoney = Convert.ToDecimal(RefundMoney.Text);

            OrderRefundInfo orderRefund = new OrderRefundInfo();

            orderRefund.RefundNumber = ShopCommon.CreateOrderRefundNumber();
            orderRefund.OrderId      = orderId;
            if (orderDetailId > 0)
            {
                orderRefund.OrderDetailId = orderDetailId;
                orderRefund.RefundCount   = Convert.ToInt32(RefundCount.Text);
            }
            orderRefund.Status       = (int)OrderRefundStatus.Submit;
            orderRefund.TmCreate     = DateTime.Now;
            orderRefund.RefundRemark = RefundRemark.Text;
            orderRefund.UserType     = 2;
            orderRefund.UserId       = Cookies.Admin.GetAdminID(false);
            orderRefund.UserName     = Cookies.Admin.GetAdminName(false);

            var refundMsg = JWRefund.VerifySubmitOrderRefund(orderRefund, needRefundMoney);

            if (refundMsg.CanRefund)
            {
                int id = OrderRefundBLL.Add(orderRefund);
                OrderRefundActionBLL.Add(new OrderRefundActionInfo
                {
                    OrderRefundId = id,
                    Status        = (int)BoolType.True,
                    Tm            = DateTime.Now,
                    UserType      = 2,
                    UserId        = orderRefund.UserId,
                    UserName      = orderRefund.UserName,
                    Remark        = "系统提交退款申请"
                });
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("OrderRefund"), id);
                ScriptHelper.Alert("退款申请成功", RequestHelper.RawUrl);
            }
            else
            {
                ScriptHelper.Alert(refundMsg.ErrorCodeMsg);
            }
        }
コード例 #27
0
        /// <summary>
        /// 生成小程序码方法
        /// </summary>
        /// <param name="param"></param>
        public void CreateQrCode(WxPayData param, string httpUrl, ref string imageUrl)
        {
            try
            {
                System.Net.HttpWebRequest request;
                request             = (System.Net.HttpWebRequest)WebRequest.Create(httpUrl);
                request.Method      = "POST";
                request.ContentType = "application/json;charset=UTF-8";
                string paraUrlCoded = param.ToJson();
                byte[] payload;
                payload = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
                request.ContentLength = payload.Length;
                Stream writer = request.GetRequestStream();
                writer.Write(payload, 0, payload.Length);
                writer.Close();
                System.Net.HttpWebResponse response;
                response = (System.Net.HttpWebResponse)request.GetResponse();
                System.IO.Stream s;
                s = response.GetResponseStream();        //返回图片数据流
                byte[] tt = ShopCommon.StreamToBytes(s); //将数据流转为byte[]

                //在文件名前面加上时间,以防重名
                string imgName = "xcx_" + Guid.NewGuid().ToString() + ".png";
                //文件存储相对于当前应用目录的虚拟目录
                string path = "/upload/qrcode/";
                //获取相对于应用的基目录,创建目录
                string imgPath = System.AppDomain.CurrentDomain.BaseDirectory + path;     //通过此对象获取文件名
                if (!Directory.Exists(imgPath))
                {
                    Directory.CreateDirectory(imgPath);
                }
                //System.IO.File.WriteAllBytes(Server.MapPath(path + imgName), tt);//讲byte[]存储为图片

                #region Png

                MemoryStream         stream = new MemoryStream(tt);
                System.Drawing.Image img    = System.Drawing.Image.FromStream(stream);
                img.Save(Server.MapPath(path + imgName), System.Drawing.Imaging.ImageFormat.Png);
                #endregion

                imageUrl = path + imgName;
            }
            catch (Exception e)
            {
                Log.Error("CreateQrCode", e.ToString());
            }
        }
コード例 #28
0
        /// <summary>
        /// 根据regionId获取省市名称
        /// </summary>
        /// <param name="regionId"></param>
        /// <returns></returns>
        public static string ReadCityName(string regionId)
        {
            string result = string.Empty;

            if (!string.IsNullOrEmpty(regionId))
            {
                foreach (string rid in regionId.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    int _rid = ShopCommon.ConvertToT <Int32>(rid);
                    if (_rid > 0)
                    {
                        result += RegionBLL.ReadRegionCache(_rid).RegionName;
                    }
                }
            }
            return(result);
        }
コード例 #29
0
        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);
            }
        }
コード例 #30
0
ファイル: User.aspx.cs プロジェクト: xuefuruanjian/ems
        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);
        }