protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { State = CompanyFundReceiptState.NoHandle; InvoicesDemander = Guid.Empty; ReceiptNo = string.Empty; IList <CompanyFundReceiptInfo> list = _companyFundReceipt.GetAllFundReceiptInfoList(Guid.Empty, ReceiptPage.Else, State, StartTime, EndTime, string.Empty, CompanyFundReceiptType.All); if (list.Count > 0) { BankIds = list.Where(ent => ent.PayBankAccountsId != Guid.Empty).Select(ent => ent.PayBankAccountsId).ToList(); } RG_CheckInfo.DataSource = list; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ReceiptNo = string.Empty; Status = CompanyFundReceiptState.NoHandle; IList <CompanyFundReceiptInfo> list = _companyFundReceipt.GetAllFundReceiptInfoList(Guid.Empty, ReceiptPage.DemandReceipt, CompanyFundReceiptState.GettingInvoice, StartTime, EndTime, "", CompanyFundReceiptType.Payment); List <Guid> companyList = _companyCussent.GetCompanyCussentList(State.Enable).Where(c => c.IsNeedInvoices).Select(c => c.CompanyId).ToList(); var newList = list.Where(c => companyList.Contains(c.CompanyID)).ToList(); ShowFooterText(newList); if (newList.Count > 0) { BankIds = newList.Where(ent => ent.PayBankAccountsId != Guid.Empty).Select(ent => ent.PayBankAccountsId).ToList(); } RG_CheckInfo.DataSource = newList; } }
protected void RgCheckInfoNeedDataSource(object source, GridNeedDataSourceEventArgs e) { IList <CompanyFundReceiptInfo> list = _companyFundReceipt.GetAllFundReceiptInfoList(new Guid(SelectSaleFilialeId), ReceiptPage.DoReceivePay, Status, StartTime, EndTime, ReceiptNo, Type).ToList(); if (BankId != Guid.Empty) { list = list.Where(ent => ent.PayBankAccountsId == BankId).ToList(); } if (SExecuteTime != DateTime.MinValue) { list = list.Where(c => c.ExecuteDateTime >= SExecuteTime).ToList(); } if (EExecuteTime != DateTime.MaxValue) { list = list.Where(c => c.ExecuteDateTime < EExecuteTime).ToList(); } if (list.Count != 0) { CompanyFundReceiptsList = list; } if (list.Count > 0) { BankIds = list.Where(ent => ent.PayBankAccountsId != Guid.Empty).Select(ent => ent.PayBankAccountsId).ToList(); } //合计金额 var sum = RG_CheckInfo.MasterTableView.Columns.FindByUniqueName("RealityBalance"); if (list.Count > 0) { var realityBalanceSum = list.Sum(ent => Math.Abs(ent.RealityBalance)); sum.FooterText = string.Format("合计:{0}", WebControl.NumberSeparator(realityBalanceSum)); } else { sum.FooterText = string.Empty; } RG_CheckInfo.DataSource = list; }
//Grid数据源 protected void GridDataBind() { List <CompanyFundReceiptInfo> list = _companyFundReceipt.GetAllFundReceiptInfoList(new Guid(SelectSaleFilialeId), ReceiptPage.PayCheckList, Status, StartTime, EndTime, ReceiptNo, CompanyFundReceiptType.Payment).ToList(); if (RT_CompanyClass.SelectedNode != null) { RadTreeNode currentNode = RT_CompanyClass.SelectedNode; //门店类型节点与店铺节点选择时数据绑定 //modify by liangcanren at 2015-03-16 var isShopJoinType = currentNode.Value.Length == Guid.Empty.ToString().Length; var companyClassId = isShopJoinType ? new Guid(currentNode.Value) : Guid.Empty; var shopList = CacheCollection.Filiale.GetShopList(); if (!isShopJoinType) { shopList = shopList.Where(act => string.Format("{0}", act.ShopJoinType) == currentNode.Value).ToList(); if (shopList.Count != 0) { list = list.Where(c => shopList.Any(act => act.ID == c.CompanyID)).ToList(); } } else { if (shopList.Any(act => act.ID == companyClassId)) { list = list.Where(c => c.CompanyID == companyClassId).ToList(); } else { if (companyClassId != Guid.Empty) { List <Guid> companylist = _companyCussent.GetCompanyCussentList(companyClassId).Select(cl => cl.CompanyId).ToList(); list = list.Where(c => companylist.Contains(c.CompanyID)).ToList(); } } } } if (BankId != Guid.Empty) { list = list.Where(ent => ent.PayBankAccountsId == BankId).ToList(); } if (PayType != -1) { if (PayType == 0) { list = list.Where(c => string.IsNullOrEmpty(c.PurchaseOrderNo) && string.IsNullOrEmpty(c.StockOrderNos) && c.SettleEndDate != DateTime.Parse("1999-09-09")).ToList(); } if (PayType == 1) { list = list.Where(c => !string.IsNullOrEmpty(c.StockOrderNos)).ToList(); } if (PayType == 2) { list = list.Where(c => !string.IsNullOrEmpty(c.PurchaseOrderNo)).ToList(); } if (PayType == 3) { list = list.Where(c => string.IsNullOrEmpty(c.PurchaseOrderNo) && string.IsNullOrEmpty(c.StockOrderNos) && c.SettleStartDate == DateTime.Parse("1999-09-09")).ToList(); } if (PayType == 4) { list = list.Where(ent => ent.SettleStartDate == DateTime.Parse("1999-09-09")).ToList(); } } if (!string.IsNullOrEmpty(txt_PaymentDate.Text)) { list = list.Where(p => Convert.ToDateTime(p.PaymentDate).ToString("yyyy-MM").Equals(txt_PaymentDate.Text)).ToList(); } if (!string.IsNullOrEmpty(RCB_CompanyList.SelectedValue)) { list = list.Where(p => p.CompanyID.Equals(new Guid(RCB_CompanyList.SelectedValue))).ToList(); } if (!string.IsNullOrEmpty(rcb_Applicant.SelectedValue) && !rcb_Applicant.SelectedValue.Equals(Guid.Empty.ToString())) { list = list.Where(p => p.ApplicantID.Equals(new Guid(rcb_Applicant.SelectedValue))).ToList(); } //合计金额 var sum = RG_CheckInfo.MasterTableView.Columns.FindByUniqueName("RealityBalance"); if (list.Count > 0) { var realityBalanceSum = list.Sum(ent => Math.Abs(ent.RealityBalance)); sum.FooterText = string.Format("合计:{0}", WebControl.NumberSeparator(realityBalanceSum)); } else { sum.FooterText = string.Empty; } RG_CheckInfo.DataSource = list; }