예제 #1
0
        public void BindData()
        {
            #region
            //if (!Context.User.Identity.IsAuthenticated)
            //{
            //    return;
            //}
            //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            //if (user.HasPermissionID(PermId_Modify))
            //{
            //    gridView.Columns[6].Visible = true;
            //}
            //if (user.HasPermissionID(PermId_Delete))
            //{
            //    gridView.Columns[7].Visible = true;
            //}
            #endregion

            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();
            if (txtKeyword.Text.Trim() != "")
            {
                #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称
                //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim());
            }
            ds = bll.GetList(strWhere.ToString());
            gridView.DataSource = ds;
            gridView.DataBind();
        }
예제 #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if ((CommodityFather_BLL.GetList("CommodityFatherName ='" + RadTextBox1.Text + "'").Tables[0].Rows.Count) > 0)
     {
         RadAjaxManager1.Alert("请输入不同名称!");
     }
     else
     {
         CommodityFather_Model.CommodityFatherName = RadTextBox1.Text;
         CommodityFather_Model.CommodityFatherID   = DateTime.Now.ToString("yyyyMMddhhmmss");
         CommodityFather_BLL.Add(CommodityFather_Model);
         ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
     }
 }
예제 #3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Maticsoft.Model.CommodityFather modelnew = CommodityFather_BLL.GetModel(Request.QueryString["ID"].ToString());//引用id所在行的数据
     if ((CommodityFather_BLL.GetList("CommodityFatherName ='" + RadTextBox1.Text + "'").Tables[0].Rows.Count) != 0 && RadTextBox1.Text != modelnew.CommodityFatherName)
     {
         RadAjaxManager1.Alert("请输入不同名称!");
     }
     else
     {
         CommodityFather_Model = CommodityFather_BLL.GetModel(Request.QueryString["ID"].ToString());
         CommodityFather_Model.CommodityFatherName = RadTextBox1.Text;
         CommodityFather_BLL.Update(CommodityFather_Model);
         ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CloseAndRebind();</script>");
     }
 }
예제 #4
0
        protected void RadDropDownList1_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadDropDownListFather.Items.Clear();
                RadDropDownListSon.Items.Clear();
                RadDropDownListFather.Items.Add(new DropDownListItem("请选择", ""));
                RadDropDownListSon.Items.Add(new DropDownListItem("请选择", ""));

                RadDropDownListFather.DataSource     = CommodityFather_BLL.GetList("");
                RadDropDownListFather.DataTextField  = "CommodityFatherName";
                RadDropDownListFather.DataValueField = "CommodityFatherID";
                RadDropDownListFather.DataBind();

                RadDropDownListFather.SelectedText = "请选择";
                RadDropDownListSon.SelectedText    = "请选择";
            }
        }
예제 #5
0
        protected void ddlGoodsFatherName_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddlGoodsFatherName.Items.Clear();
                ddlGoodsSonName.Items.Clear();
                ddlGoodsFatherName.Items.Add(new DropDownListItem("全部", ""));
                ddlGoodsSonName.Items.Add(new DropDownListItem("全部", ""));

                ddlGoodsFatherName.DataSource     = CommodityFather_BLL.GetList("");
                ddlGoodsFatherName.DataTextField  = "CommodityFatherName";
                ddlGoodsFatherName.DataValueField = "CommodityFatherID";
                ddlGoodsFatherName.DataBind();

                ddlGoodsFatherName.SelectedText = "请选择";
                ddlGoodsSonName.SelectedText    = "请选择";
            }
        }
예제 #6
0
        protected void DataLoad()
        {
            string sqlselect = " CommodityFatherName like '%" + RadTextBox1.Text + "%' ";

            RadGrid1.DataSource = CommodityFather_BLL.GetList(sqlselect);
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UsersInfo.UserID == "")
            {
                Response.Write("<script> alert('请先登录!'); window.location.href='/BackLogin.aspx' </script>");
                return;
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["ID"] != null)
                {
                    Session["GoodsID"] = Request.QueryString["ID"].ToString();
                    Maticsoft.Model.Commodity modelgoods = Commodity_Bll.GetModel(Session["GoodsID"].ToString());
                    if (modelgoods == null)
                    {
                        Response.Write("<script>window.location.href='Backspxxgl.aspx'</script>");
                    }
                    RadTextBox1.Text        = modelgoods.CommodityName;
                    RadTextBox2.Text        = modelgoods.CommodityType;
                    imgPic.ImageUrl         = modelgoods.CommodityImage;
                    RadNumericTextBox1.Text = modelgoods.MarketPrice.ToString();
                    RadNumericTextBox2.Text = modelgoods.VIPPrice.ToString();
                    RadNumericTextBox3.Text = modelgoods.BuyScore;
                    RadNumericTextBox4.Text = modelgoods.Stock.ToString();
                    if (modelgoods.Recommend == "推荐")
                    {
                        RadioButton1.Checked = true;
                    }
                    if (modelgoods.Recommend == "不推荐")
                    {
                        RadioButton4.Checked = true;
                    }
                    if (modelgoods.CommodityState == "上架")
                    {
                        RadioButton2.Checked = true;
                    }
                    if (modelgoods.CommodityState == "下架")
                    {
                        RadioButton3.Checked = true;
                    }
                    myEditor.Value = modelgoods.Introduce;

                    RadDropDownListFather.Items.Clear();
                    RadDropDownListSon.Items.Clear();
                    RadDropDownListFather.Items.Add(new DropDownListItem("请选择", ""));
                    RadDropDownListSon.Items.Add(new DropDownListItem("请选择", ""));

                    RadDropDownListFather.DataSource     = CommodityFather_BLL.GetList("");
                    RadDropDownListFather.DataTextField  = "CommodityFatherName";
                    RadDropDownListFather.DataValueField = "CommodityFatherID";
                    RadDropDownListFather.DataBind();
                    RadDropDownListFather.SelectedValue = modelgoods.CommodityFatherID;

                    RadDropDownListSon.DataSource     = CommoditySon_Bll.GetList(" CommodityFatherID ='" + RadDropDownListFather.SelectedValue + "'  ");
                    RadDropDownListSon.DataTextField  = "CommoditySonName";
                    RadDropDownListSon.DataValueField = "CommoditySonID";
                    RadDropDownListSon.DataBind();
                    RadDropDownListSon.SelectedValue = modelgoods.CommoditySonID;
                }

                else
                {
                    Response.Write("<script>window.location.href='Backspxxgl.aspx'</script>");
                }
            }
        }