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


C# Addr_OrganizeCityBLL.GetFullPath方法代码示例

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


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

示例1: 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

示例2: BindGrid

    private void BindGrid()
    {
        string ConditionStr = " 1=1 ";

        if ((int)Session["OwnerType"] == 2)
        {
            ConditionStr += @" AND CM_Client.ID IN (SELECT Client FROM MCS_CM.dbo.CM_ClientSupplierInfo INNER JOIN MCS_CM.dbo.CM_Client s ON
               CM_ClientSupplierInfo.Supplier = s.ID WHERE OwnerClient=" + Session["OwnerClient"].ToString() + " )";
        }
        else if ((int)Session["OwnerType"] == 3)
        {
            ConditionStr += @" AND CM_Client.ID IN (SELECT Client FROM MCS_CM.dbo.CM_ClientSupplierInfo WHERE Supplier=" + Session["OwnerClient"].ToString() + " )";
        }

        if (ddl_ClientType.SelectedValue != "0")
        {
            ConditionStr += " AND CM_Client.ClientType = " + ddl_ClientType.SelectedValue;
        }
        else
        {
            ConditionStr += " AND CM_Client.ClientType IN ( 0";
            foreach (ListItem item in ddl_ClientType.Items)
            {
                if (item.Enabled) ConditionStr += "," + item.Value;
            }
            ConditionStr += " )";
        }

        if (tbx_Condition.Text.Trim() != "")
        {
            ConditionStr += " AND " + ddl_SearchType.SelectedValue + " LIKE '%" + this.tbx_Condition.Text.Trim() + "%'";
        }

        if (Request.QueryString["ExtCondition"] != null)
        {
            ConditionStr += " AND (" + Request.QueryString["ExtCondition"].Replace("\"", "").Replace('~', '\'') + ")";
        }

        #region 判断当前可查询的范围
        string orgcitys = "";
        if (tr_OrganizeCity.SelectValue != "0" && tr_OrganizeCity.SelectValue != "1")
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
            orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "") orgcitys += ",";
            orgcitys += tr_OrganizeCity.SelectValue;

            #region 在选择仓库或经销商时,如果选择的是片区,则可以选择到其上级城市的经销商
            if ((ddl_ClientType.SelectedValue == "1" || ddl_ClientType.SelectedValue == "2") && Request.QueryString["NoParent"] == null)
            {
                DataTable dt_fullpath = orgcity.GetFullPath();
                if (dt_fullpath != null)
                {
                    for (int i = 0; i < dt_fullpath.Rows.Count; i++)
                    {
                        orgcitys += "," + dt_fullpath.Rows[i]["ID"].ToString();
                    }
                }
            }
            #endregion

            if (orgcitys != "")
            {
                ConditionStr += " AND CM_Client.ID IN (SELECT Client FROM MCS_CM.dbo.CM_ClientManufactInfo WHERE CM_ClientManufactInfo.OrganizeCity IN (" + orgcitys + ") )";
            }
        }
        #endregion

        if ((int)Session["AccountType"] == 1)
        {
            if (ddl_ClientType.SelectedValue == "3")
            {
                //是否有权限“仅查看自己的门店”,如果是,限制客户经理条件
                if (Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 11, "OlnyViewMyClient"))
                {
                    ConditionStr += " AND CM_Client.ID IN (SELECT Client FROM MCS_CM.dbo.CM_ClientManufactInfo WHERE CM_ClientManufactInfo.ClientManager = " + Session["UserID"].ToString() + " )";
                }
            }
        }

        ConditionStr += " Order by MCS_CM.dbo.CM_Client.FullName";

        gv_List.ConditionString = ConditionStr;
        gv_List.BindGrid();

        //Response.Write(ConditionStr);
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:87,代码来源:Search_SelectClient.aspx.cs

示例3: BindGrid

    private void BindGrid()
    {
        string ConditionStr = " CM_Client.ActiveFlag=1 AND CM_Client.ApproveFlag=1 ";

        if (ddl_ClientType.SelectedValue != "0")
        {
            ConditionStr += " AND CM_Client.ClientType = " + ddl_ClientType.SelectedValue;
        }
        else
        {
            ConditionStr += " AND CM_Client.ClientType IN ( 0";
            foreach (ListItem item in ddl_ClientType.Items)
            {
                if (item.Enabled) ConditionStr += "," + item.Value;
            }
            ConditionStr += " )";
        }

        if (tbx_Condition.Text.Trim() != "")
        {
            ConditionStr += " AND " + ddl_SearchType.SelectedValue + " LIKE '%" + this.tbx_Condition.Text.Trim() + "%'";
        }

        if (Request.QueryString["ExtCondition"] != null)
        {
            ConditionStr += " AND (" + Request.QueryString["ExtCondition"].Replace("\"", "").Replace('~', '\'').Replace("$", " ") + ")";
        }

        #region 判断当前可查询的范围
        string orgcitys = "";
        if (tr_OrganizeCity.SelectValue != "0" && tr_OrganizeCity.SelectValue != "1")
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
            orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "") orgcitys += ",";
            orgcitys += tr_OrganizeCity.SelectValue;

            if (ViewState["ShowParent"] == null)
            {
                #region 在选择仓库或经销商时,如果选择的是片区,则可以选择到其上级城市的经销商
                if ((ddl_ClientType.SelectedValue == "1" || ddl_ClientType.SelectedValue == "2") && Request.QueryString["NoParent"] == null)
                {
                    DataTable dt_fullpath = orgcity.GetFullPath();
                    if (dt_fullpath != null)
                    {
                        for (int i = 0; i < dt_fullpath.Rows.Count; i++)
                        {
                            orgcitys += "," + dt_fullpath.Rows[i]["ID"].ToString();
                        }
                    }
                }
                #endregion
                if (orgcitys != "")
                {
                    ConditionStr += " AND( CM_Client.OrganizeCity IN (" + orgcitys + ") OR CM_Client.ID IN (SELECT Client FROM MCS_CM.dbo.CM_ClientInOrganizeCity WHERE CM_ClientInOrganizeCity.OrganizeCity IN (" + orgcitys + ")) )";
                }
            }
            else if (ViewState["ShowParent"].ToString() == "false")
            {
                if (orgcitys != "")
                {
                    ConditionStr += " AND CM_Client.OrganizeCity IN (" + orgcitys + ")";
                }
                ConditionStr += " AND MCS_SYS.dbo.UF_Spilt(CM_Client.ExtPropertys,'|',7)!='2' ";
            }

        }
        #endregion

        #region 判断当前员工的关联经销商
        if (ViewState["RelateClient"] != null)
        {
            if (ddl_ClientType.SelectedValue == "3")
                ConditionStr += " AND CM_Client.Supplier = " + ViewState["RelateClient"].ToString();
            else if (ddl_ClientType.SelectedValue == "2")
                ConditionStr += " AND ( CM_Client.ID =" + ViewState["RelateClient"].ToString() + " OR CM_Client.Supplier = " + ViewState["RelateClient"].ToString() + ")";
        }
        #endregion

        if ((int)Session["AccountType"] == 1)
        {
            if (ddl_ClientType.SelectedValue == "3")
            {
                //是否有权限“仅查看自己的门店”,如果是,限制客户经理条件
                if (Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 1101, "OlnyViewMyClient"))
                {
                    ConditionStr += " And CM_Client.ClientManager=" + Session["UserID"];
                }
            }
            else if (ddl_ClientType.SelectedValue == "5")
            {
                //是否有权限“仅查看自己负责的医院”,如果是,限制客户经理条件
                if (Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 801, "OnlyFindSelfHospital"))
                {
                    ConditionStr += " And MCS_CM.dbo.CM_Client.ClientManager=" + Session["UserID"];
                }
            }
        }
        #region 如果登录用户是商业客户,只能查看自己及下游客户
        if ((int)Session["AccountType"] == 2)
//.........这里部分代码省略.........
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:101,代码来源:Search_SelectClient.aspx.cs

示例4: bt_OK_Click

    protected void bt_OK_Click(object sender, EventArgs e)
    {
        FNA_BudgetExtraApplyBLL _bll;
        if ((int)ViewState["ID"] != 0)
        {
            //修改
            _bll = new FNA_BudgetExtraApplyBLL((int)ViewState["ID"]);
        }
        else
        {
            //新增
            _bll = new FNA_BudgetExtraApplyBLL();
            _bll.Model.AccountMonth = AC_AccountMonthBLL.GetCurrentMonth();
        }
        pl_detail.GetData(_bll.Model);

        //_bll.Model["SheetCode"] = FNA_BudgetExtraApplyBLL.GenerateSheetCode(_bll.Model.OrganizeCity);在存储过程中实现
        #region 判断必填项
        if (_bll.Model.OrganizeCity == 0)
        {
            MessageBox.Show(this, "必须正确选择管理片区!");
            return;
        }

        if (_bll.Model.FeeType == 0)
        {
            MessageBox.Show(this, "必须正确选择费用类型!");
            return;
        }
        if (_bll.Model["ExtraType"] == "0")
        {
            MessageBox.Show(this, "必须正确选择扩增费用类别!");
            return;
        }
        #endregion

        #region 判断上级直至部经理手中有无预算
        decimal sumbudget = 0;
        Addr_OrganizeCityBLL city = new Addr_OrganizeCityBLL(_bll.Model.OrganizeCity);
        DataTable dt = city.GetFullPath();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            Addr_OrganizeCity c = new Addr_OrganizeCityBLL((int)dt.Rows[i]["ID"]).Model;
            if (c == null || c.ID == 1 || c.ID == _bll.Model.OrganizeCity || c.Level == 1) continue;       //忽略总部

            sumbudget += FNA_BudgetBLL.GetUsableAmount(_bll.Model.AccountMonth, c.ID, _bll.Model.FeeType);
        }

        if (sumbudget > _bll.Model.ExtraAmount)
        {
            MessageBox.Show(this, "对不起,您的上级领导预算余额大于您要扩增的金额,请与领导沟通申请要求分配预算给您,而无需提交扩增预算流程!");
            return;
        }
        #endregion

        if ((int)ViewState["ID"] != 0)
        {
            //修改
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            if (_bll.Update() == 0)
            {
                if (sender != null) MessageBox.ShowAndRedirect(this, "修改成功!", "BudgetExtraApplyDetail.aspx?ID=" + ViewState["ID"].ToString());
            }
        }
        else
        {
            //新增

            _bll.Model.ApproveFlag = 2;
            _bll.Model.InsertStaff = (int)Session["UserID"];
            ViewState["ID"] = _bll.Add();
            bt_Submit.Visible = true;
            if ((int)ViewState["ID"] > 0)
            {
                if (sender != null) MessageBox.ShowAndRedirect(this, "新增成功!", "BudgetExtraApplyDetail.aspx?ID=" + ViewState["ID"].ToString());
            }
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:78,代码来源:BudgetExtraApplyDetail.aspx.cs


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