private void bind() { Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product(); int index = int.Parse(Request.QueryString["ProID"].ToString()); Maticsoft.Model.Product promodel = probll.GetModel(index); Maticsoft.BLL.ProductType typebll = new Maticsoft.BLL.ProductType(); Maticsoft.Model.ProductType typemodel = typebll.GetModel(int.Parse(promodel.ProTypeID.ToString())); Maticsoft.BLL.ProductXing xinbll = new Maticsoft.BLL.ProductXing(); Maticsoft.Model.ProductXing xinmodel = xinbll.GetModel(int.Parse(promodel.ProXingID.ToString())); lblchutime.Text = Convert.ToDateTime(promodel.Prochutime.ToString()).ToString("yyyy-MM-dd"); lblstarttime.Text = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd"); lbltitle.Text = promodel.ProName; lbltype.Text = typemodel.ProTypeTitle; lblxinghao.Text = xinmodel.ProXingTitle; Image1.ImageUrl = promodel.ImageURL; txtcontent.Text = promodel.Procontent; if (promodel.Toujian == 1) { toujian.Visible = false; } else { toujian.Visible = true; } }
private void bind() { Maticsoft.BLL.FuWuTypeInfo fuwubll = new Maticsoft.BLL.FuWuTypeInfo(); DataSet fuwuds = fuwubll.GetAllList(); dtlstfuwu.DataSource = fuwuds; dtlstfuwu.DataBind(); Maticsoft.BLL.NewsTypeInfo newsbll = new Maticsoft.BLL.NewsTypeInfo(); DataSet newsds = newsbll.GetAllList(); dtlistNews.DataSource = newsds; dtlistNews.DataBind(); Maticsoft.BLL.NicheTypeInfo nichebll = new Maticsoft.BLL.NicheTypeInfo(); DataSet nicheds = nichebll.GetAllList(); drpNiche.DataSource = nicheds; drpNiche.DataBind(); Maticsoft.BLL.ProductType probll = new Maticsoft.BLL.ProductType(); DataSet prods = probll.GetAllList(); drpxing.DataSource = prods; drpxing.DataTextField = "ProTypeTitle"; drpxing.DataValueField = "ProTypeID"; drpxing.DataBind(); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtProTypeTitle.Text.Trim().Length == 0) { strErr += "ProTypeTitle不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int ProTypeID = int.Parse(this.lblProTypeID.Text); string ProTypeTitle = this.txtProTypeTitle.Text; Maticsoft.Model.ProductType model = new Maticsoft.Model.ProductType(); model.ProTypeID = ProTypeID; model.ProTypeTitle = ProTypeTitle; Maticsoft.BLL.ProductType bll = new Maticsoft.BLL.ProductType(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
private void ShowInfo(int ProTypeID) { Maticsoft.BLL.ProductType bll = new Maticsoft.BLL.ProductType(); Maticsoft.Model.ProductType model = bll.GetModel(ProTypeID); this.lblProTypeID.Text = model.ProTypeID.ToString(); this.txtProTypeTitle.Text = model.ProTypeTitle; }
private void bind() { Maticsoft.BLL.ProductType typebll = new Maticsoft.BLL.ProductType(); DataSet ds = typebll.GetAllList(); DrpProTypeTitle.DataSource = ds; DrpProTypeTitle.DataTextField = "ProTypeTitle"; DrpProTypeTitle.DataValueField = "ProTypeID"; DrpProTypeTitle.DataBind(); }
private void drpbind() { Maticsoft.BLL.ProductType typebll = new Maticsoft.BLL.ProductType(); DataSet typeds = typebll.GetAllList(); drpaddtypehao.DataSource = typeds; drpaddtypehao.DataTextField = "ProTypeTitle"; drpaddtypehao.DataValueField = "ProTypeID"; drpaddtypehao.DataBind(); }
protected void datapro_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Maticsoft.BLL.Product pronll = new Maticsoft.BLL.Product(); int proid = int.Parse(datapro.DataKeys[e.Item.ItemIndex].ToString()); Maticsoft.Model.Product promodel = pronll.GetModel(proid); Maticsoft.BLL.ProductType typebll = new Maticsoft.BLL.ProductType(); int typeid = int.Parse(promodel.ProTypeID.ToString()); Maticsoft.Model.ProductType typemodel = typebll.GetModel(typeid); ((Label)e.Item.FindControl("lbltype")).Text = typemodel.ProTypeTitle; } }
protected void btntype_Click1(object sender, EventArgs e) { Maticsoft.BLL.ProductType typebll = new Maticsoft.BLL.ProductType(); Maticsoft.Model.ProductType typemodel = new Maticsoft.Model.ProductType(); if (txtaddtype.Text.Trim() == "") { lblxinghao.Text = "请填写产品类型"; return; } typemodel.ProTypeTitle = txtaddtype.Text.Trim(); lblxinghao.Text = ""; typebll.Add(typemodel); txtaddtype.Text = string.Empty; lblxinghao.Text = "产品类型提交成功"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["ProID"] != null) { if (Request.QueryString["ProID"].ToString() != "") { int proid = int.Parse(Request.QueryString["ProID"].ToString()); Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product(); Maticsoft.Model.Product promodel = probll.GetModel(proid); Maticsoft.BLL.ProductType typebll = new Maticsoft.BLL.ProductType(); Maticsoft.Model.ProductType typemodel = typebll.GetModel(int.Parse(promodel.ProTypeID.ToString())); Maticsoft.BLL.ProductXing xingbll = new Maticsoft.BLL.ProductXing(); Maticsoft.Model.ProductXing xingmodel = xingbll.GetModel(int.Parse(promodel.ProXingID.ToString())); lblFatime.Text = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd"); int hitnum = 0; if (promodel.HitNum != null) { promodel.HitNum = promodel.HitNum + 1; probll.Update(promodel); lblHitNum.Text = promodel.HitNum.ToString(); } else { promodel.HitNum = 1; probll.Update(promodel); lblHitNum.Text = promodel.HitNum.ToString(); } lblProcontent.Text = promodel.Procontent; lblProName.Text = promodel.ProName; lblProName1.Text = promodel.ProName; lblProTypeTitle.Text = typemodel.ProTypeTitle; lblProXingTitle.Text = xingmodel.ProXingTitle; ImgImageURL.ImageUrl = promodel.ImageURL; } else { Response.Redirect("product.aspx"); } } else { Response.Redirect("product.aspx"); } } }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtProTypeTitle.Text.Trim().Length == 0) { strErr += "ProTypeTitle不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string ProTypeTitle = this.txtProTypeTitle.Text; Maticsoft.Model.ProductType model = new Maticsoft.Model.ProductType(); model.ProTypeTitle = ProTypeTitle; Maticsoft.BLL.ProductType bll = new Maticsoft.BLL.ProductType(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }