Exemple #1
0
        protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            //#warning 代码生成警告:请检查确认真实主键的名称和类型是否正确
            int ID = (int)gridView.DataKeys[e.RowIndex].Value;

            BLL.sysItem syBll = new BLL.sysItem();
            syBll.DeleteByCatId(ID);
            bll.Delete(ID);
            BindData();
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["act"] == null)
                {

                    BLL.sysItem catBll = new BLL.sysItem();
                    ddrCat.DataTextField = "itemName";
                    ddrCat.DataValueField = "siId";
                    ddrCat.DataSource = ClassHelper.GetSystemItem(StatusHelpercs.Default_Item_StoreType);
                    ddrCat.DataBind();
                    ddrCat.Items.Insert(0, new ListItem("请选择", "0"));

                    provinceHtml = ClassHelper.getProvinceOptions();

                    if (Request.QueryString["id"] == null)
                    {
                        MessageBox.ShowAndRedirect(this, "缺少参数", "/admin/users/userlist.aspx");
                        return;
                    }
                    else
                    {
                        string id = Request.QueryString["id"].ToString();
                        Model.store model = bll.GetModel(int.Parse(id));
                        txtStoreName.Text = model.storeName;
                        ddrCat.SelectedValue = model.storeType.ToString();
                        txtAddress.Text = model.address;
                        txtSale.Text = model.sale;
                        imgLog.ImageUrl = model.logo;
                        txtCashPrice.Text = model.cashPrice.ToString();
                        txtContact.Text = model.contact;
                        txtQQ.Text = model.qq;
                        txtTel.Text = model.tel;
                        txtContent.Text = model.remark;

                        provinceString = model.addressNo.Substring(0, 2) + "0000";
                        cityString = model.addressNo.Substring(0, 4) + "00";
                        distinctString = model.addressNo;
                    }
                }
            }

            if (RequsetAjax("showCity"))
            {
                //
                try
                {
                    string code = Request.Form["code"].ToString();
                    string result = ClassHelper.getCityOptions(code);

                    Response.Write("{\"status\":1,\"result\":\"" + result + "\"}");
                }
                catch { Response.Write("{\"status\":0,\"msg\":\"失败!\"}"); }
                Response.End();
            }
            if (RequsetAjax("showDistinct"))
            {
                //
                try
                {
                    string code = Request.Form["code"].ToString();
                    string result = ClassHelper.getDistinceOptions(code);

                    Response.Write("{\"status\":1,\"result\":\"" + result + "\"}");
                }
                catch { Response.Write("{\"status\":0,\"msg\":\"失败!\"}"); }
                Response.End();
            }
        }
Exemple #3
0
 /// <summary>
 /// 取码表
 /// </summary>
 /// <param name="innerName">内部名</param>
 /// <returns></returns>
 public static DataSet GetSystemItem(string innerName)
 {
     BLL.sysItem sBll = new BLL.sysItem();
     return(sBll.GetList("sicId in (select sicId from [sysItemCategory] where innerName='" + innerName + "')"));
 }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["act"] == null)
                {
                    if (Request.QueryString["userId"] == null)
                    {
                        MessageBox.ShowAndRedirect(this, "缺少参数", "/admin/users/userlist.aspx");
                        return;
                    }
                    else
                    {
                        string userId = Request.QueryString["userId"].ToString();
                        if (bll.GetList("userId=" + userId).Tables[0].Rows.Count > 0)
                        {
                            MessageBox.ShowAndRedirect(this, "此用户已经开通过店铺!", "/admin/users/userlist.aspx");
                            return;
                        }
                        hm.BLL.users ubll = new hm.BLL.users();
                        if (ubll.GetList("userId=" + userId).Tables[0].Rows.Count == 0)
                        {
                            MessageBox.ShowAndRedirect(this, "无此用户!", "/admin/users/userlist.aspx");
                            return;
                        }
                    }
                    BLL.sysItem catBll = new BLL.sysItem();
                    ddrCat.DataTextField = "itemName";
                    ddrCat.DataValueField = "siId";
                    ddrCat.DataSource = ClassHelper.GetSystemItem(StatusHelpercs.Default_Item_StoreType);
                    ddrCat.DataBind();
                    ddrCat.Items.Insert(0, new ListItem("请选择", "0"));

                    provinceHtml = ClassHelper.getProvinceOptions();
                }
            }

            if (RequsetAjax("showCity"))
            {
                //
                try
                {
                    string code = Request.Form["code"].ToString();
                    string result = ClassHelper.getCityOptions(code);

                    Response.Write("{\"status\":1,\"result\":\"" + result + "\"}");
                }
                catch { Response.Write("{\"status\":0,\"msg\":\"失败!\"}"); }
                Response.End();
            }
            if (RequsetAjax("showDistinct"))
            {
                //
                try
                {
                    string code = Request.Form["code"].ToString();
                    string result = ClassHelper.getDistinceOptions(code);

                    Response.Write("{\"status\":1,\"result\":\"" + result + "\"}");
                }
                catch { Response.Write("{\"status\":0,\"msg\":\"失败!\"}"); }
                Response.End();
            }
        }
Exemple #5
0
 /// <summary>
 /// 取码表
 /// </summary>
 /// <param name="innerName">内部名</param>
 /// <returns></returns>
 public static DataSet GetSystemItem(string innerName)
 {
     BLL.sysItem sBll = new BLL.sysItem();
     return sBll.GetList("sicId in (select sicId from [sysItemCategory] where innerName='" + innerName + "') order by orders asc");
 }