public ActionResult PrintAllPreview(FormCollection form, int?quan, int TuyenID, int month, int year) { setPrintCircumstance((int)PrintModeEnum.PRINT_ALL); updateAllHoaDon(quan, TuyenID.ToString(), month, year); String formPrintMachine = form["printMachine"]; Stream str = null; if (formPrintMachine == "LQ2190") { Factory.ReportLP2190 report = new Factory.ReportLP2190(); str = report.generateReportPrintAllPreview(TuyenID, month, year); } else if (formPrintMachine == "LX2170") { Factory.ReportLX2170 report = new Factory.ReportLX2170(); str = report.generateReportPrintAllPreview(TuyenID, month, year); } else { Factory.ReportTallyGenicom report = new Factory.ReportTallyGenicom(); str = report.generateReportPrintAllPreview(TuyenID, month, year); } return(File(str, "application/pdf")); }
public ActionResult PrintSelected(FormCollection form, int?quan, int TuyenID, int month, int year) { String[] selectedReceipt = form["printSelectedHidden"].Split(','); String[] selectedForm = LichSuHoaDon.sortLichSuHoaDonByTTDoc(selectedReceipt); setPrintCircumstance((int)PrintModeEnum.PRINT_SELECTED); updateSoHoaDonBasedOnSituation(quan, TuyenID.ToString(), month, year, selectedForm); String formPrintMachine = form["printMachine"]; Stream str = null; if (formPrintMachine == "LQ2190") { Factory.ReportLP2190 report = new Factory.ReportLP2190(); str = report.generateReportPrintSelected(selectedForm, TuyenID, month, year); } else if (formPrintMachine == "LX2170") { Factory.ReportLX2170 report = new Factory.ReportLX2170(); str = report.generateReportPrintSelected(selectedForm, TuyenID, month, year); } else { Factory.ReportTallyGenicom report = new Factory.ReportTallyGenicom(); str = report.generateReportPrintSelected(selectedForm, TuyenID, month, year); } return(File(str, "application/pdf")); }
public ActionResult PrintFromTo(FormCollection form, int?quan, int TuyenID, int month, int year) { setPrintCircumstance((int)PrintModeEnum.PRINT_FROM_RECEIPT_TO_RECEIPT); int count = db.Lichsuhoadons.Count(p => p.TuyenKHID == TuyenID && p.ThangHoaDon == month && p.NamHoaDon == year); Tuyenkhachhang tuyenKH = db.Tuyenkhachhangs.Find(TuyenID); int fromSoHoaDon = String.IsNullOrEmpty(form["from"]) ? 1 : Convert.ToInt16(form["from"]); int toSoHoaDon = String.IsNullOrEmpty(form["to"]) ? count : Convert.ToInt16(form["to"]); updateFromReceiptToReceipt(quan, TuyenID.ToString(), month, year, fromSoHoaDon, toSoHoaDon); List <LichSuHoaDon> danhSachHoaDons = GetDanhSachHoaDons(TuyenID, month, year); if (toSoHoaDon >= danhSachHoaDons.Count) { toSoHoaDon = danhSachHoaDons.Count(); } String formPrintMachine = form["printMachine"]; Stream str = null; if (formPrintMachine == "LQ2190") { Factory.ReportLP2190 report = new Factory.ReportLP2190(); str = report.generateReportPrintFromTo(fromSoHoaDon, toSoHoaDon, TuyenID, month, year, tuyenKH); } else if (formPrintMachine == "LX2170") { Factory.ReportLX2170 report = new Factory.ReportLX2170(); str = report.generateReportPrintFromTo(fromSoHoaDon, toSoHoaDon, TuyenID, month, year, tuyenKH); } else { Factory.ReportTallyGenicom report = new Factory.ReportTallyGenicom(); str = report.generateReportPrintFromTo(fromSoHoaDon, toSoHoaDon, TuyenID, month, year, tuyenKH); } return(File(str, "application/pdf")); }