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


C# Addr_OrganizeCityBLL.GetAllChildNodeIncludeSelf方法代码示例

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


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

示例1: bt_Refresh_Click

    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(Select_Client_Begin.SelectValue) || string.IsNullOrEmpty(Select_Client_End.SelectValue))
        {
            MessageBox.Show(this, "请选择经销商范围");
            return;
        }
        int beginClinetID = int.Parse(Select_Client_Begin.SelectValue);
        int endClinetID = int.Parse(Select_Client_End.SelectValue);

        DateTime dateBegin = DateTime.ParseExact(ddl_AccountMonth.SelectedItem.Text, "yyyy-MM", null);
        DateTime dateEnd = DateTime.ParseExact(ddl_AccountMonthEnd.SelectedItem.Text, "yyyy-MM", null);
        if (dateBegin.CompareTo(dateEnd) > 0)
        {
            DateTime dateTemp = dateEnd;
            dateEnd = dateBegin;
            dateBegin = dateTemp;
        }

        StringBuilder organizeCityStr = new StringBuilder();
        #region 绑定用户可管辖的管理片区
        if ((int)Session["AccountType"] == 1)//账户类型 1:员工,2:商业客户 3:导购
        {
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            DataTable dt = staff.GetStaffOrganizeCity();
            foreach (DataRow row in dt.Rows)
            {
                organizeCityStr.Append(row["ID"].ToString() + ",");
            }

            //获取当前员工的关联经销商
            int _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                organizeCityStr.Append(_relateclient.ToString() + ",");
            }
        }
        else if ((int)Session["AccountType"] == 2)
        {
            CM_Client client = new CM_ClientBLL((int)Session["UserID"]).Model;
            if (client != null)
            {
                Addr_OrganizeCityBLL citybll = new Addr_OrganizeCityBLL(client.OrganizeCity);
                DataTable dt = citybll.GetAllChildNodeIncludeSelf();
                foreach (DataRow row in dt.Rows)
                {
                    organizeCityStr.Append(row["ID"].ToString() + ",");
                }
            }
        }
        if (organizeCityStr.Length > 0)//移除最后一处的逗号
        {
            organizeCityStr = organizeCityStr.Remove(organizeCityStr.Length - 1, 1);
        }

        #endregion

        string beginClinetCode = new CM_ClientBLL(beginClinetID).Model.Code;
        string endClinetCode = new CM_ClientBLL(endClinetID).Model.Code;
        string connStr = " ApproveFlag=1 AND ActiveFlag=1  AND ClientType=2 AND Code BETWEEN '" + beginClinetCode + "' AND '" + endClinetCode + "'  AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',7)!='2'";
        if (!organizeCityStr.ToString().Contains("1,"))
        {
            connStr += " AND OrganizeCity IN(" + organizeCityStr + ") ";
        }
        IList<CM_Client> clientList = CM_ClientBLL.GetModelList(connStr);

        string folderPath = GetPdfFolder();
        foreach (var client in clientList)
        {
            this.CreateClientPDF(folderPath, "[" + client.Code + "]" + client.FullName + ".pdf", client, dateBegin, dateEnd);
        }
        string zipPath = folderPath.Remove(folderPath.LastIndexOf("\\")) + ".zip";
        ZipDir(folderPath, zipPath, 9);
        DownLoadFile(zipPath);
        //删除临时文件夹及文件
        File.Delete(zipPath);
        Directory.Delete(folderPath, true);
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:78,代码来源:DIStatementExport.aspx.cs

示例2: BindDropDown

    private void BindDropDown()
    {
        ddl_ClientType.DataSource = DictionaryBLL.GetDicCollections("CM_ClientType");
        ddl_ClientType.DataBind();
        ddl_ClientType.Items.Insert(0, new ListItem("请选择...", "0"));

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 1701, "ViewStoreInPopSearch"))
        {
            //在弹出窗口中查看仓库列表
            //if (ddl_ClientType.Items.FindByValue("1") != null) ddl_ClientType.Items.FindByValue("1").Enabled = false;
        }

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 1201, "ViewDIInPopSearch"))
        {
            //在弹出窗口中查看经销商列表
            if (ddl_ClientType.Items.FindByValue("2") != null) ddl_ClientType.Items.FindByValue("2").Enabled = false;
        }

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 1101, "ViewRTInPopSearch"))
        {
            //在弹出窗口中查看门店列表
            if (ddl_ClientType.Items.FindByValue("3") != null) ddl_ClientType.Items.FindByValue("3").Enabled = false;
        }

        if (!Right_Assign_BLL.GetAccessRight(Session["UserName"].ToString(), 801, "ViewHPInPopSearch"))
        {
            //在弹出窗口中查看医院列表
            if (ddl_ClientType.Items.FindByValue("5") != null) ddl_ClientType.Items.FindByValue("5").Enabled = false;
        }

        #region 绑定用户可管辖的管理片区
        if ((int)Session["AccountType"] == 1)
        {
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }

            #region 获取当前员工的关联经销商
            int _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                ViewState["RelateClient"] = _relateclient;
            }
            #endregion
        }
        else if ((int)Session["AccountType"] == 2)
        {
            CM_Client client = new CM_ClientBLL((int)Session["UserID"]).Model;
            if (client != null)
            {
                Addr_OrganizeCityBLL citybll = new Addr_OrganizeCityBLL(client.OrganizeCity);
                tr_OrganizeCity.DataSource = citybll.GetAllChildNodeIncludeSelf();
                tr_OrganizeCity.RootValue = citybll.Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = client.OrganizeCity.ToString();
            }
        }
        #endregion
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:68,代码来源:Search_SelectClient.aspx.cs

示例3: BindDropDown

    private void BindDropDown()
    {
        if ((int)Session["AccountType"] == 1)
        {
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }
        }
        else if ((int)Session["AccountType"] == 2)
        {
            CM_Client client = new CM_ClientBLL((int)Session["UserID"]).Model;
            if (client != null)
            {
                Addr_OrganizeCityBLL citybll = new Addr_OrganizeCityBLL(client.OrganizeCity);
                tr_OrganizeCity.DataSource = citybll.GetAllChildNodeIncludeSelf();
                tr_OrganizeCity.RootValue = citybll.Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = client.OrganizeCity.ToString();
            }
        }

        ddl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        ddl_ApproveFlag.DataBind();
        ddl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        ddl_ApproveFlag.SelectedValue = "1";

        //ddl_ActiveFlag.DataSource = DictionaryBLL.GetDicCollections("CM_ActiveFlag");
        //ddl_ActiveFlag.DataBind();
        //ddl_ActiveFlag.Items.Insert(0, new ListItem("所有", "0"));
        //ddl_ActiveFlag.SelectedValue = "1";

        ddl_RTClassify.DataSource = DictionaryBLL.GetDicCollections("CM_RT_Classify");
        ddl_RTClassify.DataBind();
        ddl_RTClassify.Items.Insert(0, new ListItem("所有", "0"));
        ddl_RTClassify.SelectedValue = "0";

        //ddl_RTChannel.DataSource = DictionaryBLL.GetDicCollections("CM_RT_Channel");
        //ddl_RTChannel.DataBind();
        //ddl_RTChannel.Items.Insert(0, new ListItem("所有", "0"));
        //ddl_RTChannel.SelectedValue = "0";

        //ddl_MarketType.DataSource = DictionaryBLL.GetDicCollections("CM_MarketType");
        //ddl_MarketType.DataBind();
        //ddl_MarketType.Items.Insert(0, new ListItem("所有", "0"));
        //ddl_MarketType.SelectedValue = "0";
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:55,代码来源:RetailerList.aspx.cs

示例4: InitComponents


//.........这里部分代码省略.........
                                control.ID = _tablemodel.ModelClassName + "_" + _modelfieldsmodel.FieldName;

                                if (_modelfieldsmodel.RelationTableName == "MCS_SYS.dbo.Addr_OrganizeCity")
                                {
                                    #region 如果为管理片区字段,则取所能管辖的片区
                                    if (System.Web.HttpContext.Current.Session["AccountType"] == null ||
                                    (int)System.Web.HttpContext.Current.Session["AccountType"] == 1)
                                    {
                                        //员工
                                        Org_StaffBLL staff = new Org_StaffBLL((int)System.Web.HttpContext.Current.Session["UserID"]);
                                        ((MCSTreeControl)control).DataSource = staff.GetStaffOrganizeCity();
                                        ((MCSTreeControl)control).IDColumnName = "ID";
                                        ((MCSTreeControl)control).NameColumnName = "Name";
                                        ((MCSTreeControl)control).ParentColumnName = "SuperID";

                                        if (((MCSTreeControl)control).DataSource.Select("ID = 1").Length > 0 || staff.Model.OrganizeCity == 0)
                                        {
                                            ((MCSTreeControl)control).RootValue = "0";
                                            if (!Page.IsPostBack) ((MCSTreeControl)control).SelectValue = "0";
                                        }
                                        else
                                        {
                                            ((MCSTreeControl)control).RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                                            if (!Page.IsPostBack) ((MCSTreeControl)control).SelectValue = staff.Model.OrganizeCity.ToString();
                                        }
                                    }
                                    else if ((int)System.Web.HttpContext.Current.Session["AccountType"] == 2 &&
                                     System.Web.HttpContext.Current.Session["OrganizeCity"] != null)
                                    {
                                        //商业客户

                                        int city = (int)System.Web.HttpContext.Current.Session["OrganizeCity"];
                                        Addr_OrganizeCityBLL citybll = new Addr_OrganizeCityBLL(city);
                                        ((MCSTreeControl)control).DataSource = citybll.GetAllChildNodeIncludeSelf();
                                        ((MCSTreeControl)control).RootValue = citybll.Model.SuperID.ToString();
                                        ((MCSTreeControl)control).IDColumnName = "ID";
                                        ((MCSTreeControl)control).NameColumnName = "Name";
                                        ((MCSTreeControl)control).ParentColumnName = "SuperID";

                                        if (!Page.IsPostBack) ((MCSTreeControl)control).SelectValue = city.ToString();
                                    }
                                    #endregion
                                }
                                else if (_modelfieldsmodel.RelationTableName == "MCS_SYS.dbo.Addr_OfficialCity")
                                {
                                    ((MCSTreeControl)control).TableName = "MCS_SYS.dbo.Addr_OfficialCity";
                                    ((MCSTreeControl)control).IDColumnName = "ID";
                                    ((MCSTreeControl)control).NameColumnName = "Name";
                                    ((MCSTreeControl)control).ParentColumnName = "SuperID";
                                    ((MCSTreeControl)control).RootValue = "0";
                                    if (!Page.IsPostBack) ((MCSTreeControl)control).SelectValue = "0";
                                }
                                else
                                {
                                    ((MCSTreeControl)control).TableName = RelationTableName;
                                    ((MCSTreeControl)control).IDColumnName = RelationValueField;
                                    ((MCSTreeControl)control).NameColumnName = RelationTextField;
                                    ((MCSTreeControl)control).ParentColumnName = "SuperID";
                                }
                            }
                            break;
                    }
                    #endregion

                    control.ID = _tablemodel.ModelClassName + "_" + _modelfieldsmodel.FieldName;
                    control.Enabled = _panel_modelfields.Enable.ToUpper() == "Y";
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:67,代码来源:UC_DetailView.cs

示例5: BindDropDown

    private void BindDropDown()
    {
        if ((int)Session["AccountType"] == 1)
        {
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }
        }
        else if ((int)Session["AccountType"] == 2)
        {
            CM_Client client = new CM_ClientBLL((int)Session["UserID"]).Model;
            if (client != null)
            {
                Addr_OrganizeCityBLL citybll = new Addr_OrganizeCityBLL(client.OrganizeCity);
                tr_OrganizeCity.DataSource = citybll.GetAllChildNodeIncludeSelf();
                tr_OrganizeCity.RootValue = citybll.Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = client.OrganizeCity.ToString();
            }
        }

        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate>DateAdd(year,-2,getdate()) AND EndDate<=Getdate()");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-10)) - 1).ToString();
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:34,代码来源:CSO_ViewFeeApplyDetailByDI.aspx.cs


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