Esempio n. 1
0
        //Grid数据源
        protected void GridDataBind()
        {
            var erpFilialeId = ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID");
            //未付款:待审核,已审核,未通过,已执行; 已付款:完成打款;
            //已审核过的单据(排除ERP公司的单据)
            var list = _companyFundReceipt.GetAllCompanyFundReceiptList().Where(p => (new int?[] { (int)CompanyFundReceiptState.NoAuditing, (int)CompanyFundReceiptState.Audited, (int)CompanyFundReceiptState.Executed, (int)CompanyFundReceiptState.Finish }).Contains(p.ReceiptStatus) && p.ReceiptType.Equals(1) && !p.FilialeId.ToString().Contains(erpFilialeId.ToLower())).OrderBy(p => p.ApplyDateTime).AsQueryable();

            #region 查询条件
            if (!string.IsNullOrEmpty(ddl_SaleFiliale.SelectedValue))
            {
                list = list.Where(p => p.FilialeId.Equals(new Guid(ddl_SaleFiliale.SelectedValue)));
            }
            if (!string.IsNullOrEmpty(rcb_CompanyList.SelectedValue))
            {
                list = list.Where(p => p.CompanyID.Equals(new Guid(rcb_CompanyList.SelectedValue)));
            }
            if (!string.IsNullOrEmpty(txt_ApplyDateTimeStart.Text))
            {
                var startTime = DateTime.Parse(txt_ApplyDateTimeStart.Text);
                list = list.Where(p => p.ApplyDateTime >= startTime);
            }
            if (!string.IsNullOrEmpty(txt_ApplyDateTimeEnd.Text))
            {
                var endtime = DateTime.Parse(txt_ApplyDateTimeEnd.Text);
                list = list.Where(p => p.ApplyDateTime < endtime.AddDays(1));
            }
            if (!string.IsNullOrEmpty(txt_ReceipNo.Text))
            {
                list = list.Where(p => p.ReceiptNo.Equals(txt_ReceipNo.Text));
            }
            if (!string.IsNullOrEmpty(ddl_ReceiptStatus.SelectedValue))
            {
                list = list.Where(p => p.ReceiptStatus.Equals(int.Parse(ddl_ReceiptStatus.SelectedValue)));
            }
            if (!string.IsNullOrEmpty(dll_InvoiceType.SelectedValue))
            {
                list = list.Where(p => p.InvoiceType.Equals(int.Parse(dll_InvoiceType.SelectedValue)));
                if (!String.IsNullOrWhiteSpace(txtBillingUnit.Text))
                {
                    var invoiceId = _companyFundReceiptInvoice.GetAlllmshop_CompanyFundReceiptInvoice()
                                    .Where(ent => ent.BillingUnit.Contains(txtBillingUnit.Text)).Select(ent => ent.ReceiptID);
                    list = list.Where(ent => invoiceId.Contains(ent.ReceiptID));
                }
            }
            #endregion

            RG_ReceiptInvoice.DataSource = list.OrderByDescending(p => p.ApplyDateTime);
        }
Esempio n. 2
0
 /// <summary>
 /// 返回lmshop_CompanyFundReceiptInvoice表的所有数据
 /// </summary>
 /// <returns></returns>
 public List <CompanyFundReceiptInvoiceInfo> GetAlllmshop_CompanyFundReceiptInvoice()
 {
     return(_companyFundReceiptInvoiceDao.GetAlllmshop_CompanyFundReceiptInvoice());
 }