Пример #1
0
        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");
                }
            }
        }
Пример #2
0
        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 = "·ñ";
            }


        }
Пример #3
0
        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");
                }
            }
        }
Пример #4
0
 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();
 }
Пример #5
0
 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();
 }
Пример #6
0
 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();
 }
Пример #7
0
        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();
        }
Пример #8
0
        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");
        }
Пример #9
0
        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");
        }
Пример #10
0
        //邦定根节点
        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);
                
            }

        }
Пример #11
0
        //邦定根节点
        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);
            }
        }
Пример #12
0
 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;
     //        }
     //    }
     //}
 }
Пример #13
0
        //��ʾ����
        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 = "��";
            }
        }
Пример #14
0
 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;
     //        }
     //    }
     //}
 }
Пример #15
0
        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 = "否";
            }
        }
Пример #16
0
 private void ShowCategory()
 {
     Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category();
     this.DataList1.DataSource = bll.GetAllList();
     this.DataList1.DataBind();
 }
Пример #17
0
 private void ShowCategory()
 {
     Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category();
     this.DataList1.DataSource = bll.GetAllList();
     this.DataList1.DataBind();
 }