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