Exemple #1
0
        private void LoadDataGrid()
        {
            try
            {
                SalSuplStrategyBuilder sb = new SalSuplStrategyBuilder();

                string ProjectCode = this.sltSearchProject.Value.Trim();
                if (ProjectCode != "")
                {
                    sb.AddStrategy(new Strategy(SalSuplStrategyName.ProjectCode, ProjectCode));
                }

                string SuplCode = this.txtSearchSuplCode.Value.Trim();
                if (SuplCode != "")
                {
                    sb.AddStrategy(new Strategy(SalSuplStrategyName.SuplCode, SuplCode));
                }

                string SuplName = this.txtSearchSuplName.Value.Trim();
                if (SuplName != "")
                {
                    sb.AddStrategy(new Strategy(SalSuplStrategyName.SuplName, SuplName));
                }

                sb.AddOrder("SuplCode", true);

                string sql = sb.BuildMainQueryString();

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

//				EntityData entity = DAL.EntityDAO.SalDAO.GetSalSuplByProjectCode(this.txtProjectCode.Value);

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

                if (this.rbType.SelectedValue == "0")
                {
                    SalSuplStrategyBuilder sb = new SalSuplStrategyBuilder();

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

                    string SuplName = this.txtSearchSuplName.Value.Trim();
                    if (SuplName != "")
                    {
                        sb.AddStrategy(new Strategy(SalSuplStrategyName.SuplName, SuplName));
                    }

                    sb.AddOrder("SuplName", true);

                    string sql = sb.BuildMainQueryString();

                    QueryAgent qa     = new QueryAgent();
                    EntityData entity = qa.FillEntityData("SalSupl", sql);
                    tb = entity.CurrentTable;
                    qa.Dispose();
                    entity.Dispose();
                }
                else
                {
                    SupplierStrategyBuilder sb = new SupplierStrategyBuilder();

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

                    string SuplName = this.txtSearchSuplName.Value.Trim();
                    if (SuplName != "")
                    {
                        sb.AddStrategy(new Strategy(SupplierStrategyName.SupplierName, SuplName));
                    }

                    sb.AddOrder("SupplierName", true);

                    string sql = sb.BuildMainQueryString();

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

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