Exemple #1
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindGridView()
        {
            BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL();
            DataSet           ds  = new DataSet();


            ds = bll.GetList("");
            if (ds.Tables.Count > 0)
            {
                DataTable outDT = ds.Tables[0].Copy();
                outDT.Clear();
                Recursion(ds.Tables[0], 0, 0, ref outDT);
                ds.Tables.Clear();
                ds.Tables.Add(outDT);

                if (ViewState["sqlwhere"] != null && !String.IsNullOrEmpty(ViewState["sqlwhere"].ToString()))
                {
                    if (ds.Tables.Count > 0)
                    {
                        DataView dv = ds.Tables[0].Copy().DefaultView;

                        dv.RowFilter = ViewState["sqlwhere"].ToString();
                        if (dv.Count != ds.Tables[0].Rows.Count)
                        {
                            ds.Tables[0].Clear();
                            ds.Tables.RemoveAt(0);
                            ds.Tables.Add(dv.ToTable());
                        }
                    }
                }

                List <string> l1 = new List <string>();
                l1.Add("Title");
                l1.Add("FilePath");
                //l1.Add("JS");
                //l1.Add("SG");
                //l1.Add("SJ");
                //l1.Add("JL");
                //l1.Add("NeedArchive");
                //l1.Add("IsFolder");
                //l1.Add("archive_form_name");
                l1.Add("OrderIndex");
                //ctrlGridEx1.PageCount = Common.ConvertEx.ToInt(Common.Session.GetSession("PageCount"));
                ctrlGridEx1.InitGrid("CellID", l1, ds, "~/SystemManage/CellListAdd.aspx?Action=edit");
            }
        }
Exemple #2
0
        private void InitComboxParent()
        {
            BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL();
            DataSet           ds  = new DataSet();

            ds = bll.GetList("");
            if (ds.Tables.Count > 0)
            {
                DataTable outDT = ds.Tables[0].Copy();
                outDT.Clear();
                Recursion(ds.Tables[0], 0, 0, ref outDT);

                DataRow newRow = outDT.NewRow();
                newRow["CellID"] = "0";
                newRow["Title"]  = "无父类";
                outDT.Rows.InsertAt(newRow, 0);

                PID.DataTextField  = "Title";
                PID.DataValueField = "CellID";
                PID.DataSource     = outDT;
                PID.DataBind();
            }
        }