public ActionResult IVS284_SearchData(doIVS284SearchCondition searchParam) { IVS284_ScreenParameter param = GetScreenObject <IVS284_ScreenParameter>(); ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.WARNING; try { if (searchParam == null || CommonUtil.IsNullAllField(searchParam)) { res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0006); } else { IInventoryHandler service = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler; var lst = service.GetStockReport_InprocessToInstall(searchParam); param.LastSearchParam = searchParam; res.ResultData = CommonUtil.ConvertToXml(lst, @"Inventory\IVS284_SearchResult", CommonUtil.GRID_EMPTY_TYPE.VIEW); } } catch (Exception ex) { res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); } return(Json(res)); }
/// <summary> /// Checking user's permission. /// </summary> /// <param name="param">Screen's parameter.</param> /// <returns>Return ActionResult of the screen.</returns> public ActionResult IVS284_Authority(IVS284_ScreenParameter param) { ObjectResultData res = new ObjectResultData(); try { ICommonHandler srvCommon = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; if (srvCommon.IsSystemSuspending()) { res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0049); //res.ResultData = MessageUtil.MessageList.MSG0049.ToString(); return(Json(res)); } if (!CheckUserPermission(ScreenID.C_INV_SCREEN_ID_IN_STOCK_REPORT, FunctionID.C_FUNC_ID_OPERATE)) { res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053); //res.ResultData = MessageUtil.MessageList.MSG0053.ToString(); return(Json(res)); } } catch (Exception ex) { res.AddErrorMessage(ex); } return(InitialScreenEnvironment <IVS284_ScreenParameter>("IVS284", param, res)); }
public ActionResult IVS284_Download() { IVS284_ScreenParameter param = GetScreenObject <IVS284_ScreenParameter>(); if (!string.IsNullOrEmpty(param.PendingDownloadFilePath)) { var stream = new FileStream(param.PendingDownloadFilePath, FileMode.Open, FileAccess.Read); param.PendingDownloadFilePath = null; return(File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", param.PendingDownloadFileName)); } else { ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(new FileNotFoundException("Report file not found.", param.PendingDownloadFilePath)); return(Json(res)); } }
public ActionResult IVS284_GenerateReportSummary(doIVS284SearchCondition reportParam) { IVS284_ScreenParameter param = GetScreenObject <IVS284_ScreenParameter>(); ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.WARNING; try { if (reportParam == null || reportParam.ContractCodeSelected == null || reportParam.ContractCodeSelected.Length == 0) { res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0006); } else { if (param.LastSearchParam == null) { param.LastSearchParam = reportParam; } IInventoryHandler service = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler; var lst = service.GetStockReport_InprocessToInstall(new doIVS284SearchCondition() { ReportType = param.LastSearchParam.ReportType, ContractCode = null, ContractCodeSelected = reportParam.ContractCodeSelected, YearMonth = reportParam.YearMonth, }); IInventoryDocumentHandler docService = ServiceContainer.GetService <IInventoryDocumentHandler>() as IInventoryDocumentHandler; param.PendingDownloadFilePath = docService.GenerateIVS284InprocessToInstallReportSummary(param.LastSearchParam.ReportType, lst, param.LastSearchParam); param.PendingDownloadFileName = "InprocessToInstallReport.xlsx"; res.ResultData = true; } } catch (Exception ex) { res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); } return(Json(res)); }
public ActionResult IVS284_GetDetail(doIVS284SearchCondition searchParam) { IVS284_ScreenParameter param = GetScreenObject <IVS284_ScreenParameter>(); ObjectResultData res = new ObjectResultData(); res.MessageType = MessageModel.MESSAGE_TYPE.WARNING; try { IInventoryHandler service = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler; var lst = service.GetStockReport_InprocessToInstall_Detail(searchParam); param.LastSearchParam = searchParam; res.ResultData = CommonUtil.ConvertToXml(lst, @"Inventory\IVS284_Detail", CommonUtil.GRID_EMPTY_TYPE.VIEW); } catch (Exception ex) { res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION; res.AddErrorMessage(ex); } return(Json(res)); }