示例#1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (bll.CheckAreaName(txtDistrict.Value) > 0)
            {
                L_msg.Text = "已存在名称,请勿重复操作!";
            }
            else
            {
                Area item = new Area();
                item.AreaName = txtDistrict.Value;
                item.Pid      = Convert.ToInt32(ddl_streets.SelectedValue);
                item.AreaKey  = txtKey.Value.Trim();

                if (bll.AddItem(item) > 0)
                {
                    Utils.alert("添加成功!", "District_AE.aspx?action=add&pid=" + ddl_counties.SelectedValue + "&id=" + ddl_streets.SelectedValue);
                }
                else
                {
                    base.ErrorMsg("添加失败", "AreaList.aspx", 0);
                }
            }
        }
示例#2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (bll.CheckAreaName(txtStreet.Value) > 0)
            {
                L_msg.Text = "已存在名称,请勿重复操作!";
            }
            else
            {
                Area item = new Area();
                item.AreaName = txtStreet.Value;
                item.Pid      = Convert.ToInt32(ddl_counties.SelectedValue);
                item.AreaKey  = txtKey.Value;

                if (bll.AddItem(item) > 0)
                {
                    base.ErrorMsg("添加成功", "AreaList.aspx", 1);
                }
                else
                {
                    base.ErrorMsg("添加失败", "AreaList.aspx", 0);
                }
            }
        }