Exemple #1
0
        /// <summary>
        /// 绑定专线下拉
        /// </summary>
        private void BindZX()
        {
            ICompanyUser companyUserBLL = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance();

            EyouSoft.Model.CompanyStructure.CompanyUser companyUserModel = companyUserBLL.GetModel(SiteUserInfo.ID);
            if (companyUserModel != null && companyUserModel.Area != null && companyUserModel.Area.Count > 0)
            {
                ddl_ZX.AppendDataBoundItems = true;
                ddl_ZX.DataTextField        = "AreaName";
                ddl_ZX.DataValueField       = "AreaId";
                ddl_ZX.DataSource           = companyUserModel.Area;
                ddl_ZX.DataBind();
            }
        }
Exemple #2
0
        /// <summary>
        /// 显示相关专线、地接、景区
        /// </summary>
        /// <param name="selValue">初始选中项的值</param>
        /// <returns></returns>
        protected void getSelectInfo(string selValue)
        {
            if (this.SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.酒店))
            {
                return;
            }
            string        s          = @"<tr><td bgcolor=""#CCE8F8"" align=""right"">{0}:</td><td align=""left""><select id=""selectInfo"" name=""selectInfo""><option value=""-1"">--请选择--</option>{1}</select><input type=""hidden"" name=""selectInfoName""/></td></tr>";
            StringBuilder str        = new StringBuilder();
            StringBuilder strOptions = new StringBuilder();

            //相关专线
            if (this.SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.专线) || this.SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.地接))
            {
                //用户Id
                string UserID = string.Empty;;
                if (SiteUserInfo != null)
                {
                    EyouSoft.SSOComponent.Entity.UserInfo UserInfoModel = SiteUserInfo;

                    UserID = UserInfoModel.ID ?? "0";
                }
                ICompanyUser companyUserBLL = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance();
                EyouSoft.Model.CompanyStructure.CompanyUser companyUserModel = companyUserBLL.GetModel(UserID);
                List <AreaBase> lstArea = companyUserModel.Area;
                if (null != lstArea && lstArea.Count > 0)
                {
                    for (int i = 0; i < lstArea.Count; i++)
                    {
                        strOptions.AppendFormat("<option value=\"{0}|{3}\"{2}>{1}</option>", lstArea[i].AreaId, lstArea[i].AreaName, selValue == lstArea[i].AreaId.ToString() ? " selected=\"selected\"" : "", (int)lstArea[i].RouteType);//资讯的model中相关信息存的是名字
                    }
                }
                str.AppendFormat(s, "相关专线", strOptions);
            }
            //相关景区
            else if (this.SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.景区))
            {
                EyouSoft.BLL.ScenicStructure.BScenicArea viewBLL = new EyouSoft.BLL.ScenicStructure.BScenicArea();
                IList <MScenicArea> viewLst = viewBLL.GetList(this.SiteUserInfo.CompanyID);
                if (null != viewLst && viewLst.Count > 0)
                {
                    for (int i = 0; i < viewLst.Count; i++)
                    {
                        strOptions.AppendFormat("<option value=\"{0}\"{2}>{1}</option>", viewLst[i].ScenicId, viewLst[i].ScenicName, selValue == viewLst[i].ScenicId ? " selected=\"selected\"" : "");//资讯的model中相关信息存的是名字
                    }
                }
                str.AppendFormat(s, "相关景区", strOptions);
            }
            this.ltSelectTypeInfo.Text = str.ToString();
        }