public WebResponseContentModel <DataTable> GetAllClients(int employeeID)
        {
            WebResponseContentModel <DataTable> dt = new WebResponseContentModel <DataTable>();

            try
            {
                dt = GetResponseFromWebRequest <WebResponseContentModel <DataTable> >(WebServiceHelper.GetClientsFromDb(employeeID), "get");
            }
            catch (Exception ex)
            {
                dt.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(dt);
        }
        public WebResponseContentModel <ClientFullModel> GetClient(int clientID, int employeeID)
        {
            WebResponseContentModel <ClientFullModel> client = new WebResponseContentModel <ClientFullModel>();

            try
            {
                client = GetResponseFromWebRequest <WebResponseContentModel <ClientFullModel> >(WebServiceHelper.GetClientByID(clientID, employeeID), "get");
            }
            catch (Exception ex)
            {
                client.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(client);
        }
Beispiel #3
0
        public WebResponseContentModel <FinancialControlModel> GetFinancialControlData()
        {
            WebResponseContentModel <FinancialControlModel> clients = new WebResponseContentModel <FinancialControlModel>();

            try
            {
                clients = GetResponseFromWebRequest <WebResponseContentModel <FinancialControlModel> >(WebServiceURLHelper.GetFinancialControlData(), "get");
            }
            catch (Exception ex)
            {
                clients.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(clients);
        }
        public WebResponseContentModel <List <EmployeeSimpleModel> > GetAllEmployeeSupervisors()
        {
            WebResponseContentModel <List <EmployeeSimpleModel> > dt = new WebResponseContentModel <List <EmployeeSimpleModel> >();

            try
            {
                dt = GetResponseFromWebRequest <WebResponseContentModel <List <EmployeeSimpleModel> > >(WebServiceHelper.GetAllEmployeeSupervisors(), "get");
            }
            catch (Exception ex)
            {
                dt.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(dt);
        }
Beispiel #5
0
        public WebResponseContentModel <List <CashFlow_SkupnoModel> > GetCashFlowSkupnoByVrsta(string vrsta)
        {
            WebResponseContentModel <List <CashFlow_SkupnoModel> > cashFlow = new WebResponseContentModel <List <CashFlow_SkupnoModel> >();

            try
            {
                cashFlow = GetResponseFromWebRequest <WebResponseContentModel <List <CashFlow_SkupnoModel> > >(WebServiceURLHelper.GetCashFlow_SkupnoByVrsta(vrsta), "get");
            }
            catch (Exception ex)
            {
                cashFlow.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(cashFlow);
        }
Beispiel #6
0
        public WebResponseContentModel <List <CashFlow_SkupnoModel> > GetCashFlowSkupnoByDatum(DateTime datumTeden)
        {
            WebResponseContentModel <List <CashFlow_SkupnoModel> > cashFlow = new WebResponseContentModel <List <CashFlow_SkupnoModel> >();

            try
            {
                cashFlow = GetResponseFromWebRequest <WebResponseContentModel <List <CashFlow_SkupnoModel> > >(WebServiceURLHelper.GetCashFlow_SkupnoByDatum(datumTeden.ToString("dd-MM-yyyy")), "get");
            }
            catch (Exception ex)
            {
                cashFlow.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(cashFlow);
        }
        public WebResponseContentModel <ClientCategorieModel> SaveClientCategorieChanges(ClientCategorieModel newData)
        {
            WebResponseContentModel <ClientCategorieModel> model = new WebResponseContentModel <ClientCategorieModel>();

            try
            {
                model.Content = newData;
                model         = PostWebRequestData <WebResponseContentModel <ClientCategorieModel> >(WebServiceHelper.SaveClientCategorieChanges(), "post", model);
            }
            catch (Exception ex)
            {
                model.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(model);
        }
        public WebResponseContentModel <EmailMessageModel> SendEmailMessage(EmailMessageModel newData)
        {
            WebResponseContentModel <EmailMessageModel> model = new WebResponseContentModel <EmailMessageModel>();

            try
            {
                model.Content = newData;
                model         = PostWebRequestData <WebResponseContentModel <EmailMessageModel> >(WebServiceHelper.SendEmailMessage(), "post", model);
            }
            catch (Exception ex)
            {
                model.ValidationErrorAppSide = ConcatenateExceptionMessage(ex);
            }

            return(model);
        }
        public IHttpActionResult SaveClientCategorie([FromBody] object clientCategorieData)
        {
            WebResponseContentModel <ClientCategorieModel> returnModel = new WebResponseContentModel <ClientCategorieModel>();

            try
            {
                returnModel = JsonConvert.DeserializeObject <WebResponseContentModel <ClientCategorieModel> >(clientCategorieData.ToString());

                if (returnModel.Content != null)
                {
                    if (returnModel.Content.idStrankaKategorija > 0)//We update existing record in DB
                    {
                        clientRepo.SaveClientCategorie(returnModel.Content);
                        returnModel.Content.Kategorija = clientRepo.GetCategorieByID(returnModel.Content.idKategorija);
                    }
                    else// We add and save new recod to DB
                    {
                        returnModel.Content.idStrankaKategorija = clientRepo.SaveClientCategorie(returnModel.Content, false);
                        returnModel.Content.Kategorija          = clientRepo.GetCategorieByID(returnModel.Content.idKategorija);
                        ChartRenderModel chartData = chartsRepo.GetDataForChart(returnModel.Content.idStranka, returnModel.Content.idKategorija, (int)Enums.ChartRenderPeriod.MESECNO, (int)Enums.ChartRenderType.KOLICINA);

                        if (chartData != null)
                        {
                            if (chartData.chartRenderData.Count > 0)
                            {
                                returnModel.Content.HasChartDataForCategorie = true;
                            }
                        }
                    }

                    returnModel.IsRequestSuccesful = true;
                }
                else
                {
                    returnModel.IsRequestSuccesful = false;
                    returnModel.ValidationError    = ValidationExceptionError.res_09;
                }
            }
            catch (Exception ex)
            {
                returnModel.IsRequestSuccesful = false;
                returnModel.ValidationError    = ExceptionValidationHelper.GetExceptionSource(ex);
                return(Json(returnModel));
            }

            return(Json(returnModel));
        }
Beispiel #10
0
        public IHttpActionResult GetCashFlow_SkupnoByVrsta(string vrsta)
        {
            WebResponseContentModel <List <CashFlow_SkupnoModel> > tmpUser = new WebResponseContentModel <List <CashFlow_SkupnoModel> >();
            Del <List <CashFlow_SkupnoModel> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = cashFlowSkupnoRepo.GetCashFlow_SkupnoByVrsta(vrsta);
                responseStatusHandler(tmpUser);
                return(Json(tmpUser));
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }
        }
        public IHttpActionResult SaveInquiryPurchase([FromBody] object inquiryData)
        {
            WebResponseContentModel <InquiryFullModel> model = null;

            try
            {
                model = JsonConvert.DeserializeObject <WebResponseContentModel <InquiryFullModel> >(inquiryData.ToString());

                DataTypesHelper.LogThis("SaveInquiryPurchase : " + model.Content.StatusPovprasevanja.Koda.ToString());

                if (model.Content != null)
                {
                    if (model.Content.PovprasevanjeID > 0)//We update existing record in DB
                    {
                        inquiryRepo.SaveInquiry(model.Content);
                        // send email to all grafolit contacts = Nabava
                        DataTypesHelper.LogThis("Generate mail for Purchase dept : " + model.Content.StatusPovprasevanja.Koda.ToString());

                        if (model.Content.StatusPovprasevanja.Koda == Enums.StatusOfInquiry.POSLANO_V_NABAVO.ToString())
                        {
                            var             employee      = employeeRepo.GetEmployeeByID(model.Content.PovprasevanjeOddalID);
                            string          sGrafolitDept = ConfigurationManager.AppSettings["PantheonCreateOrderDefBuyer"].ToString();
                            ClientFullModel cfmGrafolit   = clientPdoRepo.GetClientByName(sGrafolitDept);

                            DataTypesHelper.LogThis("Generate mail for Purchase dept");
                            messageEventsRepo.CreateEmailForGrafolitPurcaheDept(cfmGrafolit, employee, model.Content);
                        }
                    }

                    model.IsRequestSuccesful = true;
                }
                else
                {
                    model.IsRequestSuccesful = false;
                    model.ValidationError    = ValidationExceptionError.res_09;
                }
            }
            catch (Exception ex)
            {
                model.IsRequestSuccesful = false;
                model.ValidationError    = ExceptionValidationHelper.GetExceptionSource(ex);
                return(Json(model));
            }

            return(Json(model));
        }
        public IHttpActionResult GetInquiryStatusByID(int statusID)
        {
            WebResponseContentModel <InquiryStatusModel> tmpUser = new WebResponseContentModel <InquiryStatusModel>();
            Del <InquiryStatusModel> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = inquiryRepo.GetInquiryStatusByID(statusID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #13
0
        public IHttpActionResult GetColorListByCategory(string category)
        {
            WebResponseContentModel <List <ProductColor> > tmpUser = new WebResponseContentModel <List <ProductColor> >();
            Del <List <ProductColor> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = optimalStockOrderRepo.GetColorListByCategory(category);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
        public IHttpActionResult GetAppSettings()
        {
            WebResponseContentModel <SettingsModel> tmpUser = new WebResponseContentModel <SettingsModel>();
            Del <SettingsModel> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = settingsRepo.GetLatestSettings();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #15
0
        public IHttpActionResult GetOptimalStockTree(string productCategory, string color)
        {
            WebResponseContentModel <List <OptimalStockTreeHierarchy> > tmpUser = new WebResponseContentModel <List <OptimalStockTreeHierarchy> >();
            Del <List <OptimalStockTreeHierarchy> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = optimalStockOrderRepo.GetOptimalStockTree(productCategory, color);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #16
0
        public IHttpActionResult IsSubmittingPriceForCarrierStillValid(int prijavaPevoznikaID)
        {
            WebResponseContentModel <string> tmpUser = new WebResponseContentModel <string>();
            Del <string> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = recallRepo.IsPriceSubmittingStillValid(prijavaPevoznikaID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #17
0
        public IHttpActionResult ResetSequentialNumInRecallPos()
        {
            WebResponseContentModel <bool> tmpUser = new WebResponseContentModel <bool>();
            Del <bool> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = recallRepo.ResetSequentialNumInRecallPos();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #18
0
        public IHttpActionResult GetRecallTypeByID(int typeID)
        {
            WebResponseContentModel <RecallType> tmpUser = new WebResponseContentModel <RecallType>();
            Del <RecallType> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = recallRepo.GetRecallTypeByID(typeID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
        public IHttpActionResult GetInquiryByID(int inquiryID, bool bOnlySelected, int iSelDobaviteljID)
        {
            WebResponseContentModel <InquiryFullModel> tmpUser = new WebResponseContentModel <InquiryFullModel>();
            Del <InquiryFullModel> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = inquiryRepo.GetInquiryByID(inquiryID, bOnlySelected, iSelDobaviteljID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
        public IHttpActionResult GetCategoryList()
        {
            WebResponseContentModel <List <ProductCategory> > tmpUser = new WebResponseContentModel <List <ProductCategory> >();
            Del <List <ProductCategory> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = mssqlRepo.GetCategoryList();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
        public IHttpActionResult GetAllInquiries()
        {
            WebResponseContentModel <List <InquiryModel> > tmpUser = new WebResponseContentModel <List <InquiryModel> >();
            Del <List <InquiryModel> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = inquiryRepo.GetInquiryList();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
        public IHttpActionResult GetRoutesByCarrierIDAndRouteID(int carrierID, int routeID)
        {
            WebResponseContentModel <List <RouteModel> > tmpUser = new WebResponseContentModel <List <RouteModel> >();
            Del <List <RouteModel> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = routeRepo.GetRoutesByCarrierIDAndRouteID(carrierID, routeID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #23
0
        public IHttpActionResult GetPantheonUsers()
        {
            WebResponseContentModel <List <PantheonUsers> > tmpUser = new WebResponseContentModel <List <PantheonUsers> >();
            Del <List <PantheonUsers> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = msSqlFunctionRepo.GetPantheonUsers();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
        public IHttpActionResult GetRouteByID(int routeID)
        {
            WebResponseContentModel <RouteModel> tmpUser = new WebResponseContentModel <RouteModel>();
            Del <RouteModel> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = routeRepo.GetRouteByID(routeID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #25
0
        public IHttpActionResult GetRecallStatusByCode(string statusCode)
        {
            WebResponseContentModel <RecallStatus> tmpUser = new WebResponseContentModel <RecallStatus>();
            Del <RecallStatus> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = recallRepo.GetRecallStatusByCode(statusCode);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #26
0
        public IHttpActionResult CopyOptimalStockOrderByID(int optimalStockOrderID)
        {
            WebResponseContentModel <bool> optimalStockOrder = new WebResponseContentModel <bool>();
            Del <bool> responseStatusHandler = ProcessContentModel;

            try
            {
                optimalStockOrder.Content = optimalStockOrderRepo.CopyOptimalStockOrderByID(optimalStockOrderID);
                responseStatusHandler(optimalStockOrder);
            }
            catch (Exception ex)
            {
                responseStatusHandler(optimalStockOrder, ex);
                return(Json(optimalStockOrder));
            }

            return(Json(optimalStockOrder));
        }
Beispiel #27
0
        public IHttpActionResult GetAllTakeOverRecalls()
        {
            WebResponseContentModel <List <RecallModel> > tmpUser = new WebResponseContentModel <List <RecallModel> >();
            Del <List <RecallModel> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = recallRepo.GetAllTakeOverRecalls();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #28
0
        public IHttpActionResult GetOptimalStockOrderPositionByID(int ID)
        {
            WebResponseContentModel <OptimalStockOrderPositionModel> tmpUser = new WebResponseContentModel <OptimalStockOrderPositionModel>();
            Del <OptimalStockOrderPositionModel> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = optimalStockOrderRepo.GetOptimalStockOrderPositionByID(ID);
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #29
0
        public IHttpActionResult GetDashboardNOZData()
        {
            WebResponseContentModel <DashboardNOZModel> tmpUser = new WebResponseContentModel <DashboardNOZModel>();
            Del <DashboardNOZModel> responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = dashboardNOZRepo.GetDashboardData();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }
Beispiel #30
0
        public IHttpActionResult GetOptimalStockStatuses()
        {
            WebResponseContentModel <List <OptimalStockOrderStatusModel> > tmpUser = new WebResponseContentModel <List <OptimalStockOrderStatusModel> >();
            Del <List <OptimalStockOrderStatusModel> > responseStatusHandler       = ProcessContentModel;

            try
            {
                tmpUser.Content = optimalStockOrderRepo.GetOptimalStockStatuses();
                responseStatusHandler(tmpUser);
            }
            catch (Exception ex)
            {
                responseStatusHandler(tmpUser, ex);
                return(Json(tmpUser));
            }

            return(Json(tmpUser));
        }