当前位置: 首页>>代码示例>>C#>>正文


C# Addr_OrganizeCityBLL.GetAllChildNode方法代码示例

本文整理汇总了C#中Addr_OrganizeCityBLL.GetAllChildNode方法的典型用法代码示例。如果您正苦于以下问题:C# Addr_OrganizeCityBLL.GetAllChildNode方法的具体用法?C# Addr_OrganizeCityBLL.GetAllChildNode怎么用?C# Addr_OrganizeCityBLL.GetAllChildNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Addr_OrganizeCityBLL的用法示例。


在下文中一共展示了Addr_OrganizeCityBLL.GetAllChildNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindDropDown();

            if (Request.QueryString["OrganizeCity"] == null)
            {
                MessageBox.ShowAndClose(this, "参数错误!");
                return;
            }
            else
            {
                ViewState["OrganizeCity"] = int.Parse(Request.QueryString["OrganizeCity"]);

                Addr_OrganizeCityBLL organizecity = new Addr_OrganizeCityBLL((int)ViewState["OrganizeCity"]);
                if (organizecity.Model == null)
                {
                    MessageBox.ShowAndClose(this, "参数错误!");
                    return;
                }
                else if (organizecity.GetAllChildNode().Rows.Count != 0)
                {
                    MessageBox.ShowAndClose(this, "要加入的管理片区必须是最低一层的架构单元!");
                    return;
                }
                else
                {
                    lb_OrganizeCityName.Text = organizecity.Model.Name;

                    IList<Addr_OfficialCity> lists = Addr_OfficialCityBLL.GetModelList("Name like '%" + organizecity.Model.Name + "%'");
                    if (lists.Count > 0)
                    {
                        tr_OfficialCity.SelectValue = lists[0].ID.ToString();
                        tr_OfficialCity_Selected(null, null);
                    }

                }
            }
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:41,代码来源:OrganizeCity_AddOfficialCity.aspx.cs

示例2: bt_Add_Click

    protected void bt_Add_Click(object sender, EventArgs e)
    {
        IList<CM_RebateRule_ApplyCity> ApplyCitys = CM_RebateRule_ApplyCityBLL.GetModelList("RebateRule=" + ViewState["ID"].ToString());

        int city = 0;
        if (int.TryParse(tr_OrganizeCity.SelectValue, out city) && city > 0)
        {
            if (ApplyCitys.FirstOrDefault(p => p.OrganizeCity == city) != null)
            {
                MessageBox.Show(this, "对不起,该区域已属于该返利方案,请勿重复添加!");
                return;
            }

            Addr_OrganizeCityBLL c = new Addr_OrganizeCityBLL(city);
            foreach (DataRow row in c.GetFullPath().Rows)
            {
                if (ApplyCitys.FirstOrDefault(p => p.OrganizeCity == (int)row["ID"]) != null)
                {
                    MessageBox.Show(this, "对不起,该区域的上级区域" + new Addr_OrganizeCityBLL((int)row["ID"]).Model.Name + "已属于该返利方案,请勿重复添加!");
                    return;
                }
            }

            foreach (DataRow row in c.GetAllChildNode().Rows)
            {
                if (ApplyCitys.FirstOrDefault(p => p.OrganizeCity == (int)row["ID"]) != null)
                {
                    MessageBox.Show(this, "对不起,该区域的下级区域" + new Addr_OrganizeCityBLL((int)row["ID"]).Model.Name + "已属于该返利方案,请勿重复添加!");
                    return;
                }
            }

            CM_RebateRule_ApplyCityBLL bll = new CM_RebateRule_ApplyCityBLL();
            bll.Model.RebateRule = (int)ViewState["ID"];
            bll.Model.OrganizeCity = city;
            bll.Add();
        }

        BindGrid();
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:40,代码来源:RebateRuleDetail.aspx.cs


注:本文中的Addr_OrganizeCityBLL.GetAllChildNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。