Esempio n. 1
0
        public void DataBindEx()
        {
            DigiPower.Onlinecol.Standard.BLL.UserOperate bll = new DigiPower.Onlinecol.Standard.BLL.UserOperate();

            DataSet list1 = bll.GetDepartmentList("select SystemInfoID,SystemInfoName from T_SystemInfo where CurrentType = 'SplitString'");

            DropDownList1.DataTextField  = "SystemInfoName";
            DropDownList1.DataValueField = "SystemInfoID";
            DropDownList1.DataSource     = list1;
            DropDownList1.DataBind();
        }
        public void DataBindEx()
        {
            DigiPower.Onlinecol.Standard.BLL.UserOperate bll = new DigiPower.Onlinecol.Standard.BLL.UserOperate();

            DataSet list1 = bll.GetDepartmentList("select CanDefineTypeID,ShowName from vwDefineType where DefineTypeID = " + _InfoID + "");

            DropDownList1.DataTextField  = "ShowName";
            DropDownList1.DataValueField = "CanDefineTypeID";
            DropDownList1.DataSource     = list1;
            DropDownList1.DataBind();
        }
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindGridView()
        {
            DigiPower.Onlinecol.Standard.BLL.UserOperate ubll = new DigiPower.Onlinecol.Standard.BLL.UserOperate();

            DataSet ds = new DataSet();

            if (ViewState["sqlwhere"] != null && !String.IsNullOrEmpty(ViewState["sqlwhere"].ToString()))
            {
                ds = ubll.GetDepartmentList("select * from vwDefine where " + ViewState["sqlwhere"].ToString());
            }
            else if (!String.IsNullOrEmpty(SqlWhere))
            {
                ds = ubll.GetDepartmentList("select * from vwDefine where " + SqlWhere);
            }
            else
            {
                ds = ubll.GetDepartmentList("select * from vwDefine where " + "1=1");
            }

            List <string> l1 = new List <string>();

            l1.Add("MainType");

            l1.Add("Split");

            l1.Add("TableName");

            l1.Add("FieldName");

            l1.Add("ShowName");

            l1.Add("StartLocation");

            l1.Add("EndLocation");

            l1.Add("IsSerial");

            ctrlGridEx1.InitGrid("DefineResultID", l1, ds, "~/SystemManage/DefinedAdd.aspx?Action=Edit");
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyAddInit();

            if (!this.IsPostBack)
            {
                DigiPower.Onlinecol.Standard.BLL.UserOperate ubll = new DigiPower.Onlinecol.Standard.BLL.UserOperate();

                if (Action.ToLower().Equals("edit"))
                {
                    DataSet ds = new DataSet();

                    ds = ubll.GetDepartmentList("select * from vwDefine where DefineResultID = " + ID + "");

                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        CanDefineTypeID.InfoID = ds.Tables[0].Rows[0]["SystemInfoID"].ToString();

                        CanDefineTypeID.DataBindEx();

                        CutLength.StartLocation = Common.ConvertEx.ToInt(ds.Tables[0].Rows[0]["StartLocation"].ToString());

                        CutLength.EndLocation = Common.ConvertEx.ToInt(ds.Tables[0].Rows[0]["EndLocation"].ToString());

                        CutLength.DataBindEx();
                    }
                }

                if (Action.ToLower().Equals("add"))
                {
                    CanDefineTypeID.InfoID = ID;

                    CanDefineTypeID.DataBindEx();

                    CutLength.StartLocation = 0;

                    CutLength.EndLocation = 10;

                    CutLength.DataBindEx();
                }

                if (!String.IsNullOrEmpty(Action))
                {
                    //给当前页面操作状态赋值
                    if (Action.ToLower().Equals("add"))
                    {
                        ViewState["ps"] = CommonEnum.PageState.ADD;
                    }
                    if (Action.ToLower().Equals("edit"))
                    {
                        ViewState["ps"] = CommonEnum.PageState.EDIT;
                    }
                }

                if ((CommonEnum.PageState)ViewState["ps"] == CommonEnum.PageState.EDIT)
                {
                    if (!String.IsNullOrEmpty(ID))
                    {
                        BindPage(ID);
                    }
                }
            }
        }