Esempio n. 1
0
 private void BindData()
 {
     System.Collections.Generic.IList <ActivityInfo> allActivity = VShopHelper.GetAllActivity();
     this.grdActivity.DataSource = allActivity;
     this.grdActivity.DataBind();
     this.pager.TotalRecords = allActivity.Count;
 }
Esempio n. 2
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList()
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();
            IList <VActivityInfo> allActivity = VShopHelper.GetAllActivity();

            dataGridViewModel.rows  = new List <Dictionary <string, object> >();
            dataGridViewModel.total = allActivity.Count;
            foreach (VActivityInfo item2 in allActivity)
            {
                Dictionary <string, object> item = item2.ToDictionary();
                dataGridViewModel.rows.Add(item);
            }
            return(dataGridViewModel);
        }
Esempio n. 3
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtBannerDesc.Text    = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case LocationType.Topic:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = VShopHelper.Gettopics();
                this.ddlSubType.DataTextField  = "Title";
                this.ddlSubType.DataValueField = "TopicId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                break;

            case (LocationType)1:
            case LocationType.Home:
            case LocationType.ShoppingCart:
            case LocationType.OrderCenter:
            case LocationType.VipCard:
            case LocationType.GroupBuy:
                break;

            case LocationType.Brand:
                int BrandId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int.TryParse(tplCfgById.Url, out BrandId);
                }
                this.dropBrandTypes.Attributes.CssStyle.Remove("display");
                this.dropBrandTypes.DataSource     = ControlProvider.Instance().GetBrandCategories();
                this.dropBrandTypes.DataTextField  = "BrandName";
                this.dropBrandTypes.DataValueField = "BrandId";
                this.dropBrandTypes.DataBind();
                if (BrandId > 0)
                {
                    dropBrandTypes.SelectedValue = BrandId;
                }
                break;

            case LocationType.Category:
                int categoryId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    //string[] str = tplCfgById.Url.Split('?');
                    //if (str.Length > 0)
                    //{
                    //    string[] str1 = (tplCfgById.Url.Split('?')[1]).Split('=');
                    //    int.TryParse(str1[1].ToString(), out categoryId);
                    //}
                    int.TryParse(tplCfgById.Url, out categoryId);
                }
                this.dropCategories.Attributes.CssStyle.Remove("display");
                this.dropCategories.DataSource     = CatalogHelper.GetMainCategories();
                this.dropCategories.DataTextField  = "Name";
                this.dropCategories.DataValueField = "CategoryId";
                this.dropCategories.DataBind();
                if (categoryId > 0)
                {
                    dropCategories.SelectedValue = categoryId;
                }
                break;

            case LocationType.ImportSourceType:
                int importSourceId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    //string[] str = tplCfgById.Url.Split('?');
                    //if (str.Length > 0)
                    //{
                    //    string[] str1 = (tplCfgById.Url.Split('?')[1]).Split('=');
                    //    int.TryParse(str1[1].ToString(), out importSourceId);
                    //}
                    int.TryParse(tplCfgById.Url, out importSourceId);
                }
                this.dropImportSourceType.Attributes.CssStyle.Remove("display");
                this.dropImportSourceType.DataSource     = ImportSourceTypeHelper.GetAllImportSourceTypes();
                this.dropImportSourceType.DataTextField  = "CnArea";
                this.dropImportSourceType.DataValueField = "ImportSourceId";
                this.dropImportSourceType.DataBind();
                if (importSourceId > 0)
                {
                    dropImportSourceType.SelectedValue = importSourceId;
                }
                break;

            case LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <EcShop.Entities.VShop.LocationType>("");       //修改1
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                else
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                return;
            }

            case LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            case LocationType.Article:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                this.ddlSubType.Items.Clear();
                int num  = 0;
                int num2 = 0;
                if (!string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int num3 = tplCfgById.Url.LastIndexOf('=');
                    int.TryParse(tplCfgById.Url.Substring(num3 + 1), out num);
                }
                if (num > 0)
                {
                    ArticleInfo article = CommentBrowser.GetArticle(num);
                    if (article != null)
                    {
                        num2 = article.CategoryId;
                    }
                }
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        this.ddlSubType.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.CategoryId.ToString()));
                    }
                    if (num2 > 0)
                    {
                        this.ddlSubType.SelectedValue = num2.ToString();
                    }
                }
                if (num > 0)
                {
                    this.ddlThridType.Attributes.CssStyle.Remove("display");
                    System.Collections.Generic.IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num2, 1000);
                    foreach (ArticleInfo current2 in articleList)
                    {
                        this.ddlThridType.Items.Add(new System.Web.UI.WebControls.ListItem(current2.Title, current2.ArticleId.ToString()));
                    }
                    this.ddlThridType.SelectedValue = num.ToString();
                    return;
                }
                break;
            }

            case LocationType.Product:

                this.linkSelectProduct.Attributes.CssStyle.Remove("display");
                this.productName.Attributes.CssStyle.Remove("display");
                this.productid.Value = tplCfgById.Url;
                int result;
                if (int.TryParse(tplCfgById.Url, out result))
                {
                    this.productName.InnerText = ProductHelper.GetProductDetails(result).ProductName;
                }


                break;

            default:
                return;
            }
        }
Esempio n. 4
0
        public void ProcessRequest(HttpContext context)
        {
            string str = context.Request.Form["actionName"];
            string s   = string.Empty;

            switch (str)
            {
            case "Vote":
                s = JsonConvert.SerializeObject(StoreHelper.GetVoteList());
                goto Label_0547;

            case "Category":
                s = JsonConvert.SerializeObject(from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name });
                goto Label_0547;

            case "Activity":
            {
                Array           values = Enum.GetValues(typeof(LotteryActivityType));
                List <EnumJson> list2  = new List <EnumJson>();
                foreach (Enum enum2 in values)
                {
                    EnumJson json = new EnumJson {
                        Name  = enum2.ToShowText(),
                        Value = enum2.ToString()
                    };
                    list2.Add(json);
                }
                s = JsonConvert.SerializeObject(list2);
                goto Label_0547;
            }

            case "ActivityList":
            {
                string str3 = context.Request.Form["acttype"];
                LotteryActivityType type = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), str3);
                if (type == LotteryActivityType.SignUp)
                {
                    s = JsonConvert.SerializeObject(from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name });
                }
                goto Label_0547;
            }

            case "AccountTime":
            {
                s = s + "{";
                BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery {
                    RequestTime      = "",
                    CheckTime        = "",
                    StoreName        = "",
                    PageIndex        = 1,
                    PageSize         = 1,
                    SortOrder        = SortAction.Desc,
                    SortBy           = "RequestTime",
                    RequestEndTime   = "",
                    RequestStartTime = "",
                    IsCheck          = "1",
                    UserId           = context.Request.Form["UserID"]
                };
                Globals.EntityCoding(entity, true);
                DataTable data = (DataTable)DistributorsBrower.GetBalanceDrawRequest(entity, null).Data;
                if (data.Rows.Count <= 0)
                {
                    s = s + "\"Time\":\"\"";
                    break;
                }
                if (!(data.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim()))
                {
                    s = s + "\"Time\":\"\"";
                    break;
                }
                s = s + "\"Time\":\"" + data.Rows[0]["RequestTime"].ToString() + "\"";
                break;
            }

            case "ProdSelect":
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (!string.IsNullOrEmpty(masterSettings.DistributorProducts))
                {
                    DataTable products = ProductHelper.GetProducts(masterSettings.DistributorProducts);
                    if ((products != null) && (products.Rows.Count > 0))
                    {
                        List <SelectProduct> list3 = new List <SelectProduct>();
                        foreach (DataRow row in products.Rows)
                        {
                            SelectProduct product = new SelectProduct {
                                productid      = row["productid"].ToString(),
                                ProductName    = row["ProductName"].ToString(),
                                ThumbnailUrl60 = row["ThumbnailUrl60"].ToString()
                            };
                            list3.Add(product);
                        }
                        s = JsonConvert.SerializeObject(list3);
                    }
                }
                goto Label_0547;
            }

            case "ProdDel":
            {
                s = s + "{";
                string       str4     = context.Request.Form["productid"];
                SiteSettings settings = SettingsManager.GetMasterSettings(false);
                if (!string.IsNullOrEmpty(settings.DistributorProducts) && settings.DistributorProducts.Contains(str4))
                {
                    string str5 = "";
                    foreach (string str6 in settings.DistributorProducts.Split(new char[] { ',' }))
                    {
                        if (!str6.Equals(str4))
                        {
                            str5 = str5 + str6 + ",";
                        }
                    }
                    if (str5.Length > 0)
                    {
                        str5 = str5.Substring(0, str5.Length - 1);
                    }
                    settings.DistributorProducts = str5;
                    SettingsManager.Save(settings);
                }
                s = s + "\"status\":\"ok\"" + "}";
                goto Label_0547;
            }

            default:
                goto Label_0547;
            }
            s = s + "}";
Label_0547:
            context.Response.Write(s);
        }
Esempio n. 5
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtNavigateDesc.Text  = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            if (!tplCfgById.ImageUrl.ToLower().Contains("storage/master/navigate"))
            {
                this.iconpath = tplCfgById.ImageUrl;
            }
            this.littlepic.Src = tplCfgById.ImageUrl;
            this.fmSrc.Value   = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case EcShop.Entities.VShop.LocationType.Topic:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = VShopHelper.Gettopics();
                this.ddlSubType.DataTextField  = "Title";
                this.ddlSubType.DataValueField = "TopicId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                break;

            case (EcShop.Entities.VShop.LocationType) 1:
            case EcShop.Entities.VShop.LocationType.Home:
            case EcShop.Entities.VShop.LocationType.Category:
            case EcShop.Entities.VShop.LocationType.ShoppingCart:
            case EcShop.Entities.VShop.LocationType.OrderCenter:
            case EcShop.Entities.VShop.LocationType.VipCard:
            case EcShop.Entities.VShop.LocationType.GroupBuy:
            case EcShop.Entities.VShop.LocationType.Brand:
                break;

            case EcShop.Entities.VShop.LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <EcShop.Entities.AliOH.LocationType>("");//修改1
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                else
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                return;
            }

            case EcShop.Entities.VShop.LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            case EcShop.Entities.VShop.LocationType.Article:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                this.ddlSubType.Items.Clear();
                int num  = 0;
                int num2 = 0;
                if (!string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int num3 = tplCfgById.Url.LastIndexOf('=');
                    int.TryParse(tplCfgById.Url.Substring(num3 + 1), out num);
                }
                if (num > 0)
                {
                    ArticleInfo article = CommentBrowser.GetArticle(num);
                    if (article != null)
                    {
                        num2 = article.CategoryId;
                    }
                }
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        this.ddlSubType.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.CategoryId.ToString()));
                    }
                    if (num2 > 0)
                    {
                        this.ddlSubType.SelectedValue = num2.ToString();
                    }
                }
                if (num > 0)
                {
                    this.ddlThridType.Attributes.CssStyle.Remove("display");
                    System.Collections.Generic.IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num2, 1000);
                    foreach (ArticleInfo current2 in articleList)
                    {
                        this.ddlThridType.Items.Add(new System.Web.UI.WebControls.ListItem(current2.Title, current2.ArticleId.ToString()));
                    }
                    this.ddlThridType.SelectedValue = num.ToString();
                    return;
                }
                break;
            }

            default:
                return;
            }
        }
Esempio n. 6
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string text = context.Request.Form["actionName"];
            string s    = string.Empty;
            string key;

            switch (key = text)
            {
            case "Topic":
            {
                System.Collections.Generic.IList <TopicInfo> value = VShopHelper.Gettopics();
                s = JsonConvert.SerializeObject(value);
                break;
            }

            case "Vote":
            {
                System.Data.DataSet votes = StoreHelper.GetVotes();
                s = JsonConvert.SerializeObject(votes);
                break;
            }

            case "Category":
            {
                var value2 =
                    from item in CatalogHelper.GetMainCategories()
                    select new
                {
                    CateId   = item.CategoryId,
                    CateName = item.Name
                };
                s = JsonConvert.SerializeObject(value2);
                break;
            }

            case "Activity":
            {
                System.Array values = System.Enum.GetValues(typeof(LotteryActivityType));
                System.Collections.Generic.List <VsiteHandler.EnumJson> list = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                foreach (System.Enum @enum in values)
                {
                    list.Add(new VsiteHandler.EnumJson
                        {
                            Name  = @enum.ToShowText(),
                            Value = @enum.ToString()
                        });
                }
                s = JsonConvert.SerializeObject(list);
                break;
            }

            case "ActivityList":
            {
                string value3 = context.Request.Form["acttype"];
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), value3);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    var value4 =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                    s = JsonConvert.SerializeObject(value4);
                }
                else
                {
                    System.Collections.Generic.IList <LotteryActivityInfo> lotteryActivityByType = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                    s = JsonConvert.SerializeObject(lotteryActivityByType);
                }
                break;
            }

            case "ArticleCategory":
            {
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    System.Collections.Generic.List <VsiteHandler.EnumJson> list2 = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        list2.Add(new VsiteHandler.EnumJson
                            {
                                Name  = current.Name,
                                Value = current.CategoryId.ToString()
                            });
                    }
                    s = JsonConvert.SerializeObject(list2);
                }
                break;
            }

            case "ArticleList":
            {
                int categoryId = 0;
                if (context.Request.Form["categoryId"] != null)
                {
                    int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId);
                }
                System.Collections.Generic.IList <ArticleInfo>          articleList = CommentBrowser.GetArticleList(categoryId, 1000);
                System.Collections.Generic.List <VsiteHandler.EnumJson> list3       = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                foreach (ArticleInfo current2 in articleList)
                {
                    list3.Add(new VsiteHandler.EnumJson
                        {
                            Name  = current2.Title,
                            Value = current2.ArticleId.ToString()
                        });
                }
                s = JsonConvert.SerializeObject(list3);
                break;
            }
            }
            context.Response.Write(s);
        }
Esempio n. 7
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtNavigateDesc.Text  = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case EcShop.Entities.VShop.LocationType.Topic:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = VShopHelper.Gettopics();
                this.ddlSubType.DataTextField  = "Title";
                this.ddlSubType.DataValueField = "TopicId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                break;

            case (EcShop.Entities.VShop.LocationType) 1:
            case EcShop.Entities.VShop.LocationType.Home:
            case EcShop.Entities.VShop.LocationType.Category:
            case EcShop.Entities.VShop.LocationType.ShoppingCart:
            case EcShop.Entities.VShop.LocationType.OrderCenter:
            case EcShop.Entities.VShop.LocationType.VipCard:
                break;

            case EcShop.Entities.VShop.LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <EcShop.Entities.AppLocationType>("");//修改1
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                else
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                return;
            }

            case EcShop.Entities.VShop.LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case EcShop.Entities.VShop.LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            default:
                return;
            }
        }
Esempio n. 8
0
        public void ProcessRequest(HttpContext context)
        {
            string str  = context.Request.Form["actionName"];
            string s    = string.Empty;
            string str4 = str;

            if (str4 != null)
            {
                if (!(str4 == "Topic"))
                {
                    if (str4 == "Vote")
                    {
                        s = JsonConvert.SerializeObject(StoreHelper.GetVoteList());
                    }
                    else if (str4 == "Category")
                    {
                        s = JsonConvert.SerializeObject(from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name });
                    }
                    else if (str4 == "Activity")
                    {
                        Array           values = Enum.GetValues(typeof(LotteryActivityType));
                        List <EnumJson> list3  = new List <EnumJson>();
                        foreach (Enum enum2 in values)
                        {
                            EnumJson json = new EnumJson {
                                Name  = enum2.ToShowText(),
                                Value = enum2.ToString()
                            };
                            list3.Add(json);
                        }
                        s = JsonConvert.SerializeObject(list3);
                    }
                    else if (str4 == "ActivityList")
                    {
                        string str3 = context.Request.Form["acttype"];
                        LotteryActivityType type = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), str3);
                        if (type == LotteryActivityType.SignUp)
                        {
                            s = JsonConvert.SerializeObject(from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name });
                        }
                        else
                        {
                            s = JsonConvert.SerializeObject(VShopHelper.GetLotteryActivityByType(type));
                        }
                    }
                    else if (str4 == "AccountTime")
                    {
                        s = s + "{";
                        BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery {
                            RequestTime      = "",
                            CheckTime        = "",
                            StoreName        = "",
                            PageIndex        = 1,
                            PageSize         = 1,
                            SortOrder        = SortAction.Desc,
                            SortBy           = "RequestTime",
                            RequestEndTime   = "",
                            RequestStartTime = "",
                            IsCheck          = "1",
                            UserId           = context.Request.Form["UserID"]
                        };
                        Globals.EntityCoding(entity, true);
                        DataTable data = (DataTable)DistributorsBrower.GetBalanceDrawRequest(entity).Data;
                        if (data.Rows.Count > 0)
                        {
                            if (data.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim())
                            {
                                s = s + "\"Time\":\"" + data.Rows[0]["RequestTime"].ToString() + "\"";
                            }
                            else
                            {
                                s = s + "\"Time\":\"\"";
                            }
                        }
                        else
                        {
                            s = s + "\"Time\":\"\"";
                        }
                        s = s + "}";
                    }
                }
                else
                {
                    s = JsonConvert.SerializeObject(VShopHelper.Gettopics());
                }
            }
            context.Response.Write(s);
        }
Esempio n. 9
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtNavigateDesc.Text  = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            if (!tplCfgById.ImageUrl.ToLower().Contains("storage/master/navigate"))
            {
                this.iconpath = tplCfgById.ImageUrl;
            }
            this.littlepic.Src = tplCfgById.ImageUrl;
            this.fmSrc.Value   = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case LocationType.Vote:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = StoreHelper.GetVoteList();
                this.ddlSubType.DataTextField  = "VoteName";
                this.ddlSubType.DataValueField = "VoteId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                return;

            case LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <LotteryActivityType>("");
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[] { ',' })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType type = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[] { ',' })[0]);
                if (type != LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(type);
                    break;
                }
                this.ddlThridType.DataSource = from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name };
                break;
            }

            case LocationType.Home:
            case LocationType.Category:
            case LocationType.ShoppingCart:
            case LocationType.OrderCenter:
            case (LocationType.OrderCenter | LocationType.Vote):
                return;

            case LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            default:
                return;
            }
            this.ddlThridType.DataTextField  = "ActivityName";
            this.ddlThridType.DataValueField = "Activityid";
            this.ddlThridType.DataBind();
            this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[] { ',' })[1];
        }
Esempio n. 10
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetImgCfgById(this.id);

            this.txtBannerDesc.Text    = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            //case LocationType.Topic:
            //{
            //    this.ddlSubType.Attributes.CssStyle.Remove("display");
            //    System.Collections.Generic.IList<TopicInfo> topics = VShopHelper.Gettopics();
            //    if (topics != null && topics.Count > 0)
            //    {
            //        this.ddlSubType.DataSource = topics;
            //        this.ddlSubType.DataTextField = "title";
            //        this.ddlSubType.DataValueField = "TopicId";
            //        this.ddlSubType.DataBind();
            //        this.ddlSubType.SelectedValue = tplCfgById.Url;
            //    }
            //    break;
            //}
            case LocationType.Vote:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <VoteInfo> voteList = StoreHelper.GetVoteList();
                if (voteList != null && voteList.Count > 0)
                {
                    this.ddlSubType.DataSource     = voteList;
                    this.ddlSubType.DataTextField  = "VoteName";
                    this.ddlSubType.DataValueField = "VoteId";
                    this.ddlSubType.DataBind();
                    this.ddlSubType.SelectedValue = tplCfgById.Url;
                }
                break;
            }

            case LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <LotteryActivityType>("");
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType type = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (type != LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(type);
                }
                else
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                break;
            }

            case LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                break;

            case LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                break;

            case LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                break;
            }
        }
Esempio n. 11
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtBannerDesc.Text    = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case LocationType.Topic:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                IList <TopicInfo> topics = VShopHelper.Gettopics();
                if ((topics != null) && (topics.Count > 0))
                {
                    this.ddlSubType.DataSource     = topics;
                    this.ddlSubType.DataTextField  = "title";
                    this.ddlSubType.DataValueField = "TopicId";
                    this.ddlSubType.DataBind();
                    this.ddlSubType.SelectedValue = tplCfgById.Url;
                }
                return;
            }

            case LocationType.Vote:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                IList <VoteInfo> voteList = StoreHelper.GetVoteList();
                if ((voteList != null) && (voteList.Count > 0))
                {
                    this.ddlSubType.DataSource     = voteList;
                    this.ddlSubType.DataTextField  = "VoteName";
                    this.ddlSubType.DataValueField = "VoteId";
                    this.ddlSubType.DataBind();
                    this.ddlSubType.SelectedValue = tplCfgById.Url;
                }
                return;
            }

            case LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <LotteryActivityType>("");
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[] { ',' })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType type = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[] { ',' })[0]);
                if (type != LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(type);
                    break;
                }
                this.ddlThridType.DataSource = from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name };
                break;
            }

            case LocationType.Home:
            case LocationType.Category:
            case LocationType.ShoppingCart:
            case LocationType.OrderCenter:
            case LocationType.VipCard:
                return;

            case LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            default:
                return;
            }
            this.ddlThridType.DataTextField  = "ActivityName";
            this.ddlThridType.DataValueField = "Activityid";
            this.ddlThridType.DataBind();
            this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[] { ',' })[1];
        }
Esempio n. 12
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string text  = context.Request.Form["actionName"];
            string text2 = string.Empty;
            string key;

            switch (key = text)
            {
            case "Vote":
            {
                System.Collections.Generic.IList <VoteInfo> voteList = StoreHelper.GetVoteList();
                text2 = JsonConvert.SerializeObject(voteList);
                break;
            }

            case "Category":
            {
                var value = from item in CatalogHelper.GetMainCategories()
                            select new
                {
                    CateId   = item.CategoryId,
                    CateName = item.Name
                };
                text2 = JsonConvert.SerializeObject(value);
                break;
            }

            case "Activity":
            {
                System.Array values = System.Enum.GetValues(typeof(LotteryActivityType));
                System.Collections.Generic.List <VsiteHandler.EnumJson> list = new System.Collections.Generic.List <VsiteHandler.EnumJson>();
                foreach (System.Enum @enum in values)
                {
                    list.Add(new VsiteHandler.EnumJson
                        {
                            Name  = @enum.ToShowText(),
                            Value = @enum.ToString()
                        });
                }
                text2 = JsonConvert.SerializeObject(list);
                break;
            }

            case "ActivityList":
            {
                string value2 = context.Request.Form["acttype"];
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), value2);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    var value3 = from item in VShopHelper.GetAllActivity()
                                 select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                    text2 = JsonConvert.SerializeObject(value3);
                }
                break;
            }

            case "AccountTime":
            {
                text2 += "{";
                BalanceDrawRequestQuery balanceDrawRequestQuery = new BalanceDrawRequestQuery();
                balanceDrawRequestQuery.RequestTime      = "";
                balanceDrawRequestQuery.CheckTime        = "";
                balanceDrawRequestQuery.StoreName        = "";
                balanceDrawRequestQuery.PageIndex        = 1;
                balanceDrawRequestQuery.PageSize         = 1;
                balanceDrawRequestQuery.SortOrder        = SortAction.Desc;
                balanceDrawRequestQuery.SortBy           = "RequestTime";
                balanceDrawRequestQuery.RequestEndTime   = "";
                balanceDrawRequestQuery.RequestStartTime = "";
                balanceDrawRequestQuery.IsCheck          = "1";
                balanceDrawRequestQuery.UserId           = context.Request.Form["UserID"];
                Globals.EntityCoding(balanceDrawRequestQuery, true);
                DbQueryResult         balanceDrawRequest = DistributorsBrower.GetBalanceDrawRequest(balanceDrawRequestQuery, null);
                System.Data.DataTable dataTable          = (System.Data.DataTable)balanceDrawRequest.Data;
                if (dataTable.Rows.Count > 0)
                {
                    if (dataTable.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim())
                    {
                        text2 = text2 + "\"Time\":\"" + dataTable.Rows[0]["RequestTime"].ToString() + "\"";
                    }
                    else
                    {
                        text2 += "\"Time\":\"\"";
                    }
                }
                else
                {
                    text2 += "\"Time\":\"\"";
                }
                text2 += "}";
                break;
            }

            case "ProdSelect":
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (!string.IsNullOrEmpty(masterSettings.DistributorProducts))
                {
                    System.Data.DataTable products = ProductHelper.GetProducts(masterSettings.DistributorProducts);
                    if (products != null && products.Rows.Count > 0)
                    {
                        System.Collections.Generic.List <VsiteHandler.SelectProduct> list2 = new System.Collections.Generic.List <VsiteHandler.SelectProduct>();
                        foreach (System.Data.DataRow dataRow in products.Rows)
                        {
                            list2.Add(new VsiteHandler.SelectProduct
                                {
                                    productid      = dataRow["productid"].ToString(),
                                    ProductName    = dataRow["ProductName"].ToString(),
                                    ThumbnailUrl60 = dataRow["ThumbnailUrl60"].ToString()
                                });
                        }
                        text2 = JsonConvert.SerializeObject(list2);
                    }
                }
                break;
            }

            case "ProdDel":
            {
                text2 += "{";
                string       value4          = context.Request.Form["productid"];
                SiteSettings masterSettings2 = SettingsManager.GetMasterSettings(false);
                if (!string.IsNullOrEmpty(masterSettings2.DistributorProducts) && masterSettings2.DistributorProducts.Contains(value4))
                {
                    string   text3 = "";
                    string[] array = masterSettings2.DistributorProducts.Split(new char[]
                        {
                            ','
                        });
                    for (int i = 0; i < array.Length; i++)
                    {
                        string text4 = array[i];
                        if (!text4.Equals(value4))
                        {
                            text3 = text3 + text4 + ",";
                        }
                    }
                    if (text3.Length > 0)
                    {
                        text3 = text3.Substring(0, text3.Length - 1);
                    }
                    masterSettings2.DistributorProducts = text3;
                    SettingsManager.Save(masterSettings2);
                }
                text2 += "\"status\":\"ok\"";
                text2 += "}";
                break;
            }
            }
            context.Response.Write(text2);
        }
Esempio n. 13
0
        public void ProcessRequest(HttpContext context)
        {
            string text = context.Request["actionName"];
            string s    = string.Empty;
            int    num;

            switch (text)
            {
            case "Topic":
            {
                IList <TopicInfo> appTopics = VShopHelper.GetAppTopics();
                s = JsonConvert.SerializeObject(appTopics);
                break;
            }

            case "Vote":
            {
                DataTable value4 = VshopBrowser.GetVoteByIsShowWX().Tables[0];
                s = JsonConvert.SerializeObject(value4);
                break;
            }

            case "Category":
            {
                var value = from item in CatalogHelper.GetMainCategories()
                            select new
                {
                    CateId   = item.CategoryId,
                    CateName = item.Name
                };
                s = JsonConvert.SerializeObject(value);
                break;
            }

            case "Activity":
            {
                string a      = context.Request["client"].ToNullString().ToLower();
                Array  values = Enum.GetValues(typeof(LotteryActivityType));
                if (a == "app")
                {
                    values = Enum.GetValues(typeof(AppLotteryActivityType));
                }
                List <EnumJson> list2 = new List <EnumJson>();
                foreach (Enum item in values)
                {
                    EnumJson enumJson3 = new EnumJson();
                    enumJson3.Name  = item.ToShowText();
                    enumJson3.Value = item.ToString();
                    list2.Add(enumJson3);
                }
                s = JsonConvert.SerializeObject(list2);
                break;
            }

            case "ActivityList":
            {
                string value2 = context.Request.Form["acttype"];
                LotteryActivityType lotteryActivityType = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), value2);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    var value3 = from item in VShopHelper.GetAllActivity()
                                 select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                    s = JsonConvert.SerializeObject(value3);
                }
                else
                {
                    IList <LotteryActivityInfo> lotteryActivityByType = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                    s = JsonConvert.SerializeObject(lotteryActivityByType);
                }
                break;
            }

            case "ArticleCategory":
            {
                IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    List <EnumJson> list3 = new List <EnumJson>();
                    foreach (ArticleCategoryInfo item2 in articleMainCategories)
                    {
                        EnumJson enumJson4 = new EnumJson();
                        enumJson4.Name = item2.Name;
                        EnumJson enumJson5 = enumJson4;
                        num             = item2.CategoryId;
                        enumJson5.Value = num.ToString();
                        list3.Add(enumJson4);
                    }
                    s = JsonConvert.SerializeObject(list3);
                }
                break;
            }

            case "ArticleList":
            {
                int categoryId = 0;
                if (context.Request.Form["categoryId"] != null)
                {
                    int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId);
                }
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 1000);
                List <EnumJson>     list        = new List <EnumJson>();
                foreach (ArticleInfo item3 in articleList)
                {
                    EnumJson enumJson = new EnumJson();
                    enumJson.Name = item3.Title;
                    EnumJson enumJson2 = enumJson;
                    num             = item3.ArticleId;
                    enumJson2.Value = num.ToString();
                    list.Add(enumJson);
                }
                s = JsonConvert.SerializeObject(list);
                break;
            }
            }
            context.Response.Write(s);
        }