本文整理匯總了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);
}
}
}
}
}
示例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();
}