public IHttpActionResult Update(int id, DTO.WarehouseImportMng.WarehouseImport dtoItem) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanUpdate)) { // edit case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } else if (id == 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanCreate)) { // create new case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } // validation if (!Helper.CommonHelper.ValidateDTO <DTO.WarehouseImportMng.WarehouseImport>(dtoItem, out notification)) { return(InternalServerError(new Exception(notification.Message))); } // continue processing BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); bll.UpdateData(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.WarehouseImportMng.WarehouseImport>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult WexInputData(List <DTO.WarehouseImportMng.WexInputData> wexData) { Library.DTO.Notification notification = new Library.DTO.Notification(); BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); int?warehouseImportID = bll.ImportCSVFileToWarehouseImport(wexData, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <int?>() { Data = warehouseImportID, Message = notification })); }
public IHttpActionResult GetExportWexData(int warehouseImportID) { BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); Library.DTO.Notification notification; List <DTO.WarehouseImportMng.ExportToWexData> data = bll.GetExportWexData(ControllerContext.GetAuthUserId(), warehouseImportID, out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.WarehouseImportMng.ExportToWexData> >() { Data = data, Message = notification, TotalRows = data.Count() })); }
public IHttpActionResult QuickSearchLoadingPlan(DTO.Search searchInput) { BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); Library.DTO.Notification notification; int totalRows = 0; List <DTO.Support.LoadingPlan> data = bll.QuickSearchLoadingPlan(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.Support.LoadingPlan> >() { Data = data, Message = notification, TotalRows = totalRows })); }
public IHttpActionResult GetSearchSupport(DTO.Search searchInput) { BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); Library.DTO.Notification notification; int totalRows = 0; DTO.WarehouseImportMng.SearchFormData data = bll.GetSearchSupport(out notification); return(Ok(new Library.DTO.ReturnData <DTO.WarehouseImportMng.SearchFormData>() { Data = data, Message = notification, TotalRows = totalRows })); }
public IHttpActionResult Get(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); Library.DTO.Notification notification; DTO.WarehouseImportMng.EditFormData data = bll.GetData(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.WarehouseImportMng.EditFormData>() { Data = data, Message = notification, TotalRows = 0 })); }
public IHttpActionResult CreateWexCSVFile(int warehouseImportID) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanPrint)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); string data = bll.CreateWexCSVFile(ControllerContext.GetAuthUserId(), warehouseImportID, out notification); return(Ok(new Library.DTO.ReturnData <string>() { Data = data, Message = notification })); }
public IHttpActionResult Delete(int id) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanDelete)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); bll.DeleteData(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <int>() { Data = id, Message = notification })); }
public IHttpActionResult Gets(DTO.Search searchInput) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); Library.DTO.Notification notification; int totalRows = 0; DTO.WarehouseImportMng.SearchFormData data = bll.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification); return(Ok(new Library.DTO.ReturnData <DTO.WarehouseImportMng.SearchFormData>() { Data = data, Message = notification, TotalRows = totalRows })); }
public IHttpActionResult Reset(int id, DTO.WarehouseImportMng.WarehouseImport dtoItem) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), getModuleCode(), Library.DTO.ModuleAction.CanReset)) { // edit case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } // continue processing BLL.WarehouseImportMng bll = new BLL.WarehouseImportMng(); bll.Reset(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.WarehouseImportMng.WarehouseImport>() { Data = dtoItem, Message = notification })); }