本文整理汇总了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();
}