protected void btnAdd_Click(object sender, EventArgs e) { string CategoryId = this.txtCategoryId.Text; string Name = this.txtName.Text; string Descn = this.txtDescn.Text; Maticsoft.Model.Category model = new Maticsoft.Model.Category(); model.CategoryId = CategoryId; model.Name = Name; model.Descn = Descn; Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); if (bll.Exists(CategoryId)) { lblMsg.Visible = true; lblMsg.Text = "±àºÅÒѾ´æÔÚ£¡"; } else { bll.Add(model); if (chkAddContinue.Checked) { Response.Redirect("Add.aspx"); } else { Response.Redirect("index.aspx"); } } }
private void ShowInfo(string Id) { Maticsoft.BLL.Products.Product bll = new Maticsoft.BLL.Products.Product(); Maticsoft.Model.Product model = bll.GetModel(Id); //Maticsoft.BLL.Products.Brand bllb = new Maticsoft.BLL.Products.Brand(); Maticsoft.BLL.Products.Category bllc = new Maticsoft.BLL.Products.Category(); this.lblProductId.Text = model.ProductId.ToString(); this.lblName.Text = model.Name; lblDescn.Text = model.Descn; lblPrice.Text = model.Price.ToString(); lblvipprice.Text = model.VipPrice.ToString(); lblImage.Text = model.Image; //lblBrandId.Text = bllb.GetName(model.BrandId); lblCategoryId.Text = bllc.GetName(model.CategoryId); if (model.Cheapness == 1) { Label1.Text = "ÊÇ"; } else { Label1.Text = "·ñ"; } }
protected void btnAdd_Click(object sender, EventArgs e) { string CategoryId = this.txtCategoryId.Text; string Name = this.txtName.Text; string Descn = this.txtDescn.Text; Maticsoft.Model.Category model = new Maticsoft.Model.Category(); model.CategoryId = CategoryId; model.Name = Name; model.Descn = Descn; Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); if (bll.Exists(CategoryId)) { lblMsg.Visible = true; lblMsg.Text = "±àºÅÒѾ´æÔÚ£¡"; } else { bll.Add(model); if (chkAddContinue.Checked) { Response.Redirect("Add.aspx"); } else { Response.Redirect("index.aspx"); } } }
private void BindCate() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DropCategory.DataSource = bll.GetAllList(); this.DropCategory.DataTextField = "Name"; DropCategory.DataValueField = "CategoryId"; DropCategory.DataBind(); }
private void BindCate() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DropCategory.DataSource = bll.GetAllList(); this.DropCategory.DataTextField = "Name"; DropCategory.DataValueField = "CategoryId"; DropCategory.DataBind(); }
private void BiudCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataSet ds = bll.GetAllList(); this.dropCategory.DataSource = ds.Tables[0].DefaultView; this.dropCategory.DataTextField = "Name"; this.dropCategory.DataValueField = "CategoryId"; this.dropCategory.DataBind(); }
private void BiudCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataSet ds = bll.GetAllList(); this.dropCategory.DataSource = ds.Tables[0].DefaultView; this.dropCategory.DataTextField = "Name"; this.dropCategory.DataValueField = "CategoryId"; this.dropCategory.DataBind(); }
protected void btnAdd_Click(object sender, EventArgs e) { string CategoryId = this.lblCategoryId.Text; string Name = this.txtName.Text; string Descn = this.txtDescn.Text; Maticsoft.Model.Category model = new Maticsoft.Model.Category(); model.CategoryId = CategoryId; model.Name = Name; model.Descn = Descn; Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); bll.Update(model); Response.Redirect("index.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { string CategoryId = this.lblCategoryId.Text; string Name = this.txtName.Text; string Descn = this.txtDescn.Text; Maticsoft.Model.Category model = new Maticsoft.Model.Category(); model.CategoryId = CategoryId; model.Name = Name; model.Descn = Descn; Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); bll.Update(model); Response.Redirect("index.aspx"); }
//邦定根节点 public void BindTreeView() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataTable dt = bll.GetAllList().Tables[0]; DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点 //菜单状态 bool menuExpand = true; TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string ClassID = r["CategoryId"].ToString(); string ClassDesc = "<b>" + r["Name"].ToString() + "</b>"; string ParentId = r["ParentId"].ToString(); //string Orders = r["Orders"].ToString(); //string IsShow = r["IsShow"].ToString(); //if (IsShow == "false") //{ // ClassDesc = ""; //} //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode(); rootnode.Text = ClassDesc; rootnode.NodeData = ClassID; //rootnode.NavigateUrl = url; //rootnode.Target = framename; rootnode.Expanded = menuExpand; //rootnode.ImageUrl = imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(ClassID);// or =location CreateNode(sonparentid, rootnode, dt); } }
//邦定根节点 public void BindTreeView() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataTable dt = bll.GetAllList().Tables[0]; DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点 //菜单状态 bool menuExpand = true; TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string ClassID = r["CategoryId"].ToString(); string ClassDesc = "<b>" + r["Name"].ToString() + "</b>"; string ParentId = r["ParentId"].ToString(); //string Orders = r["Orders"].ToString(); //string IsShow = r["IsShow"].ToString(); //if (IsShow == "false") //{ // ClassDesc = ""; //} //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode(); rootnode.Text = ClassDesc; rootnode.NodeData = ClassID; //rootnode.NavigateUrl = url; //rootnode.Target = framename; rootnode.Expanded = menuExpand; //rootnode.ImageUrl = imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(ClassID);// or =location CreateNode(sonparentid, rootnode, dt); } }
private void ShowInfo(string id) { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); Maticsoft.Model.Category model = bll.GetModel(id); this.lblCategoryId.Text = model.CategoryId.ToString(); txtName.Text = model.Name; txtDescn.Text = model.Descn; //if (model.ParentId == 0) //{ // dropParent.SelectedIndex = 0; //} //else //{ // for (int m = 0; m < this.dropParent.Items.Count; m++) // { // if (this.dropParent.Items[m].Value == model.ParentId.ToString()) // { // this.dropParent.Items[m].Selected = true; // } // } //} }
//��ʾ���� private void ShowNews(string productID) { Maticsoft.BLL.Products.Product bll = new Maticsoft.BLL.Products.Product(); Maticsoft.Model.Product model = bll.GetModelByCache(productID); this.lblProductId.Text = model.ProductId.ToString(); this.lblName.Text = model.Name; lblDescn.Text = model.Descn; lblPrice.Text = model.Price.ToString(); lblvipprice.Text = model.VipPrice.ToString(); Image1.ImageUrl = "ProductImages/" + model.Image; Maticsoft.BLL.Products.Category bllc = new Maticsoft.BLL.Products.Category(); lblCategoryId.Text = bllc.GetName(model.CategoryId); if (model.Cheapness == 1) { Label1.Text = "��"; } else { Label1.Text = "��"; } }
private void ShowInfo(string id) { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); Maticsoft.Model.Category model = bll.GetModel(id); this.lblCategoryId.Text = model.CategoryId.ToString(); txtName.Text = model.Name; txtDescn.Text = model.Descn; //if (model.ParentId == 0) //{ // dropParent.SelectedIndex = 0; //} //else //{ // for (int m = 0; m < this.dropParent.Items.Count; m++) // { // if (this.dropParent.Items[m].Value == model.ParentId.ToString()) // { // this.dropParent.Items[m].Selected = true; // } // } //} }
private void ShowNews(string productID)//显示新闻 { Maticsoft.BLL.Products.Product bll = new Maticsoft.BLL.Products.Product(); Maticsoft.Model.Product model = bll.GetModelByCache(productID); this.lblProductId.Text = model.ProductId.ToString(); this.lblName.Text = model.Name; lblDescn.Text = model.Descn; lblPrice.Text = model.Price.ToString(); lblvipprice.Text = model.VipPrice.ToString(); Image1.ImageUrl = "ProductImages/" + model.Image; Maticsoft.BLL.Products.Category bllc = new Maticsoft.BLL.Products.Category(); lblCategoryId.Text = bllc.GetName(model.CategoryId); if (model.Cheapness == 1) { Label1.Text = "是"; } else { Label1.Text = "否"; } }
private void ShowCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DataList1.DataSource = bll.GetAllList(); this.DataList1.DataBind(); }
private void ShowCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DataList1.DataSource = bll.GetAllList(); this.DataList1.DataBind(); }