public List <ProductMovementDTO> Get_List_StokHareketListesi(CaseReportFilter filter) { using (var _db = new MspDbContext()) { return(base.Map <List <ProductMovement>, List <ProductMovementDTO> >(_db.ProductMovement.Where(x => x.Deleted == false && x.Date >= filter.BeginDate && x.Date <= filter.EndDate && x.ProductId >= filter.BeginProduct && x.ProductId <= filter.EndProduct).ToList())); } }
public List <CaseBakiyeReportDTO> Get_List_CaseBakiyeReport(CaseReportFilter filter) { using (var _db = new MspDbContext()) { string _sql = "Select SUM(Case When IslemTuru = 1 then Tutar else 0 end) as DonemGelir, SUM(Case When IslemTuru = 2 then Tutar else 0 end) as DonemGider, " + " SUM(Case When IslemTuru = 2 then Tutar else 0 end) -SUM(Case When IslemTuru = 1 then Tutar else 0 end) as SonBakiye , CaseDefinition.CaseName " + " from CaseMovement " + " Inner Join CaseDefinition on CaseDefinition.RecId = CaseMovement.CaseId " + "where Deleted = 0 and RecordDate >= @BeginDate and RecordDate <= @EndDate and CaseId = @CaseId" + " Group By CaseDefinition.CaseName"; var _param = new SqlParameter[] { new SqlParameter { ParameterName = "BeginDate", Value = filter.BeginDate }, new SqlParameter { ParameterName = "EndDate", Value = filter.EndDate }, new SqlParameter { ParameterName = "CaseId", Value = filter.CaseId } }; return(_db.Database.SqlQuery <CaseBakiyeReportDTO>(_sql, _param.ToArray()).ToList()); } }
public void do_report_Grid() { try { var filter = new CaseReportFilter { companyId = AppMain.CompanyRecId, BeginDate = dt_BaslangicDate.DateTime, EndDate = new DateTime(dt_BitisDate.DateTime.Year, dt_BitisDate.DateTime.Month, dt_BitisDate.DateTime.Day, 23, 59, 0), CaseId = Convert.ToInt32(lc_Case.EditValue) }; if (FormType == 1) { List <CaseBakiyeReportDTO> caseBakiye = _repository.Run <ReportService, List <CaseBakiyeReportDTO> >(x => x.Get_List_CaseBakiyeReport(filter)); bs_CaseBakiye.DataSource = caseBakiye; gc_KasaBakiye.RefreshDataSource(); } if (FormType == 2) { List <CaseMovementDTO> caseMovements = _repository.Run <ReportService, List <CaseMovementDTO> >(x => x.Get_List_CaseMovement(filter)); bs_CaseList.DataSource = caseMovements; gc_KasaHareket.RefreshDataSource(); } } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } }
public List <CaseMovementDTO> Get_List_CaseMovement(CaseReportFilter filter) { using (var _db = new MspDbContext()) { return(base.Map <List <CaseMovement>, List <CaseMovementDTO> >(_db.CaseMovement.Where(x => x.Deleted == false && x.CompanyRecId == filter.companyId && x.RecordDate >= filter.BeginDate && x.RecordDate <= filter.EndDate && x.CaseId == filter.CaseId).ToList())); } }
public void do_report() { try { var filter = new CaseReportFilter { companyId = AppMain.CompanyRecId, BeginDate = dt_BaslangicDate.DateTime, EndDate = dt_BitisDate.DateTime, CaseId = Convert.ToInt32(lc_Case.EditValue) }; if (FormType == 1) { List <CaseBakiyeReportDTO> caseBakiye = _repository.Run <ReportService, List <CaseBakiyeReportDTO> >(x => x.Get_List_CaseBakiyeReport(filter)); bs_CaseBakiye.DataSource = caseBakiye; gc_KasaBakiye.RefreshDataSource(); if (caseBakiye.Count > 0) { frmPrint frm = new frmPrint(); frm.PrintCaseBakiye(caseBakiye); frm.ShowDialog(); } } if (FormType == 2) { List <CaseMovementDTO> caseMovements = _repository.Run <ReportService, List <CaseMovementDTO> >(x => x.Get_List_CaseMovement(filter)); bs_CaseList.DataSource = caseMovements; gc_KasaHareket.RefreshDataSource(); if (caseMovements.Count > 0) { frmPrint frm = new frmPrint(); frm.PrintKasaHareketRaporu(caseMovements); frm.ShowDialog(); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } }
private void do_report() { try { var filter = new CaseReportFilter { companyId = AppMain.CompanyRecId, BeginDate = dt_BaslangicDate.DateTime, EndDate = dt_BitisDate.DateTime, }; List <ProductMovementDTO> productMovements = _repository.Run <ReportService, List <ProductMovementDTO> >(x => x.Get_List_StokHareketListesi(filter)); if (productMovements.Count > 0) { //frmPrint frm = new frmPrint(); //frm.PrintKasaHareketRaporu(caseMovements); //frm.ShowDialog(); } } catch (Exception ex) { } }