using System; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.IO; namespace Mtxfw.VipSite { public partial class Admin_Member_Products_add1 : Mtxfw.Utility.MemberBase { public Mtxfw.DAL.P_Guige daoGuige = new Mtxfw.DAL.P_Guige(); public Mtxfw.DAL.P_Category daoCategory = new Mtxfw.DAL.P_Category(); public Mtxfw.DAL.P_Product daoProduct = new Mtxfw.DAL.P_Product(); Mtxfw.DAL.freighttemplate daoftem = new Mtxfw.DAL.freighttemplate(); public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(""); public String strTitle = "", strBody = "", ProductLB1 = "", ProductLB2 = "", ProductLB3 = "", guige = ""; public string strimg = "", selyanse = "", strdisplay = "", strInventory = "库存"; public int gtype = 0; protected override void OnLoad(EventArgs e) { base.OnLoad(e); string hostname = Request.Url.Host; if (Session["IFPassword"] == null) { Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_Products1.aspx"); } if (IFStores != 1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } if (MemberJS.IndexOf("热卖推荐商品列表") == -1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } string stryanseoption = ""; if (!IsPostBack) { if (Request.UrlReferrer != null) { Hidd_Url.Value = Request.UrlReferrer.ToString(); } else { Hidd_Url.Value = "Admin_Member_Products1.aspx"; } yunfei.Attributes.Add("onchange", "onyunfei()"); DataSet ds = daoftem.GetList("id>0"); if (ds.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow Dr in ds.Tables[0].Rows) { int id = int.Parse(Dr["id"].ToString()); string tname = Dr["tname"].ToString(); yunfei.Items.Add(new ListItem(tname, id.ToString())); } } ds.Clear(); } if (Request.QueryString["action"] == "add") { strTitle = "添加热卖推荐商品"; if (!IsPostBack) { Btn_Update.Visible = false; } if (Session["P_CATEGORY1"] != null) { ProductLB1 = Session["P_CATEGORY1"].ToString(); } if (Session["P_CATEGORY2"] != null) { ProductLB2 = Session["P_CATEGORY2"].ToString(); } if (Session["P_CATEGORY3"] != null) { ProductLB3 = Session["P_CATEGORY3"].ToString(); } if (!IsPostBack) { Session["jiaoyouPhoto"] = ""; } DataSet ds = daoGuige.GetList("ttype=0 And G_PID=0"); if (ds.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow Dr in ds.Tables[0].Rows) { int G_ID = int.Parse(Dr["G_ID"].ToString()); string G_Name = Dr["G_Name"].ToString(); Double G_JG = Double.Parse(Dr["G_JG"].ToString()); Double G_JG0 = Double.Parse(Dr["G_JG0"].ToString()); Double G_JG1 = Double.Parse(Dr["G_JG1"].ToString()); Double G_JG2 = Double.Parse(Dr["G_JG2"].ToString()); Double G_JG3 = Double.Parse(Dr["G_JG3"].ToString()); Double G_JG4 = Double.Parse(Dr["G_JG4"].ToString()); Double G_JG5 = Double.Parse(Dr["G_JG5"].ToString()); Double G_JG6 = Double.Parse(Dr["G_JG6"].ToString()); Double G_JF = Double.Parse(Dr["G_JF"].ToString()); Double G_ZL = Double.Parse(Dr["G_ZL"].ToString()); int G_KC = int.Parse(Dr["G_KC"].ToString()); string colors = Dr["G_Color"].ToString(); string tps = Dr["G_Images"].ToString(); guige += ""; } } ds.Clear(); if (!IsPostBack) { Text_bianhao.Text = "A" + Mtxfw.Utility.Common.CreatenTimestamp(DateTime.Now); } } else { strTitle = "修改热卖推荐商品"; if (!IsPostBack) { Btn_Insert.Visible = false; } if (!IsPostBack) { hidpid.Value = Request.QueryString["ID"].ToString(); } Mtxfw.Model.P_Product model = daoProduct.GetModel(int.Parse(hidpid.Value)); if (model != null) { if (model.P_ppproduct) { strdisplay = " style=\" display:none;\""; strInventory = "今日赠送份数"; } if (!IsPostBack) { Text_P_NAME.Text = model.P_NAME; hidden_video.Text = model.P_NAME2; hiddenyanse.Value = model.P_yanse; hiddenphotos.Value = model.P_images; P_Market_P.Text = model.P_Market_P.ToString(); P_VIP_P.Text = model.P_VIP_P.ToString(); P_VIP_P1.Text = model.P_VIP_P1.ToString(); P_VIP_P2.Text = model.P_VIP_P2.ToString(); P_CB_P.Text = model.P_CB_P.ToString(); P_YH_P.Text = model.P_YH_P.ToString(); P_M_Web.Text = model.P_M_Web; P_JiangLi.Text = model.P_JiangLi.ToString(); P_JiangLi2.Text = model.P_JiangLi2.ToString(); //P_JiangLi3.Text = model.P_JiangLi3.ToString(); txtContent.Text = model.P_DESCRIPTION1; txtContent2.Text = model.P_DESCRIPTION2; Text_bianhao.Text = model.P_bianhao; if (model.P_peitype == 1) { kdpeitype.Checked = true; } else { kdpeitype.Checked = false; } if (model.P_peitype0 == 1) { ztpeitype.Checked = true; } else { ztpeitype.Checked = false; } for (int i = 0; i < yunfei.Items.Count; i++) { if (model.P_M_P.ToString() == yunfei.Items[i].Value) { yunfei.Items[i].Selected = true; } else { yunfei.Items[i].Selected = false; } } } DataSet ds = daoGuige.GetList("ttype=0 And G_PID=" + model.P_ID); if (ds.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow Dr in ds.Tables[0].Rows) { int G_ID = int.Parse(Dr["G_ID"].ToString()); string G_Name = Dr["G_Name"].ToString(); Double G_JG = Double.Parse(Dr["G_JG"].ToString()); Double G_JG0 = Double.Parse(Dr["G_JG0"].ToString()); Double G_JG1 = Double.Parse(Dr["G_JG1"].ToString()); Double G_JG2 = Double.Parse(Dr["G_JG2"].ToString()); Double G_JG3 = Double.Parse(Dr["G_JG3"].ToString()); Double G_JG4 = Double.Parse(Dr["G_JG4"].ToString()); Double G_JG5 = Double.Parse(Dr["G_JG5"].ToString()); Double G_JG6 = Double.Parse(Dr["G_JG6"].ToString()); Double G_JF = Double.Parse(Dr["G_JF"].ToString()); Double G_ZL = Double.Parse(Dr["G_ZL"].ToString()); int G_KC = int.Parse(Dr["G_KC"].ToString()); string colors = Dr["G_Color"].ToString(); string tps = Dr["G_Images"].ToString(); //guige += "