public IHttpActionResult GetModelInfo(int modelID) { BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; DTO.OfferMng.Model data = bll.GetModelInfo(modelID, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.Model>() { Data = data, Message = notification })); }
public IHttpActionResult GetModelSparepart(int modelID) { BLL.OfferMng bll = new BLL.OfferMng(); IEnumerable <DTO.Support.ModelSparepart> data = bll.GetModelSparepart(modelID); return(Ok(new Library.DTO.ReturnData <IEnumerable <DTO.Support.ModelSparepart> >() { Data = data })); }
public IHttpActionResult ApproveAllItem(int id) { BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; bool result = bll.ApproveAllItem(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <bool>() { Data = result, Message = notification })); }
public IHttpActionResult GetSupportData() { BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; DTO.OfferMng.SupportDataContainer result = bll.GetSupportData(out notification); return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.SupportDataContainer>() { Data = result, Message = notification, TotalRows = 0 })); }
public IHttpActionResult UploadOfferScanFile(int offerID, string newOfferScanFile, string offerScanFile) { DTO.OfferMng.Offer dtoOffer; Library.DTO.Notification notification; BLL.OfferMng bll = new BLL.OfferMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); bll.UploadOfferScanFile(offerID, true, newOfferScanFile, offerScanFile, out dtoOffer, out notification); return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.Offer>() { Data = dtoOffer, Message = notification })); }
public IHttpActionResult GetOfferLineSalePriceHistory(int id, string season) { BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; DTO.OfferMng.PriceHistory Data = bll.GetOfferLineSalePriceHistory(ControllerContext.GetAuthUserId(), season, id, out notification); if (notification.Type != Library.DTO.NotificationType.Success) { return(InternalServerError(new Exception(notification.Message))); } return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.PriceHistory>() { Data = Data, Message = notification })); }
public IHttpActionResult GetPlaningPurchasingPrice2(object param) // param: DTO.OfferMng.PlanningPurchasingPriceParamDTO { BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; List <DTO.OfferMng.PlaningPurchasingPriceDTO> Data = bll.GetPlaningPurchasingPrice(ControllerContext.GetAuthUserId(), param, out notification); if (notification.Type != Library.DTO.NotificationType.Success) { return(InternalServerError(new Exception(notification.Message))); } return(Ok(new Library.DTO.ReturnData <List <DTO.OfferMng.PlaningPurchasingPriceDTO> >() { Data = Data, Message = notification })); }
public IHttpActionResult GetPrintDataOfferPP2013(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanPrint)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); string reportFileName = bll.GetPrintDataOfferPP2013(id, ControllerContext.GetAuthUserId(), out Library.DTO.Notification notification); return(Ok(new Library.DTO.ReturnData <string>() { Data = reportFileName, Message = notification })); }
public IHttpActionResult Delete(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanDelete)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; bll.DeleteData(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <int>() { Data = id, Message = notification })); }
public IHttpActionResult SendEmailNotificationByApproveOfferPermission(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanApprove)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; object data = bll.SendEmailNotificationByApproveOfferPermission(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <object>() { Data = data, Message = notification })); }
public IHttpActionResult Revise(int id, int actionType, DTO.OfferMng.Offer dtoItem) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanApprove)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; bll.Revise(id, actionType, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.Offer>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult GetExcelFOBItemOnlyReportData(DTO.Search searchInput) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanPrint)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); string reportFileName = bll.ExportExcelSearchOffer(searchInput.Filters, out notification); return(Ok(new Library.DTO.ReturnData <string>() { Data = reportFileName, Message = notification })); }
public IHttpActionResult SearchOfferLine(int offerID) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; int totalRows = 0; IEnumerable <DTO.OfferMng.OfferLine> offerLineData = bll.SearchOfferLines(offerID, ControllerContext.GetAuthUserId(), out totalRows, out notification); return(Ok(new Library.DTO.ReturnData <IEnumerable <DTO.OfferMng.OfferLine> >() { Data = offerLineData, Message = notification, TotalRows = totalRows })); }
public IHttpActionResult QuickSearchSampleProduct(DTO.Search searchInput) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; int totalRows = 0; IEnumerable <DTO.OfferMng.SampleProductSearchResultDTO> result = bll.QuickSearchSampleProduct(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification); return(Ok(new Library.DTO.ReturnData <IEnumerable <DTO.OfferMng.SampleProductSearchResultDTO> >() { Data = result, Message = notification, TotalRows = totalRows })); }
public IHttpActionResult Get(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; DTO.OfferMng.DataContainer data = bll.GetDataContainer(id, ControllerContext.GetAuthUserId(), out notification); //foreach (var item in data.OfferData.OfferLines) //{ // item.ProductThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + item.ProductThumbnailLocation; // item.ProductFileLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["FileUrl"] + item.ProductFileLocation; //} return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.DataContainer>() { Data = data, Message = notification })); }
public IHttpActionResult Update(int id, int actionType, DTO.OfferMng.Offer dtoItem) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate)) { // edit case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } else if (id == 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate)) { // create new case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } // validation if (!Helper.CommonHelper.ValidateDTO <DTO.OfferMng.Offer>(dtoItem, out notification)) { return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.Offer>() { Data = dtoItem, Message = notification })); } // continue processing BLL.OfferMng bll = new BLL.OfferMng(); bll.UpdateData(id, actionType, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.Offer>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult GetOfferLineEdit(int offerLineID) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.OfferMng bll = new BLL.OfferMng(); Library.DTO.Notification notification; DTO.OfferMng.OfferLineEdit data = bll.GetOfferLineEdit(offerLineID, ControllerContext.GetAuthUserId(), out notification); data.MaterialThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + data.MaterialThumbnailLocation; data.FrameMaterialThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + data.FrameMaterialThumbnailLocation; data.SubMaterialColorThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + data.SubMaterialColorThumbnailLocation; data.CushionColorThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + data.CushionColorThumbnailLocation; data.BackCushionThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + data.BackCushionThumbnailLocation; data.SeatCushionThumbnailLocation = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["ThumbnailUrl"] + data.SeatCushionThumbnailLocation; return(Ok(new Library.DTO.ReturnData <DTO.OfferMng.OfferLineEdit>() { Data = data, Message = notification })); }