protected void Button1_Click(object sender, EventArgs e) { if (this.Page.IsValid) { M_Trademark CData = new M_Trademark(); CData.id = DataConverter.CLng(this.ID_H.Value); CData.Trname = this.Trname.Text; CData.Producer = DataConverter.CLng(this.Producer.Text); CData.TrClass = this.TrClass.Text; CData.TrPhoto = this.txt_TrPhoto.Text; CData.TrContent = this.TrContent.Value; CData.Addtime = DateTime.Now; if (this.Isbest.Checked == true) { CData.Isbest = 1; } else { CData.Isbest = 0; } if (this.uptype.Value == "update") { bll.Update(CData); Response.Write("<script language=javascript>alert('修改成功!');location.href='ShopScutcheon.aspx';</script>"); } else { CData.Istop = 0; CData.Isuse = 1; bll.Add(CData); Response.Write("<script language=javascript>alert('添加成功!');location.href='ShopScutcheon.aspx';</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { B_Admin badmin = new B_Admin(); if (!this.Page.IsPostBack) { Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='ProductManage.aspx'>商城管理</a></li> <li><a href='DeliverType.aspx'>商城设置</a></li><li><a href='Trademark.aspx'>添加品牌</a></li>"); string where = " order by id desc"; DataTable rslist = mll.GetManufacturersAll(where); DataTable newprolist = rslist.DefaultView.ToTable(false, "id", "Producername"); Hashtable ar = new Hashtable(); foreach (DataRow dr in newprolist.Rows) { ar.Add(dr[0].ToString(), dr[1].ToString()); } this.Producer.DataSource = ar; this.Producer.DataValueField = "key"; this.Producer.DataTextField = "value"; this.Producer.DataBind(); if (Request.QueryString["menu"] == "edit") { this.uptype.Value = "update"; int id = Convert.ToInt32(Request.QueryString["id"]); M_Trademark list = bll.GetTrademarkByid(id); this.ID_H.Value = list.id.ToString(); this.Trname.Text = list.Trname.ToString(); this.Producer.Text = list.Producer.ToString(); this.TrClass.Text = list.TrClass.ToString(); this.TrPhoto.Text = list.TrPhoto.ToString(); this.TrContent.Value = list.TrContent.ToString(); } } }
public string showstop(string id) { int tempid; string returnstr = ""; tempid = DataConverter.CLng(id); M_Trademark temp = bll.GetTrademarkByid(tempid); int isstop = temp.Isuse; if (isstop == 1) { returnstr = "<a href=?menu=stop&id=" + id + ">禁用</a>"; } else if (isstop != 1) { returnstr = "<a href=?menu=qiyong&id=" + id + ">启用</a>"; } return(returnstr); }
public string showjian2(string id) { int tempid; string returnstr = ""; tempid = DataConverter.CLng(id); M_Trademark temp = bll.GetTrademarkByid(tempid); int isjian = temp.Isbest; if (isjian == 1) { returnstr = "<font color=blue>荐</font>"; } else if (isjian != 1) { returnstr = " "; } return(returnstr); }
public string showjian(string id) { int tempid; string returnstr = ""; tempid = DataConverter.CLng(id); M_Trademark temp = bll.GetTrademarkByid(tempid); int isjian = temp.Isbest; if (isjian == 1) { returnstr = "<a href=?menu=nojian&id=" + id + ">解荐</a>"; } else if (isjian != 1) { returnstr = "<a href=?menu=tuijian&id=" + id + ">推荐</a>"; } return(returnstr); }
public string showtop2(string id) { int tempid; string returnstr = ""; tempid = DataConverter.CLng(id); M_Trademark temps = bll.GetTrademarkByid(tempid); int Istop = temps.Istop; if (Istop == 1) { returnstr = "<font color=blue>固</font>"; } else if (Istop != 1) { returnstr = " "; } return(returnstr); }
public string showtop(string id) { int tempid; string returnstr = ""; tempid = DataConverter.CLng(id); M_Trademark temp = bll.GetTrademarkByid(tempid); int istop = temp.Istop; if (istop == 1) { returnstr = "<a href=?menu=notop&id=" + id + ">解固</a>"; } else if (istop != 1) { returnstr = "<a href=?menu=istop&id=" + id + ">固顶</a>"; } return(returnstr); }
public string showstop2(string id) { int tempid; string returnstr = ""; tempid = DataConverter.CLng(id); M_Trademark temp = bll.GetTrademarkByid(tempid); int isstop = temp.Isuse; if (isstop == 1) { returnstr = "<font color=blue>√</font>"; } else if (isstop != 1) { returnstr = "<font color=red>×</font>"; } return(returnstr); }
public int insert(M_Trademark model) { return(DBCenter.Insert(model)); }
public bool UpdateByID(M_Trademark model) { return(DBCenter.UpdateByID(model, model.id)); }
public bool Add(M_Trademark model) { return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0); }
public bool UpdateByID(M_Trademark model) { return(Sql.UpdateByIDs(TbName, PK, model.id.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters(model))); }