public IHttpActionResult GetExcelForecastReportData(string s)
        {
            Library.DTO.Notification notification;

            // 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)));
            }

            if (string.IsNullOrEmpty(s))
            {
                return(InternalServerError(new Exception("Invalid season!")));
            }

            BLL.GrossMarginSummaryRpt bll = new BLL.GrossMarginSummaryRpt();
            string dataFileName           = bll.GetExcelForecastReportData(ControllerContext.GetAuthUserId(), s, out notification);

            if (notification.Type == Library.DTO.NotificationType.Error)
            {
                return(InternalServerError(new Exception(notification.Message)));
            }
            return(Ok(new Library.DTO.ReturnData <string>()
            {
                Data = dataFileName, Message = notification
            }));
        }
Exemple #2
0
        public IHttpActionResult Approve(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.CanApprove))
            {
                // edit 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.Approve(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification);

            return(Ok(new Library.DTO.ReturnData <DTO.WarehouseImportMng.WarehouseImport>()
            {
                Data = dtoItem, Message = notification
            }));
        }
Exemple #3
0
        public IHttpActionResult ConfirmInvoice(int id, bool isConfirmed)
        {
            // authentication
            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            if (isConfirmed)
            {
                if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanApprove))
                {
                    return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
                }
            }
            else
            {
                if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanReset))
                {
                    return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
                }
            }

            BLL.ECommercialInvoiceMng bll = new BLL.ECommercialInvoiceMng();
            Library.DTO.Notification  notification;
            bll.ConfirmInvoice(id, isConfirmed, ControllerContext.GetAuthUserId(), out notification);

            return(Ok(new Library.DTO.ReturnData <int>()
            {
                Data = id, Message = notification
            }));
        }
Exemple #4
0
        public IHttpActionResult Update(int id, DTO.FactoryOrderMng.FactoryOrder 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.FactoryOrderMng.FactoryOrder>(dtoItem, out notification))
            {
                return(Ok(new Library.DTO.ReturnData <DTO.FactoryOrderMng.FactoryOrder>()
                {
                    Data = dtoItem, Message = notification
                }));
            }

            // continue processing
            BLL.FactoryOrderMng bll = new BLL.FactoryOrderMng();
            bll.UpdateData(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification);

            return(Ok(new Library.DTO.ReturnData <DTO.FactoryOrderMng.FactoryOrder>()
            {
                Data = dtoItem, Message = notification
            }));
        }
Exemple #5
0
        public IHttpActionResult GetReportData(string plcids)
        {
            Library.DTO.Notification notification;

            // 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)));
            }

            Hashtable input = new Hashtable();

            input["ids"] = plcids;
            string dataFileName = executor.CustomFunction(ControllerContext.GetAuthUserId(), "getreport", input, out notification).ToString();

            if (notification.Type == Library.DTO.NotificationType.Error)
            {
                return(Ok(new Library.DTO.ReturnData <string>()
                {
                    Data = notification.Message, Message = notification
                }));
            }
            return(Ok(new Library.DTO.ReturnData <string>()
            {
                Data = dataFileName, Message = notification
            }));
        }
Exemple #6
0
        public IHttpActionResult Gets(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.CanRead))
            {
                notification         = new Library.DTO.Notification();
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = Properties.Resources.NOT_AUTHORIZED;
                return(Ok(new Library.DTO.ReturnData <DTO.UserGroupMng.SearchFormData>()
                {
                    Data = null, Message = notification, TotalRows = 0
                }));
            }

            BLL.UserGroupMng bll = new BLL.UserGroupMng();
            int totalRows        = 0;

            DTO.UserGroupMng.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.UserGroupMng.SearchFormData>()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
        public IHttpActionResult Get(int id)
        {
            Library.DTO.Notification notification;

            // authentication
            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead))
            {
                notification = new Library.DTO.Notification()
                {
                    Type = Library.DTO.NotificationType.Error, Message = Properties.Resources.NOT_AUTHORIZED
                };
                return(Ok(new Library.DTO.ReturnData <DTO.CushionColorMng.EditFormData>()
                {
                    Data = null, Message = notification
                }));
            }

            BLL.CushionColorMng bll = new BLL.CushionColorMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
            DTO.CushionColorMng.EditFormData data = bll.GetData(id, ControllerContext.GetAuthUserId(), out notification);
            return(Ok(new Library.DTO.ReturnData <DTO.CushionColorMng.EditFormData>()
            {
                Data = data, Message = notification
            }));
        }
        public IHttpActionResult UploadFiles(object data)
        {
            Library.DTO.Notification notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };

            // authentication
            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate))
            {
                // create new case
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = Properties.Resources.NOT_AUTHORIZED;
                return(Ok(new Library.DTO.ReturnData <DTO.UserMng.UserProfile>()
                {
                    Data = null, Message = notification
                }));
            }

            Hashtable input = new Hashtable();

            input["data"] = data;
            bool result = (bool)executor.CustomFunction(ControllerContext.GetAuthUserId(), "uploadfiles", input, out notification);

            return(Ok(new Library.DTO.ReturnData <bool>()
            {
                Data = result, Message = notification
            }));
        }
 public IHttpActionResult Update(int id, DTO.ShowroomItemMng.ShowroomItem dtoItem)
 {
     Library.DTO.Notification notification;
     Module.Framework.BLL     fwBll = new Module.Framework.BLL();
     if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate))
     {
         return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
     }
     else if (id == 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate))
     {
         return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
     }
     // validation
     if (!Helper.CommonHelper.ValidateDTO <DTO.ShowroomItemMng.ShowroomItem>(dtoItem, out notification))
     {
         return(Ok(new Library.DTO.ReturnData <DTO.ShowroomItemMng.ShowroomItem>()
         {
             Data = dtoItem, Message = notification
         }));
     }
     // save data
     BLL.ShowroomItemMng bll = new BLL.ShowroomItemMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
     bll.UpdateData(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.ShowroomItemMng.ShowroomItem>()
     {
         Data = dtoItem, Message = notification
     }));
 }
        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.ClientMng               bll = new BLL.ClientMng();
            Library.DTO.Notification    notification;
            DTO.ClientMng.DataContainer data = bll.GetEditData(id, ControllerContext.GetAuthUserId(), out notification);

            //foreach (var item in data.Client.ClientContracts)
            //{
            //    if (!string.IsNullOrEmpty(item.ContractFileURL))
            //    {
            //        item.ContractFileURL = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["FileUrl"] + item.ContractFileURL;
            //    }
            //}
            return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.DataContainer>()
            {
                Data = data, Message = notification
            }));
        }
Exemple #11
0
        public IHttpActionResult Update(int id, object dtoItem)
        {
            Library.DTO.Notification notification;

            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }
            else if (id == 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            // continue processing
            executor.UpdateData(ControllerContext.GetAuthUserId(), id, ref dtoItem, out notification);
            if (notification.Type == Library.DTO.NotificationType.Error)
            {
                return(InternalServerError(new Exception(notification.Message)));
            }
            return(Ok(new Library.DTO.ReturnData <object>()
            {
                Data = dtoItem, Message = notification
            }));
        }
Exemple #12
0
        public IHttpActionResult GetReportDataByContainer(int packingListID, int template)
        {
            Library.DTO.Notification notification;
            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.PackingListMng bll = new BLL.PackingListMng();
            //int? companyID = fwBll.GetCompanyID(ControllerContext.GetAuthUserId());

            string data = "";

            if (template == 1)
            {
                data = bll.GetOrangePineReportDataByContainer(packingListID, out notification);
            }
            else
            {
                data = bll.GetReportDataByContainer(packingListID, out notification);
            }
            return(Ok(new Library.DTO.ReturnData <string>()
            {
                Data = data, Message = notification
            }));
        }
Exemple #13
0
        public IHttpActionResult Reset(int id, DTO.FactoryProformaInvoiceMng.FactoryProformaInvoice 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.CanApprove))
            {
                // edit case
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            // validation
            if (!Helper.CommonHelper.ValidateDTO <DTO.FactoryProformaInvoiceMng.FactoryProformaInvoice>(dtoItem, out notification))
            {
                return(InternalServerError(new Exception(notification.Message)));
            }

            // continue processing
            BLL.FactoryProformaInvoiceMng bll = new BLL.FactoryProformaInvoiceMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
            bll.Reset(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification);
            return(Ok(new Library.DTO.ReturnData <DTO.FactoryProformaInvoiceMng.FactoryProformaInvoice>()
            {
                Data = dtoItem, Message = notification
            }));
        }
Exemple #14
0
        public IHttpActionResult Update(int id, object 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.MaterialColorMng.MaterialColor>(ref dtoItem, out notification))
            //{
            //    return Ok(new Library.DTO.ReturnData<DTO.MaterialColorMng.MaterialColor>() { Data = dtoItem, Message = notification });
            //}

            executor.UpdateData(ControllerContext.GetAuthUserId(), id, ref dtoItem, out notification);
            return(Ok(new Library.DTO.ReturnData <object>()
            {
                Data = dtoItem, Message = notification
            }));
        }
Exemple #15
0
        public IHttpActionResult GetReportData(string season)
        {
            Library.DTO.Notification notification;

            // 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.QuotationOverviewRpt bll = new BLL.QuotationOverviewRpt();
            string dataFileName          = bll.GetReportData(ControllerContext.GetAuthUserId(), season, out notification);

            if (notification.Type == Library.DTO.NotificationType.Error)
            {
                return(Ok(new Library.DTO.ReturnData <string>()
                {
                    Data = string.Empty, Message = notification
                }));
            }
            return(Ok(new Library.DTO.ReturnData <string>()
            {
                Data = dataFileName, Message = notification
            }));
        }
Exemple #16
0
        public IHttpActionResult GetClientData(string season, string clientID, int modelID)
        {
            //authencation
            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, ModuleAction.CanUpdate))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }
            BLL.ModelMng             bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
            Library.DTO.Notification notification;

            int id = 0;

            if (season == "null")
            {
                season = "";
            }
            if (clientID != "null")
            {
                id = Convert.ToInt32(clientID);
            }

            List <DTO.ModelMng.ClientSaleData> data = bll.GetClientSaleData(season, id, modelID, out notification);

            return(Ok(new Library.DTO.ReturnData <List <DTO.ModelMng.ClientSaleData> >()
            {
                Data = data, Message = notification
            }));
        }
        public IHttpActionResult ChangePassword(Models.PasswordChangeViewModel dtoItem)
        {
            Library.DTO.Notification notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };

            // authentication
            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate))
            {
                // edit case
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            // validation
            if (!Helper.CommonHelper.ValidateDTO <Models.PasswordChangeViewModel>(dtoItem, out notification))
            {
                return(Ok(new Library.DTO.ReturnData <Models.PasswordChangeViewModel>()
                {
                    Data = dtoItem, Message = notification
                }));
            }

            // change password
            try
            {
                using (AuthRepository _repo = new AuthRepository())
                {
                    if (dtoItem.NewPassword.Length < 7)
                    {
                        throw new Exception("Password length must be at least 7 chars");
                    }
                    if (dtoItem.NewPassword != dtoItem.Confirmation)
                    {
                        throw new Exception("Password and confirmation do not match!");
                    }

                    _repo.ResetPassword(dtoItem.UserName, dtoItem.NewPassword);
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
                return(Ok(new Library.DTO.ReturnData <DTO.UserMng.UserProfile>()
                {
                    Data = null, Message = notification
                }));
            }

            return(Ok(new Library.DTO.ReturnData <bool>()
            {
                Data = true, Message = notification
            }));
        }
Exemple #18
0
 public IHttpActionResult GetSearchFilter()
 {
     Module.Framework.BLL fwBll = new Module.Framework.BLL();
     BLL.BackSaleOrderMng bll   = new BLL.BackSaleOrderMng();
     DTO.BackSaleOrderMng.SearchFilterData result = bll.GetSearchFilter();
     return(Ok(new Library.DTO.ReturnData <DTO.BackSaleOrderMng.SearchFilterData>()
     {
         Data = result
     }));
 }
Exemple #19
0
 [Route("update")] //will change on java script
 public IHttpActionResult CreateBackOrder(int id, DTO.BackSaleOrderMng.BackOrder dtoItem)
 {
     Module.Framework.BLL     fwBll = new Module.Framework.BLL();
     BLL.BackSaleOrderMng     bll   = new BLL.BackSaleOrderMng();
     Library.DTO.Notification notification;
     bll.UpdateBackOrder(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.BackSaleOrderMng.BackOrder>()
     {
         Data = dtoItem, Message = notification
     }));
 }
Exemple #20
0
 public IHttpActionResult GetNewBackOrder(int id)
 {
     Module.Framework.BLL              fwBll = new Module.Framework.BLL();
     BLL.BackSaleOrderMng              bll   = new BLL.BackSaleOrderMng();
     Library.DTO.Notification          notification;
     DTO.BackSaleOrderMng.EditFormData result = bll.GetData(id, ControllerContext.GetAuthUserId(), out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.BackSaleOrderMng.EditFormData>()
     {
         Data = result, Message = notification
     }));
 }
Exemple #21
0
        public IHttpActionResult PrintPackingListExtend(int id, int template)
        {
            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)));
            }

            //GET DATA
            BLL.ECommercialInvoiceMng bll = new BLL.ECommercialInvoiceMng();
            DTO.ECommercialInvoiceMng.PackingListContainerPrintout dtoPrintout = bll.GetPackingListPrintoutData(id, ControllerContext.GetAuthUserId(), out notification);

            //CREATE PRINTOUT
            string printoutFileName = string.Empty;

            if (dtoPrintout != null && dtoPrintout.PackingListPrintouts != null && dtoPrintout.PackingListDetailPrintouts != null)
            {
                string reportName = "";
                //int? companyID = fwBll.GetCompanyID(ControllerContext.GetAuthUserId());
                switch (template)
                {
                case 1:
                    reportName = "PackingListPrint_OrangePine.rdlc";
                    break;

                default:
                    reportName = "PackingListPrint.rdlc";
                    break;
                }

                Microsoft.Reporting.WebForms.LocalReport lr = new Microsoft.Reporting.WebForms.LocalReport();
                lr.ReportPath = FrameworkSetting.Setting.AbsoluteReportFolder + reportName;

                Microsoft.Reporting.WebForms.ReportDataSource rsInvoice = new Microsoft.Reporting.WebForms.ReportDataSource();
                rsInvoice.Name  = "PackingList";
                rsInvoice.Value = dtoPrintout.PackingListPrintouts;
                lr.DataSources.Add(rsInvoice);

                Microsoft.Reporting.WebForms.ReportDataSource rsInvoiceDetail = new Microsoft.Reporting.WebForms.ReportDataSource();
                rsInvoiceDetail.Name  = "PackingListDetail";
                rsInvoiceDetail.Value = dtoPrintout.PackingListDetailPrintouts;
                lr.DataSources.Add(rsInvoiceDetail);

                printoutFileName = PrintoutHelper.BuildPrintoutFile(lr, "PDF");
            }
            return(Ok(new Library.DTO.ReturnData <string>()
            {
                Data = printoutFileName, Message = notification
            }));
        }
Exemple #22
0
        public IHttpActionResult MarkAsNotYetExportedToExact(List <int> purchasingInvoiceIDs)
        {
            Library.DTO.Notification notification;
            Module.Framework.BLL     fwBll = new Module.Framework.BLL();
            BLL.PurchasingInvoiceMng bll   = new BLL.PurchasingInvoiceMng();
            bool result = bll.MarkAsNotYetExportedToExact(ControllerContext.GetAuthUserId(), purchasingInvoiceIDs, out notification);

            return(Ok(new Library.DTO.ReturnData <bool>()
            {
                Data = result, Message = notification
            }));
        }
        public IHttpActionResult QuickSearchSampleProduct(DTO.Search searchInput)
        {
            Module.Framework.BLL     fwBll = new Module.Framework.BLL();
            BLL.ShowroomItemMng      bll   = new BLL.ShowroomItemMng();
            Library.DTO.Notification notification;
            int totalRows = 0;
            List <DTO.ShowroomItemMng.SampleProduct> data = bll.QuickSearchSampleProduct(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification);

            return(Ok(new Library.DTO.ReturnData <List <DTO.ShowroomItemMng.SampleProduct> >()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
Exemple #24
0
        public IHttpActionResult GetReport(string season)
        {
            // authentication
            Module.Framework.BLL     fwBll        = new Module.Framework.BLL();
            BLL.DashboardMng         bll          = new BLL.DashboardMng();
            Library.DTO.Notification notification = new Library.DTO.Notification();

            // return dashboard with management information (for management level only)
            return(Ok(new Library.DTO.ReturnData <DTO.DashboardMng.DashboardReportData>()
            {
                Data = bll.GetReportData(ControllerContext.GetAuthUserId(), season, out notification), Message = notification
            }));
        }
        public IHttpActionResult QuickSearchLoadingPlan(DTO.Search searchInput)
        {
            // authentication
            Module.Framework.BLL     fwBll = new Module.Framework.BLL();
            BLL.LoadingPlanMng       bll   = new BLL.LoadingPlanMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
            Library.DTO.Notification notification;
            int totalRows = 0;
            IEnumerable <DTO.LoadingPlanMng.LoadingPlanSearchResult> 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 <IEnumerable <DTO.LoadingPlanMng.LoadingPlanSearchResult> >()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
Exemple #26
0
        public IHttpActionResult TransferMultiItem(List <DTO.TransferShowroomAreaMng.TransferShowroomAreaSearch> dtoItem)
        {
            Library.DTO.Notification notification;
            List <DTO.TransferShowroomAreaMng.TransferShowroomAreaSearch> errorItems;

            Module.Framework.BLL fwBll = new Module.Framework.BLL();
            // save data
            BLL.TransferShowroomAreaMng bll = new BLL.TransferShowroomAreaMng();
            bll.TransferMultiItem(dtoItem, ControllerContext.GetAuthUserId(), out errorItems, out notification);
            return(Ok(new Library.DTO.ReturnData <List <DTO.TransferShowroomAreaMng.TransferShowroomAreaSearch> >()
            {
                Data = errorItems, Message = notification
            }));
        }
Exemple #27
0
 public IHttpActionResult Get(int id)
 {
     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.ShowroomAreaMng              bll = new BLL.ShowroomAreaMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
     Library.DTO.Notification         notification;
     DTO.ShowroomAreaMng.EditFormData data = bll.GetData(id, ControllerContext.GetAuthUserId(), out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.ShowroomAreaMng.EditFormData>()
     {
         Data = data, Message = notification
     }));
 }
Exemple #28
0
 public IHttpActionResult SetStatus(int id, bool status, int invoiceType)
 {
     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.PurchasingInvoiceMng bll = new BLL.PurchasingInvoiceMng();
     Library.DTO.Notification notification;
     bll.SetStatus(id, ControllerContext.GetAuthUserId(), status, invoiceType, out notification);
     return(Ok(new Library.DTO.ReturnData <int>()
     {
         Data = id, Message = notification
     }));
 }
Exemple #29
0
 public IHttpActionResult SetConfirmPrice(int purchasingInvoiceID, DTO.PurchasingInvoiceMng.PurchasingInvoice dtoItem, bool isConfirmedPrice)
 {
     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.PurchasingInvoiceMng bll = new BLL.PurchasingInvoiceMng();
     Library.DTO.Notification notification;
     bll.SetConfirmPrice(ControllerContext.GetAuthUserId(), purchasingInvoiceID, dtoItem, isConfirmedPrice, out notification);
     return(Ok(new Library.DTO.ReturnData <int>()
     {
         Data = purchasingInvoiceID, Message = notification
     }));
 }
 public IHttpActionResult Delete(int id)
 {
     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.ShowroomItemMng      bll = new BLL.ShowroomItemMng();
     Library.DTO.Notification notification;
     bll.DeleteData(id, ControllerContext.GetAuthUserId(), out notification);
     return(Ok(new Library.DTO.ReturnData <int>()
     {
         Data = id, Message = notification
     }));
 }