/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("ID"); themeActivity = ThemeActivityBLL.Read(id); styleArray = themeActivity.Style.Split('|'); if (themeActivity.ProductGroup != string.Empty) { string productIDList = string.Empty; productGroupArray = themeActivity.ProductGroup.Split(new char[] { '#' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < productGroupArray.Length; i++) { if (productGroupArray[i].Split('|')[4] != string.Empty) { if (productIDList == string.Empty) { productIDList = productGroupArray[i].Split('|')[4]; } else { productIDList += "," + productGroupArray[i].Split('|')[4]; } } } if (productIDList != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductId = productIDList; productList = ProductBLL.SearchList(productSearch); } } Title = themeActivity.Name; }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("ID"); themeActivity = ThemeActivityBLL.ReadThemeActivity(id); styleArray = themeActivity.Style.Split('|'); if (themeActivity.ProductGroup != string.Empty) { string productIDList = string.Empty; productGroupArray = themeActivity.ProductGroup.Split('#'); for (int i = 0; i < productGroupArray.Length; i++) { if (productGroupArray[i].Split('|')[2] != string.Empty) { if (productIDList == string.Empty) { productIDList = productGroupArray[i].Split('|')[2]; } else { productIDList += "," + productGroupArray[i].Split('|')[2]; } } } if (productIDList != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductID = productIDList; productList = ProductBLL.SearchProductList(productSearch); memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(productIDList, base.GradeID); } } Title = themeActivity.Name; }
protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("id"); theme = ThemeActivityBLL.Read(id); styleArray = theme.Style.Split('|'); if (!string.IsNullOrEmpty(theme.ProductGroup)) { productGroupArray = theme.ProductGroup.Split('#'); foreach (var group in productGroupArray) { var productIds = group.Split('|')[2]; if (!string.IsNullOrEmpty(productIds)) { int length = productIds.Split(',').Length; int count = 0; var products = ProductBLL.SearchList(1, length, new ProductSearchInfo { InProductId = productIds }, ref count); dynamic dy = new System.Dynamic.ExpandoObject(); dy.index = Array.IndexOf(productGroupArray, group); dy.list = products; productGroup.Add(dy); } } } Title = theme.Name; }
protected override void PageLoad() { base.PageLoad(); int queryString = RequestHelper.GetQueryString <int>("ID"); this.themeActivity = ThemeActivityBLL.ReadThemeActivity(queryString); this.styleArray = this.themeActivity.Style.Split(new char[] { '|' }); if (this.themeActivity.ProductGroup != string.Empty) { string strProductID = string.Empty; this.productGroupArray = this.themeActivity.ProductGroup.Split(new char[] { '#' }); for (int i = 0; i < this.productGroupArray.Length; i++) { if (this.productGroupArray[i].Split(new char[] { '|' })[2] != string.Empty) { if (strProductID == string.Empty) { strProductID = this.productGroupArray[i].Split(new char[] { '|' })[2]; } else { strProductID = strProductID + "," + this.productGroupArray[i].Split(new char[] { '|' })[2]; } } } if (strProductID != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductID = strProductID; this.productList = ProductBLL.SearchProductList(productSearch); this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID); } } base.Title = this.themeActivity.Name; }
public void Update(ThemeActivityInfo entity) { using (var conn = new SqlConnection(connectString)) { string sql = @"UPDATE ThemeActivity SET Name = @Name, Photo = @Photo, [Description] = @Description, Css = @Css,CssMobile=@CssMobile, ProductGroup = @ProductGroup, Style = @Style where Id=@Id"; conn.Execute(sql, entity); } }
public int Add(ThemeActivityInfo entity) { using (var conn = new SqlConnection(connectString)) { string sql = @"INSERT INTO ThemeActivity( Name,Photo,[Description],Css,CssMobile,ProductGroup,Style) VALUES(@Name,@Photo,@Description,@Css,@CssMobile,@ProductGroup,@Style); select SCOPE_IDENTITY()"; return(conn.Query <int>(sql, entity).Single()); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { int queryString = RequestHelper.GetQueryString <int>("ID"); if (queryString != -2147483648) { base.CheckAdminPower("ReadThemeActivity", PowerCheckType.Single); this.strThemeActivityID = queryString.ToString(); ThemeActivityInfo info = ThemeActivityBLL.ReadThemeActivity(queryString); this.Name.Text = info.Name; this.Photo.Text = info.Photo; this.Description.Text = info.Description; this.Css.Text = info.Css; if (info.ProductGroup != string.Empty) { string str = string.Empty; int length = info.ProductGroup.Split(new char[] { '#' }).Length; this.photoArray = new string[length]; this.linkArray = new string[length]; this.idArray = new string[length]; for (int i = 0; i < length; i++) { string[] strArray = info.ProductGroup.Split(new char[] { '#' })[i].Split(new char[] { '|' }); this.photoArray[i] = strArray[0]; this.linkArray[i] = strArray[1]; this.idArray[i] = strArray[2]; if (strArray[2] != string.Empty) { str = str + strArray[2] + ","; } } if (str != string.Empty) { str = str.Substring(0, str.Length - 1); } ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductID = str; this.productList = ProductBLL.SearchProductList(productSearch); } this.TopImage.Text = info.Style.Split(new char[] { '|' })[0]; this.BackgroundImage.Text = info.Style.Split(new char[] { '|' })[1]; this.BottomImage.Text = info.Style.Split(new char[] { '|' })[2]; this.ProductColor.Text = info.Style.Split(new char[] { '|' })[3]; this.ProductColor.Attributes.Add("style", "color:" + info.Style.Split(new char[] { '|' })[3] + ";"); this.ProductSize.Text = info.Style.Split(new char[] { '|' })[4]; this.PriceColor.Text = info.Style.Split(new char[] { '|' })[5]; this.PriceColor.Attributes.Add("style", "color:" + info.Style.Split(new char[] { '|' })[5] + ";"); this.PriceSize.Text = info.Style.Split(new char[] { '|' })[6]; this.OtherColor.Text = info.Style.Split(new char[] { '|' })[7]; this.OtherColor.Attributes.Add("style", "color:" + info.Style.Split(new char[] { '|' })[7] + ";"); this.OtherSize.Text = info.Style.Split(new char[] { '|' })[8]; } } }
public int AddThemeActivity(ThemeActivityInfo themeActivity) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@name", SqlDbType.NVarChar), new SqlParameter("@photo", SqlDbType.NVarChar), new SqlParameter("@description", SqlDbType.NText), new SqlParameter("@css", SqlDbType.NText), new SqlParameter("@productGroup", SqlDbType.NVarChar), new SqlParameter("@style", SqlDbType.NVarChar) }; pt[0].Value = themeActivity.Name; pt[1].Value = themeActivity.Photo; pt[2].Value = themeActivity.Description; pt[3].Value = themeActivity.Css; pt[4].Value = themeActivity.ProductGroup; pt[5].Value = themeActivity.Style; return(Convert.ToInt32(ShopMssqlHelper.ExecuteScalar(ShopMssqlHelper.TablePrefix + "AddThemeActivity", pt))); }
public void UpdateThemeActivity(ThemeActivityInfo themeActivity) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int), new SqlParameter("@name", SqlDbType.NVarChar), new SqlParameter("@photo", SqlDbType.NVarChar), new SqlParameter("@description", SqlDbType.NText), new SqlParameter("@css", SqlDbType.NText), new SqlParameter("@productGroup", SqlDbType.NVarChar), new SqlParameter("@style", SqlDbType.NVarChar) }; pt[0].Value = themeActivity.ID; pt[1].Value = themeActivity.Name; pt[2].Value = themeActivity.Photo; pt[3].Value = themeActivity.Description; pt[4].Value = themeActivity.Css; pt[5].Value = themeActivity.ProductGroup; pt[6].Value = themeActivity.Style; ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "UpdateThemeActivity", pt); }
public void PrepareThemeActivityModel(SqlDataReader dr, List <ThemeActivityInfo> themeActivityList) { while (dr.Read()) { ThemeActivityInfo item = new ThemeActivityInfo(); item.ID = dr.GetInt32(0); item.Name = dr[1].ToString(); item.Photo = dr[2].ToString(); item.Description = dr[3].ToString(); item.Css = dr[4].ToString(); item.ProductGroup = dr[5].ToString(); item.Style = dr[6].ToString(); themeActivityList.Add(item); } }
protected void SubmitButton_Click(object sender, EventArgs e) { ThemeActivityInfo themeActivity = new ThemeActivityInfo(); themeActivity.ID = RequestHelper.GetQueryString <int>("ID"); themeActivity.Name = this.Name.Text; themeActivity.Photo = this.Photo.Text; themeActivity.Description = this.Description.Text; themeActivity.Css = this.Css.Text; int form = RequestHelper.GetForm <int>("ProductGroupCount"); string str = string.Empty; for (int i = 0; i < form; i++) { if (RequestHelper.GetForm <string>("ProductGroupValue" + i) != string.Empty) { str = str + RequestHelper.GetForm <string>("ProductGroupValue" + i) + "#"; } } if (str.EndsWith("#")) { str = str.Substring(0, str.Length - 1); } themeActivity.ProductGroup = str; themeActivity.Style = string.Concat(new object[] { this.TopImage.Text, '|', this.BackgroundImage.Text, '|', this.BottomImage.Text, '|', this.ProductColor.Text, '|', this.ProductSize.Text, '|', this.PriceColor.Text, '|', this.PriceSize.Text, '|', this.OtherColor.Text, '|', this.OtherSize.Text }); string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (themeActivity.ID == -2147483648) { base.CheckAdminPower("AddThemeActivity", PowerCheckType.Single); int id = ThemeActivityBLL.AddThemeActivity(themeActivity); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("ThemeActivity"), id); } else { base.CheckAdminPower("UpdateThemeActivity", PowerCheckType.Single); ThemeActivityBLL.UpdateThemeActivity(themeActivity); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("ThemeActivity"), themeActivity.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl); }
protected void SubmitButton_Click(object sender, EventArgs e) { ThemeActivityInfo themeActivity = new ThemeActivityInfo(); themeActivity.Id = RequestHelper.GetQueryString <int>("id"); themeActivity.Name = Name.Text; themeActivity.Photo = Photo.Text; themeActivity.Description = Description.Text; themeActivity.Css = Css.Text; themeActivity.CssMobile = CssMobile.Text; int count = RequestHelper.GetForm <int>("ProductGroupCount"); string productGroup = string.Empty; for (int i = 0; i < count; i++) { if (RequestHelper.GetForm <string>("ProductGroupValue" + i) != string.Empty) { productGroup += RequestHelper.GetForm <string>("ProductGroupValue" + i) + "#"; } } if (productGroup.EndsWith("#")) { productGroup = productGroup.Substring(0, productGroup.Length - 1); } themeActivity.ProductGroup = productGroup; themeActivity.Style = TopImage.Text + '|' + BackgroundImage.Text + '|' + BottomImage.Text + '|' + ProductColor.Text + '|' + ProductSize.Text + '|' + PriceColor.Text + '|' + PriceSize.Text + '|' + OtherColor.Text + '|' + OtherSize.Text + '|' + TopImageMobile.Text + '|' + BackgroundImageMobile.Text + '|' + BottomImageMobile.Text; string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (themeActivity.Id == int.MinValue) { CheckAdminPower("AddThemeActivity", PowerCheckType.Single); int id = ThemeActivityBLL.Add(themeActivity); AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("ThemeActivity"), id); } else { CheckAdminPower("UpdateThemeActivity", PowerCheckType.Single); ThemeActivityBLL.Update(themeActivity); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("ThemeActivity"), themeActivity.Id); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl); }
public ThemeActivityInfo ReadThemeActivity(int id) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int) }; pt[0].Value = id; ThemeActivityInfo info = new ThemeActivityInfo(); using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadThemeActivity", pt)) { if (reader.Read()) { info.ID = reader.GetInt32(0); info.Name = reader[1].ToString(); info.Photo = reader[2].ToString(); info.Description = reader[3].ToString(); info.Css = reader[4].ToString(); info.ProductGroup = reader[5].ToString(); info.Style = reader[6].ToString(); } } return(info); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int themeActivityId = RequestHelper.GetQueryString <int>("id"); if (themeActivityId != int.MinValue) { CheckAdminPower("ReadThemeActivity", PowerCheckType.Single); strThemeActivityId = themeActivityId.ToString(); ThemeActivityInfo themeActivity = ThemeActivityBLL.Read(themeActivityId); Name.Text = themeActivity.Name; Photo.Text = themeActivity.Photo; Description.Text = themeActivity.Description; Css.Text = themeActivity.Css; CssMobile.Text = themeActivity.CssMobile; if (themeActivity.ProductGroup != string.Empty) { string idList = string.Empty; int count = themeActivity.ProductGroup.Split('#').Length; photoArray = new string[count]; linkArray = new string[count]; photoMobileArray = new string[count]; linkMobileArray = new string[count]; idArray = new string[count]; for (int i = 0; i < count; i++) { string[] productGroupArray = themeActivity.ProductGroup.Split('#')[i].Split('|'); photoArray[i] = productGroupArray[0]; linkArray[i] = productGroupArray[1]; photoMobileArray[i] = productGroupArray[2]; linkMobileArray[i] = productGroupArray[3]; idArray[i] = productGroupArray[4]; if (productGroupArray[4] != string.Empty) { idList += productGroupArray[4] + ","; } } if (idList != string.Empty) { idList = idList.Substring(0, idList.Length - 1); } ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductId = idList; productList = ProductBLL.SearchList(1, idList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length, productSearch, ref count); } string[] themeStyleArr = themeActivity.Style.Split('|'); TopImage.Text = themeStyleArr[0]; BackgroundImage.Text = themeStyleArr[1]; BottomImage.Text = themeStyleArr[2]; ProductColor.Text = themeStyleArr[3]; ProductColor.Attributes.Add("style", "color:" + themeStyleArr[3] + ";"); ProductSize.Text = themeStyleArr[4]; PriceColor.Text = themeStyleArr[5]; PriceColor.Attributes.Add("style", "color:" + themeStyleArr[5] + ";"); PriceSize.Text = themeStyleArr[6]; OtherColor.Text = themeStyleArr[7]; OtherColor.Attributes.Add("style", "color:" + themeStyleArr[7] + ";"); OtherSize.Text = themeStyleArr[8]; TopImageMobile.Text = themeStyleArr[9]; BackgroundImageMobile.Text = themeStyleArr[10]; BottomImageMobile.Text = themeStyleArr[11]; } } }
public static void UpdateThemeActivity(ThemeActivityInfo themeActivity) { dal.UpdateThemeActivity(themeActivity); UploadBLL.UpdateUpload(TableID, 0, themeActivity.ID, Cookies.Admin.GetRandomNumber(false)); }
public static int Add(ThemeActivityInfo entity) { return(dal.Add(entity)); }
public static void Update(ThemeActivityInfo entity) { dal.Update(entity); }
public static int AddThemeActivity(ThemeActivityInfo themeActivity) { themeActivity.ID = dal.AddThemeActivity(themeActivity); UploadBLL.UpdateUpload(TableID, 0, themeActivity.ID, Cookies.Admin.GetRandomNumber(false)); return(themeActivity.ID); }