Ejemplo n.º 1
0
        private void LoadDataGrid()
        {
            try
            {
                UFProjectStrategyBuilder sb = new UFProjectStrategyBuilder();

                string UFProjectName = this.txtSearchUFProjectName.Value.Trim();
                if (UFProjectName != "")
                {
                    sb.AddStrategy(new Strategy(UFProjectStrategyName.UFProjectName, UFProjectName));
                }

                sb.AddOrder("UFProjectName", true);

                string sql = sb.BuildMainQueryString();

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("UFProject", sql);
                qa.Dispose();

                dgList.DataSource = entity;
                dgList.DataBind();
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示列表出错:" + ex.Message));
            }
        }
Ejemplo n.º 2
0
        private void LoadDataGrid(bool isEmpty)
        {
            try
            {
                DataTable tb;

                UFProjectStrategyBuilder sb = new UFProjectStrategyBuilder();

                if (isEmpty)
                {
                    sb.AddStrategy(new Strategy(UFProjectStrategyName.False));
                }

                string UFProjectName = this.txtSearchUFProjectName.Value.Trim();
                if (UFProjectName != "")
                {
                    sb.AddStrategy(new Strategy(UFProjectStrategyName.UFProjectName, UFProjectName));
                }

                sb.AddOrder("UFProjectName", true);

                string sql = sb.BuildMainQueryString();

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("UFProject", sql);
                tb = entity.CurrentTable;
                qa.Dispose();
                entity.Dispose();

                dgList.DataSource = tb;
                dgList.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }