public bool UpdateTplCfg(TplCfgInfo info) { StringBuilder builder = new StringBuilder(); builder.Append("update Hishop_Banner set "); builder.Append("ShortDesc=@ShortDesc,"); builder.Append("ImageUrl=@ImageUrl,"); builder.Append("DisplaySequence=@DisplaySequence,"); builder.Append("LocationType=@LocationType,"); builder.Append("Url=@Url,"); builder.Append("Type=@Type,"); builder.Append("IsDisable=@IsDisable"); builder.Append(" where BannerId=@BannerId "); DbCommand sqlStringCommand = this.database.GetSqlStringCommand(builder.ToString()); this.database.AddInParameter(sqlStringCommand, "BannerId", DbType.Int32, info.Id); this.database.AddInParameter(sqlStringCommand, "ShortDesc", DbType.String, info.ShortDesc); this.database.AddInParameter(sqlStringCommand, "ImageUrl", DbType.String, info.ImageUrl); this.database.AddInParameter(sqlStringCommand, "DisplaySequence", DbType.String, info.DisplaySequence); this.database.AddInParameter(sqlStringCommand, "LocationType", DbType.Int32, (int)info.LocationType); this.database.AddInParameter(sqlStringCommand, "Url", DbType.String, info.Url); this.database.AddInParameter(sqlStringCommand, "Type", DbType.Int32, info.Type); this.database.AddInParameter(sqlStringCommand, "IsDisable", DbType.Boolean, info.IsDisable); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
protected void btnEditBanner_Click(object sender, System.EventArgs e) { TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id); tplCfgById.IsDisable = false; tplCfgById.ImageUrl = this.fmSrc.Value; tplCfgById.ShortDesc = this.txtNavigateDesc.Text; tplCfgById.LocationType = (EcShop.Entities.VShop.LocationType)System.Enum.Parse(typeof(EcShop.Entities.VShop.LocationType), this.ddlType.SelectedValue); tplCfgById.Url = this.locationUrl.Value; tplCfgById.Client = 4; if (string.IsNullOrWhiteSpace(tplCfgById.ImageUrl)) { this.ShowMsg("请选择图标或上传图片!", false); return; } if (string.IsNullOrWhiteSpace(this.locationUrl.Value)) { this.ShowMsg("跳转页不能为空!", false); return; } if (VShopHelper.UpdateTplCfg(tplCfgById)) { this.CloseWindow(); return; } this.ShowMsg("修改失败!", false); }
protected void Restore() { TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id); this.txtBannerDesc.Text = tplCfgById.ShortDesc; this.littlepic.Src = tplCfgById.ImageUrl; this.fmSrc.Value = tplCfgById.ImageUrl; }
public TplCfgInfo GetTplCfgById(int id) { StringBuilder stringBuilder = new StringBuilder(" select * from Hishop_Banner where BannerId=@BannerId"); System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand(stringBuilder.ToString()); this.database.AddInParameter(sqlStringCommand, "BannerId", System.Data.DbType.Int32, id); TplCfgInfo result = null; using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { result = ReaderConvert.ReaderToModel <TplCfgInfo>(dataReader); } return(result); }
public static void SwapTplCfgSequence(int bannerId, int replaceBannerId) { BannerDao bannerDao = new BannerDao(); TplCfgInfo tplCfgById = bannerDao.GetTplCfgById(bannerId); TplCfgInfo tplCfgInfo = bannerDao.GetTplCfgById(replaceBannerId); if ((tplCfgById == null ? false : tplCfgInfo != null)) { int displaySequence = tplCfgById.DisplaySequence; tplCfgById.DisplaySequence = tplCfgInfo.DisplaySequence; tplCfgInfo.DisplaySequence = displaySequence; bannerDao.UpdateTplCfg(tplCfgById); bannerDao.UpdateTplCfg(tplCfgInfo); } }
public static void SwapTplCfgSequence(int bannerId, int replaceBannerId) { BannerDao bannerDao = new BannerDao(); TplCfgInfo tplCfgById = bannerDao.GetTplCfgById(bannerId); TplCfgInfo tplCfgById2 = bannerDao.GetTplCfgById(replaceBannerId); if (tplCfgById != null && tplCfgById2 != null) { int displaySequence = tplCfgById.DisplaySequence; tplCfgById.DisplaySequence = tplCfgById2.DisplaySequence; tplCfgById2.DisplaySequence = displaySequence; bannerDao.UpdateTplCfg(tplCfgById); bannerDao.UpdateTplCfg(tplCfgById2); } }
public static void SwapTplCfgSequence(int bannerId, int replaceBannerId) { BannerDao dao = new BannerDao(); TplCfgInfo tplCfgById = dao.GetTplCfgById(bannerId); TplCfgInfo info = dao.GetTplCfgById(replaceBannerId); if ((tplCfgById != null) && (info != null)) { int displaySequence = tplCfgById.DisplaySequence; tplCfgById.DisplaySequence = info.DisplaySequence; info.DisplaySequence = displaySequence; dao.UpdateTplCfg(tplCfgById); dao.UpdateTplCfg(info); } }
protected void btnAddBanner_Click(object sender, System.EventArgs e) { if (this.id == 0) { TplCfgInfo tplCfgInfo = new NavigateInfo(); tplCfgInfo.IsDisable = false; tplCfgInfo.ImageUrl = this.fmSrc.Value; tplCfgInfo.ShortDesc = this.txtBannerDesc.Text; tplCfgInfo.Client = 2; tplCfgInfo.LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue); tplCfgInfo.Url = this.locationUrl.Value; if (string.IsNullOrWhiteSpace(tplCfgInfo.ImageUrl)) { this.ShowMsg("请选择图标或上传图片!", false); return; } if (string.IsNullOrWhiteSpace(this.locationUrl.Value)) { this.ShowMsg("跳转页不能为空!", false); return; } if (VShopHelper.SaveTplCfg(tplCfgInfo)) { this.CloseWindow(); return; } this.ShowMsg("添加错误!", false); } else { TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id); tplCfgById.IsDisable = false; tplCfgById.ImageUrl = this.fmSrc.Value; tplCfgById.ShortDesc = this.txtBannerDesc.Text; tplCfgById.Client = 2; tplCfgById.LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue); tplCfgById.Url = this.locationUrl.Value; if (VShopHelper.UpdateTplCfg(tplCfgById)) { this.CloseWindow(); return; } this.ShowMsg("修改失败!", false); } }
public bool SaveTplCfg(TplCfgInfo info) { int maxBannerSequence = this.GetMaxBannerSequence(); StringBuilder stringBuilder = new StringBuilder("insert into Hishop_Banner (ShortDesc,ImageUrl,DisplaySequence,LocationType,Url,Type,IsDisable)"); stringBuilder.Append("values (@ShortDesc,@ImageUrl,@DisplaySequence,@LocationType,@Url,@Type,@IsDisable)"); System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand(stringBuilder.ToString()); this.database.AddInParameter(sqlStringCommand, "ShortDesc", System.Data.DbType.String, info.ShortDesc); this.database.AddInParameter(sqlStringCommand, "ImageUrl", System.Data.DbType.String, info.ImageUrl); this.database.AddInParameter(sqlStringCommand, "DisplaySequence", System.Data.DbType.String, maxBannerSequence); this.database.AddInParameter(sqlStringCommand, "LocationType", System.Data.DbType.Int32, (int)info.LocationType); this.database.AddInParameter(sqlStringCommand, "Url", System.Data.DbType.String, info.Url); this.database.AddInParameter(sqlStringCommand, "Type", System.Data.DbType.Int32, info.Type); this.database.AddInParameter(sqlStringCommand, "IsDisable", System.Data.DbType.Boolean, info.IsDisable); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
protected void btnEditBanner_Click(object sender, System.EventArgs e) { TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id); tplCfgById.IsDisable = false; tplCfgById.ImageUrl = this.fmSrc.Value; tplCfgById.ShortDesc = this.txtBannerDesc.Text; tplCfgById.Client = 3; tplCfgById.LocationType = (LocationType)System.Enum.Parse(typeof(LocationType), this.ddlType.SelectedValue); tplCfgById.Url = this.locationUrl.Value; if (VShopHelper.UpdateTplCfg(tplCfgById)) { this.CloseWindow(); return; } this.ShowMsg("修改失败!", false); }
protected void btnAddBanner_Click(object sender, System.EventArgs e) { if (this.id == 0) { TplCfgInfo tplCfgInfo = new IconInfo(); tplCfgInfo.IsDisable = false; tplCfgInfo.ImageUrl = this.fmSrc.Value; tplCfgInfo.ShortDesc = this.txtBannerDesc.Text; tplCfgInfo.Client = 3; tplCfgInfo.LocationType = LocationType.Link; tplCfgInfo.Url = ""; if (string.IsNullOrWhiteSpace(tplCfgInfo.ImageUrl)) { this.ShowMsg("请上传图片!", false); return; } if (VShopHelper.SaveTplCfg(tplCfgInfo)) { this.CloseWindow(); return; } this.ShowMsg("添加错误!", false); } else { TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id); tplCfgById.IsDisable = false; tplCfgById.ImageUrl = this.fmSrc.Value; tplCfgById.ShortDesc = this.txtBannerDesc.Text; tplCfgById.Client = 3; tplCfgById.LocationType = LocationType.Link; tplCfgById.Url = ""; if (VShopHelper.UpdateTplCfg(tplCfgById)) { this.CloseWindow(); return; } this.ShowMsg("修改失败!", false); } }
public static bool UpdateTplCfg(TplCfgInfo info) { return(new BannerDao().UpdateTplCfg(info)); }
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; } }
public static bool SaveTplCfg(TplCfgInfo info) { return(new BannerDao().SaveTplCfg(info)); }
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]; }
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; } }
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; } }
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]; }
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 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.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(); } break; } default: return; } }
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; } }