//constructor public ScheduleExcelBuilder(string Itemid, SheduleReportModel shedulemodel, string FileName, string Conn) { if (shedulemodel == null) { throw new ArgumentNullException("SheduleReportModel is null"); } _ViewModel = shedulemodel; if (string.IsNullOrEmpty(Conn)) { throw new ArgumentNullException("connection"); } connection = Conn; de = new DataEntry(connection); db = new SBPayrollDBEntities(connection); rep = new Repository(connection); if (Itemid == null) { throw new ArgumentNullException("Itemid is null"); } _Itemid = Itemid; sFileExcel = FileName; }
public bool ShowShedule(string app, string itemid, SheduleReportModel model, string sFilePDF) { bRet = false; if ("pdf".Equals(app)) { try { ShedulePDFBuilder smaker = new ShedulePDFBuilder(itemid, model, sFilePDF, connection); smaker.GetshedulePDF(); return(true); } catch (Exception ex) { Utils.ShowError(ex); return(false); } } else //application is excel { try { ScheduleExcelBuilder schExcelBuilder = new ScheduleExcelBuilder(itemid, model, sFilePDF, connection); schExcelBuilder.GetExcel(); return(true); } catch (Exception ex) { Utils.ShowError(ex); return(false); } } }