Beispiel #1
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        protected void databind()
        {
            //绑定名录属性显示
            E_Property data = new T_Property().Get(new E_Property()
            {
                PersonalID = PersonalID
            });

            trSource.Visible = false;
            trTrade.Visible  = false;
            trArea.Visible   = false;
            if (data != null)
            {
                if (data.SourceFlag == EnumPropertyEnabled.启用)//判断来源
                {
                    trSource.Visible = true;
                    DataDictionaries.BindProperty(ddlSource, new T_Source().GetShowList(new E_Source()
                    {
                        PersonalID = PersonalID, CodeIsValue = false
                    }));
                }
                if (data.TradeFlag == EnumPropertyEnabled.启用)//判断行业
                {
                    trTrade.Visible = true;
                    DataDictionaries.BindProperty(ddlTrade, new T_Trade().GetShowList(new E_Trade()
                    {
                        PersonalID = PersonalID, CodeIsValue = false
                    }));
                }
                if (data.AreaFlag == EnumPropertyEnabled.启用)//判断地区
                {
                    trArea.Visible = true;
                    DataDictionaries.BindProperty(ddlArea, new T_Area().GetShowList(new E_Area()
                    {
                        PersonalID = PersonalID, CodeIsValue = false
                    }));
                }
                //添加一个空选项
                ddlArea.Items.Insert(0, new ListItem("", "-1"));
                ddlSource.Items.Insert(0, new ListItem("", "-1"));
                ddlTrade.Items.Insert(0, new ListItem("", "-1"));
            }
        }
Beispiel #2
0
        protected void databind()
        {
            //绑定名录属性显示
            E_Property data = new T_Property().Get(new E_Property()
            {
                EnterpriseID = EnterpriceID
            });

            trSource.Visible = false;
            trTrade.Visible  = false;
            trArea.Visible   = false;
            if (data != null)
            {
                if (data.SourceFlag == EnumPropertyEnabled.启用)//判断来源
                {
                    trSource.Visible = true;
                    DataDictionaries.BindProperty(ddlSource, new T_Source().GetShowList(new E_Source()
                    {
                        EnterpriseID = EnterpriceID
                    }));
                }
                if (data.TradeFlag == EnumPropertyEnabled.启用)//判断行业
                {
                    trTrade.Visible = true;
                    DataDictionaries.BindProperty(ddlTrade, new T_Trade().GetShowList(new E_Trade()
                    {
                        EnterpriseID = EnterpriceID
                    }));
                }
                if (data.AreaFlag == EnumPropertyEnabled.启用)//判断地区
                {
                    trArea.Visible = true;
                    DataDictionaries.BindProperty(ddlArea, new T_Area().GetShowList(new E_Area()
                    {
                        EnterpriseID = EnterpriceID
                    }));
                }
            }
        }
Beispiel #3
0
        protected void databind(MLMGC.Security.PersonalPage p)
        {
            //MLMGC.Security.EnterprisePage eppage = (MLMGC.Security.EnterprisePage)this.Page;
            MLMGC.Security.PersonalPage pp = (MLMGC.Security.PersonalPage) this.Page;
            int personalID = pp.PersonalID;

            if (data == null)//判断是否传递过来参数
            {
                data = new T_Property().Get(new E_Property()
                {
                    PersonalID = personalID
                });
            }
            TradeFlag  = Convert.ToBoolean((int)data.TradeFlag);
            AreaFlag   = Convert.ToBoolean((int)data.AreaFlag);
            SourceFlag = Convert.ToBoolean((int)data.SourceFlag);
            if (data.SourceFlag == EnumPropertyEnabled.启用)//判断来源
            {
                DataDictionaries.BindProperty(ddlSource, new T_Source().GetShowList(new E_Source()
                {
                    PersonalID = personalID, CodeIsValue = false
                }));
            }
            else
            {
                ddlSource.Enabled = false;
            }
            if (data.TradeFlag == EnumPropertyEnabled.启用)//判断行业
            {
                DataDictionaries.BindProperty(ddlTrade, new T_Trade().GetShowList(new E_Trade()
                {
                    PersonalID = personalID, CodeIsValue = false
                }));
            }
            else
            {
                ddlTrade.Enabled = false;
            }
            if (data.AreaFlag == EnumPropertyEnabled.启用)//判断地区
            {
                DataDictionaries.BindProperty(ddlArea, new T_Area().GetShowList(new E_Area()
                {
                    PersonalID = personalID, CodeIsValue = false
                }));
            }
            else
            {
                ddlArea.Enabled = false;
            }
            //增加默认值
            ddlSource.Items.Insert(0, new ListItem("  ", "-1"));
            ddlTrade.Items.Insert(0, new ListItem("  ", "-1"));
            ddlArea.Items.Insert(0, new ListItem("  ", "-1"));
            //设置默认选项
            if (_sourceid != null)
            {
                ddlSource.SelectedValue = _sourceid.ToString(); lblSource.Text = ddlSource.SelectedItem.Text;
            }
            if (_tradeid != null)
            {
                ddlTrade.SelectedValue = _tradeid.ToString(); lblTrade.Text = ddlTrade.SelectedItem.Text;
            }
            if (_areaid != null)
            {
                ddlArea.SelectedValue = _areaid.ToString(); lblArea.Text = ddlArea.SelectedItem.Text;
            }
        }