當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。