コード例 #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RemoveData(object sender, CommandEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
            {
                DataTable dt = _AreaBLL.SelectSystemAreaForCity(e.CommandArgument.ToString());

                SystemArea _SystemArea = new SystemArea();
                _SystemArea.GA03001 = e.CommandArgument.ToString();
                _SystemArea.GA03997 = 1;
                int num = Math.Abs(_AreaBLL.RemoveSystemArea(_SystemArea));
                new Sinoo.Common.MessageShow().RemoveMessage(this, num, "");

                if (num < 1)
                {
                    return;
                }

                int CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; //当前页
                int PageCount        = this.AspNetPager1.PageCount;        //页总数
                int RecordCount      = this.AspNetPager1.RecordCount;      //记录数
                int PageSize         = this.AspNetPager1.PageSize;         //第页条数

                int PageIndex = CurrentPageIndex == PageCount ? (PageCount * PageSize - RecordCount == (PageSize - 1) ? CurrentPageIndex - 1 : CurrentPageIndex) : CurrentPageIndex;

                InitData(PageIndex);
            }
        }
コード例 #2
0
        /// <summary>
        /// 省市级联
        /// </summary>
        /// <param name="GA03001">父级ID</param>
        private DataTable GetGA03(string GA03001)
        {
            //实例化省市逻辑层
            AreaBLL   _AreaBLL = new AreaBLL();
            DataTable dt       = _AreaBLL.SelectSystemAreaForCity(GA03001);

            return(dt);
        }
コード例 #3
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RemoveData(object sender, CommandEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
            {
                DataTable dt = _AreaBLL.SelectSystemAreaForCity(e.CommandArgument.ToString());
                if (dt.Rows.Count > 0)
                {
                    Page.ClientScript.RegisterStartupScript(Page.GetType()
                                                            , "message"
                                                            , "<script language='javascript' defer> "
                                                            + "alert('被删除省份存在关联的城市,请先删除城市后,再尝试删除该省份'); "
                                                            + " </script>");
                }
                else
                {
                    SystemArea _SystemArea = new SystemArea();
                    _SystemArea.GA03001 = e.CommandArgument.ToString();
                    _SystemArea.GA03997 = 1;
                    int num = Math.Abs(_AreaBLL.RemoveSystemArea(_SystemArea));
                    new Sinoo.Common.MessageShow().RemoveMessage(this, num, "");

                    if (num < 1)
                    {
                        return;
                    }

                    int CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; //当前页
                    int PageCount        = this.AspNetPager1.PageCount;        //页总数
                    int RecordCount      = this.AspNetPager1.RecordCount;      //记录数
                    int PageSize         = this.AspNetPager1.PageSize;         //第页条数

                    int PageIndex = CurrentPageIndex == PageCount ? (PageCount * PageSize - RecordCount == (PageSize - 1) ? CurrentPageIndex - 1 : CurrentPageIndex) : CurrentPageIndex;

                    InitData(PageIndex);
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// 数据初始化绑定
        /// </summary>
        private void DataBind()
        {
            if (string.IsNullOrEmpty(Request.QueryString["CA01001"]))
            {
                Response.Redirect("CA0101List.aspx");
            }
            DataTable dt = _CustomerManagementLogic.SelectCustomerBase(string.Format(" AND CA01001 = '{0}'", Request.QueryString["CA01001"]));

            try
            {
                this.ID.Value = dt.Rows[0]["CA01001"].ToString();

                this.txtCA01002.Text = dt.Rows[0]["CA01002"].ToString();
                this.txtCA01003.Text = dt.Rows[0]["CA01003"].ToString();
                this.txtCA01004.Text = dt.Rows[0]["CA01004"].ToString().Replace("’", "'");
                this.txtCA01005.Text = dt.Rows[0]["CA01005"].ToString();
                this.txtCA01006.Text = dt.Rows[0]["CA01006"].ToString();
                this.txtCA01007.Text = dt.Rows[0]["CA01007"].ToString();
                this.txtCA01008.Text = dt.Rows[0]["CA01008"].ToString();
                this.txtCA01009.Text = dt.Rows[0]["CA01009"].ToString();
                this.txtCA01010.Text = dt.Rows[0]["CA01010"].ToString();
                this.txtCA01011.Text = dt.Rows[0]["CA01011"].ToString();
                this.txtCA01012.Text = dt.Rows[0]["CA01012"].ToString();
                this.txtCA01014.Text = dt.Rows[0]["CA01014"].ToString();
                this.txtCA01015.Text = dt.Rows[0]["CA01015"].ToString();
                this.txtCA01017.Text = dt.Rows[0]["CA01017"].ToString();
                this.txtCA01021.Text = dt.Rows[0]["CA01021"].ToString();
                this.txtCA01026.Text = dt.Rows[0]["CA01026"].ToString();
                this.txtCA01027.Text = dt.Rows[0]["CA01027"].ToString();
                this.txtCA01028.Text = dt.Rows[0]["CA01028"].ToString();
                this.txtCA01029.Text = dt.Rows[0]["CA01029"].ToString();
                this.txtCA01030.Text = dt.Rows[0]["CA01030"].ToString();
                this.txtCA01031.Text = dt.Rows[0]["CA01031"].ToString();
                this.txtCA01032.Text = dt.Rows[0]["CA01032"].ToString();
                this.txtCA01033.Text = dt.Rows[0]["CA01033"].ToString();
                this.txtCA01034.Text = dt.Rows[0]["CA01034"].ToString();
                this.txtCA01035.Text = dt.Rows[0]["CA01035"].ToString();
                this.txtCA01036.Text = dt.Rows[0]["CA01036"].ToString();
                this.txtCA01037.Text = dt.Rows[0]["CA01037"].ToString();
                this.txtCA01038.Text = dt.Rows[0]["CA01038"].ToString();
                this.txtCA01039.Text = dt.Rows[0]["CA01039"].ToString();
                this.txtCA01040.Text = dt.Rows[0]["CA01040"].ToString();
                this.txtCA01041.Text = dt.Rows[0]["CA01041"].ToString();
                this.txtCA01042.Text = dt.Rows[0]["CA01042"].ToString();
                this.txtCA01043.Text = dt.Rows[0]["CA01043"].ToString();
                this.txtCA01044.Text = dt.Rows[0]["CA01044"].ToString();
                this.txtCA01045.Text = dt.Rows[0]["CA01045"].ToString();
                this.txtCA01046.Text = dt.Rows[0]["CA01046"].ToString();
                this.txtCA01048.Text = dt.Rows[0]["CA01048"].ToString();
                this.txtCA01049.Text = dt.Rows[0]["CA01049"].ToString();
                this.txtCA01050.Text = dt.Rows[0]["CA01050"].ToString();
                this.txtCA01051.Text = dt.Rows[0]["CA01051"].ToString();

                //拿出区域上级编码
                if (!string.IsNullOrEmpty(dt.Rows[0]["CA01013"].ToString()))
                {
                    DataTable dtGA03 = _DataManagementLogic.SelectSystemAreaById(dt.Rows[0]["CA01013"].ToString());
                    this.ddlGA03Province.SelectedValue = dtGA03.Rows[0]["GA03003"].ToString();

                    //绑定此省下所有的市(区域)
                    DataTable dtGA0301 = _DataManagementLogic.SelectSystemAreaForCity(dtGA03.Rows[0]["GA03003"].ToString());

                    this.ddlGA03City.DataSource     = dtGA0301;
                    this.ddlGA03City.DataTextField  = "GA03002";
                    this.ddlGA03City.DataValueField = "GA03001";
                    this.ddlGA03City.DataBind();
                    //设置市下拉选中数据库中对应的区域编码
                    this.ddlGA03City.Value = dt.Rows[0]["CA01013"].ToString();
                }


                //根据行业分类,获取行业分类下所有的行业代码
                DataTable dtCB04 = _CustomerManagementLogic.SelectCustomerTradeCodeByCB04003(dt.Rows[0]["CA01019"].ToString());
                this.ddlCA01020.DataSource     = dtCB04;
                this.ddlCA01020.DataTextField  = "CB04002";
                this.ddlCA01020.DataValueField = "CB04001";
                this.ddlCA01020.DataBind();
                this.ddlCA01020.Items.Insert(0, new ListItem("请选择", ""));
                //设置行业代码下拉选中数据库中对应的行业编码
                this.ddlCA01020.Value = dt.Rows[0]["CA01020"].ToString();

                this.ddlCA01016.SelectedValue = dt.Rows[0]["CA01016"].ToString();
                this.ddlCA01018.SelectedValue = dt.Rows[0]["CA01018"].ToString();

                this.ddlCA01019.SelectedValue = dt.Rows[0]["CA01019"].ToString();
                this.ddlCA01022.SelectedValue = dt.Rows[0]["CA01022"].ToString();
                this.ddlCA01023.SelectedValue = dt.Rows[0]["CA01023"].ToString();

                if (dt.Rows[0]["CA01024"].ToString().Trim() == "1")
                {
                    this.rbtnCA01024Yes.Checked = true;
                }
                else if (dt.Rows[0]["CA01024"].ToString().Trim() == "0")
                {
                    this.rbtnCA01024No.Checked = true;
                }

                if (dt.Rows[0]["CA01025"].ToString().Trim() == "1")
                {
                    this.rbtnCA01025Yes.Checked = true;
                }
                else if (dt.Rows[0]["CA01025"].ToString().Trim() == "0")
                {
                    this.rbtnCA01025No.Checked = true;
                }

                if (dt.Rows[0]["CA01047"].ToString().Trim() == "1")
                {
                    this.rbtnCA01047Yes.Checked = true;
                }
                else if (dt.Rows[0]["CA01047"].ToString().Trim() == "0")
                {
                    this.rbtnCA01047No.Checked = true;
                }
                if (dt.Rows[0]["CA01052"].ToString().Trim() == "1")
                {
                    this.rbtnCA01052Yes.Checked = true;
                }
                else if (dt.Rows[0]["CA01052"].ToString().Trim() == "0")
                {
                    this.rbtnCA01052No.Checked = true;
                }
            }
            catch
            {
                Response.Write("<script>alert('数据异常!');window.location.href = '/Page/CustomerManagement/CA0101List.aspx';</script>");
            }
        }