Exemple #1
0
        /// <summary>
        /// 显示付款单明细
        /// </summary>
        private void BindPayoutDataGrid()
        {
            try
            {
                string PaymentCode = this.txtPaymentCode.Value;

                PayoutItemStrategyBuilder sb = new PayoutItemStrategyBuilder("V_PayoutItem");
                sb.AddStrategy(new Strategy(PayoutItemStrategyName.PaymentCode, PaymentCode));
//				sb.AddStrategy( new Strategy( PayoutItemStrategyName.Status,"1"));
                sb.AddOrder("PayoutDate", true);
                sb.AddOrder("PayoutItemCode", true);
                string sql = sb.BuildMainQueryString();

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

                DataTable tb = entity.CurrentTable;
                BLL.PaymentRule.VoucherDetailAddColumnSubjectName(tb, this.txtSubjectSetCode.Value);

                this.dgPayoutItem.Columns[4].FooterText = BLL.MathRule.SumColumn(tb, "PayoutCash").ToString("N");
                this.dgPayoutItem.DataSource            = tb;
                this.dgPayoutItem.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示列表出错:" + ex.Message));
            }
        }
Exemple #2
0
        private void LoadDataGrid()
        {
            try
            {
                PayoutItemStrategyBuilder sb = new PayoutItemStrategyBuilder("V_PayoutItem");
                sb.AddStrategy(new Strategy(PayoutItemStrategyName.ProjectCode, txtProjectCode.Value));

                if (this.ParamCostBudgetSetCode != "")
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.CostBudgetSetCode, this.ParamCostBudgetSetCode));
                }

                if (this.ParamCostCode != "")
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.CostCodeIncludeAllChild, this.ParamCostCode));
                }

                if (this.ParamSubjectCode != "")
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.SubjectCodeIncludeAllChild, this.ParamSubjectCode));
                }

                if (this.ParamContractCode != "")
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.ContractCode, this.ParamContractCode));
                }

                if (this.ParamPaymentCode != "")
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.PaymentCode, this.ParamPaymentCode));
                }

                if (this.ParamIsContract != "")
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.IsContract, this.ParamIsContract));
                }

                if ((this.ParamPBSType != "") || (this.ParamPBSCode != ""))
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.PBSTypeAndCode, this.ParamPBSType, this.ParamPBSCode));
                }

                if (this.ParamPayoutDateBegin != "" || this.ParamPayoutDateEnd != "")
                {
                    ArrayList ar = new ArrayList();
                    ar.Add(this.ParamPayoutDateBegin);
                    ar.Add(this.ParamPayoutDateEnd);
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.PayoutDateRange, ar));
                }

                //已审
                if (BLL.PaymentRule.IsPayoutMoneyIncludeNotCheck == 0)
                {
                    sb.AddStrategy(new Strategy(PayoutItemStrategyName.Status, "1,2"));
                }

                //排序
                string sortsql = BLL.GridSort.GetSortSQL(ViewState);
                if (sortsql == "")
                {
                    //缺省排序
                    sb.AddOrder("PayoutDate", true);
                    sb.AddOrder("PayoutCode", true);
                }

                string sql = sb.BuildMainQueryString();

                if (sortsql != "")
                {
                    //点列标题排序
                    sql = sql + " order by " + sortsql;
                }

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

                string[]  arrField = { "PayoutMoney" };
                decimal[] arrSum   = BLL.MathRule.SumColumn(entity.CurrentTable, arrField);
                ViewState["SumMoney"]  = arrSum[0].ToString("N");
                this.dgList.DataSource = entity.CurrentTable;
                this.dgList.DataBind();

                this.GridPagination1.RowsCount = entity.CurrentTable.Rows.Count.ToString();

                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示列表出错:" + ex.Message));
            }
        }