using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Data; using System.Data.SqlClient; namespace Mtxfw.shop { public partial class Member_Product_Pics : Mtxfw.Utility.MemberBase { public Mtxfw.DAL.P_Category daoCategory = new Mtxfw.DAL.P_Category(); public Mtxfw.DAL.P_Product daoProduct = new Mtxfw.DAL.P_Product(); public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info(); public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(); public string strimg = "", stryanse = ""; protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { Data_Bind(); } Btn_Return.Click += delegate(object s, EventArgs ex) { Response.Redirect(Hidd_Url.Value); }; } protected void Data_Bind() { if (!String.IsNullOrEmpty(Request.QueryString["ID"])) { Hidd_ID.Value = Request.QueryString["ID"].ToString(); } if (!String.IsNullOrEmpty(Request.QueryString["ypage"])) { Hidd_Url.Value = "/Member_Product_List.aspx?page=" + Request.QueryString["ypage"].ToString(); } else { Hidd_Url.Value = "/Member_Product_List.aspx"; } if (!String.IsNullOrEmpty(Hidd_ID.Value)) { int UpdateID = Convert.ToInt32(Hidd_ID.Value); Mtxfw.Model.P_Product model = daoProduct.GetModel(UpdateID); if (model != null) { if (!String.IsNullOrEmpty(model.P_images)) { if (model.P_images.IndexOf("|") == -1) { Session["jiaoyouPhoto"] = model.P_images + "|"; } else { Session["jiaoyouPhoto"] = model.P_images; } } else { Session["jiaoyouPhoto"] = ""; } string stryanseoption = ""; if (model.P_yanse != "") { stryanse = model.P_yanse; string[] Ayanse = stryanse.Split('|'); for (int i = 0; i < Ayanse.Length; i++) { if (Ayanse[i] != "") { string[] stra = Ayanse[i].Split('#'); stryanseoption += ""; } } } if (Session["jiaoyouPhoto"] != null) { Y_Certificate.Value = Session["jiaoyouPhoto"].ToString(); string[] strjiaoyouPhotoA = Session["jiaoyouPhoto"].ToString().Split('|'); for (int i = 0; i < strjiaoyouPhotoA.Length; i++) { if (strjiaoyouPhotoA[i] != "") { string[] strPhoto = strjiaoyouPhotoA[i].Split(','); strimg += "
  • 删除"; if (i == 0) { strimg += " 已设为封面"; } else { strimg += " 设为封面"; } if (stryanseoption != "") { string stryanseoption2 = stryanseoption; if (strPhoto.Length == 2) { if (strPhoto[1] != "") { stryanseoption2 = stryanseoption.Replace("value='" + strPhoto[1] + "'", "value='" + strPhoto[1] + "' selected"); } } strimg += "
    "; } strimg += "
  • "; } } } } } } protected string cyanse(string stryanse, string selyanse) { string stryanseoption = ""; string[] Ayanse = stryanse.Split('|'); for (int j = 0; j < Ayanse.Length; j++) { if (Ayanse[j] != "") { string[] stra = Ayanse[j].Split('#'); if (selyanse == Ayanse[j]) { stryanseoption += ""; } else { stryanseoption += ""; } } } return stryanseoption; } } }