예제 #1
0
        protected override void OnInitComplete(EventArgs e)
        {
            base.OnInitComplete(e);
            if (!Page.IsPostBack)
            {
                BindFiles();

                ProductClass.DataSource = ProductClassBLL.ReadUnlimitClassList();
                ProductClass.DataBind();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                UserGrade.DataSource     = UserGradeBLL.ReadList();
                UserGrade.DataTextField  = "Name";
                UserGrade.DataValueField = "Id";
                UserGrade.DataBind();


                RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass();

                ProductClass.DataSource = ProductClassBLL.ReadUnlimitClassList();
                favorableActivityID     = RequestHelper.GetQueryString <int>("ID");
                if (favorableActivityID != int.MinValue)
                {
                    CheckAdminPower("ReadFavorableActivity", PowerCheckType.Single);
                    favorableActivity = FavorableActivityBLL.Read(favorableActivityID);
                    Photo.Text        = favorableActivity.Photo;
                    Name.Text         = favorableActivity.Name;
                    Content.Text      = favorableActivity.Content;
                    StartDate.Text    = favorableActivity.StartDate.ToString("yyyy-MM-dd");
                    EndDate.Text      = favorableActivity.EndDate.ToString("yyyy-MM-dd");
                    ControlHelper.SetCheckBoxListValue(UserGrade, favorableActivity.UserGrade);
                    OrderProductMoney.Text   = favorableActivity.OrderProductMoney.ToString();
                    RegionID.ClassIDList     = favorableActivity.RegionId ?? "";
                    ReduceMoney.Text         = favorableActivity.ReduceMoney.ToString();
                    ReduceDiscount.Text      = favorableActivity.ReduceDiscount.ToString();
                    favorableType            = favorableActivity.Type;
                    ProductClass.ClassIDList = favorableActivity.ClassIds ?? "";
                    if (!string.IsNullOrEmpty(favorableActivity.GiftId))
                    {
                        var giftSearch = new FavorableActivityGiftSearchInfo();
                        giftSearch.InGiftIds = Array.ConvertAll <string, int>(favorableActivity.GiftId.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), k => Convert.ToInt32(k));
                        giftList             = FavorableActivityGiftBLL.SearchList(giftSearch);
                    }
                }
                else
                {//新增:默认所有会员等级全部选中
                    foreach (ListItem item in UserGrade.Items)
                    {
                        item.Selected = true;
                    }
                }
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int favorID = RequestHelper.GetQueryString <int>("favorId");

            typeID = RequestHelper.GetQueryString <int>("typeId");
            int changeType = RequestHelper.GetQueryString <int>("changeType");

            if (typeID <= (int)FavorableType.AllOrders)
            {
                RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass();
                RegionID.DataBind();
            }
            if (typeID == (int)FavorableType.ProductClass)
            {
                RegionID.DataSource = ProductClassBLL.ReadUnlimitClassList();
                RegionID.DataBind();
            }
            //如果是修改,而且没改变优惠类型
            if (favorID > 0 && changeType <= 0)
            {
                RegionID.ClassIDList = FavorableActivityBLL.Read(favorID).RegionId;
            }
        }