Example #1
0
        public ActionResult AddRemark(string compId)
        {
            int complainId        = EncryptionUtility.Hash64Decode(compId);
            var complainRemarkDTO = new ComplainRemarkDTO
            {
                AgencyId = Singleton.Agency.Id,
                Complain = new ComplainDTO()
            };

            if (complainId != 0)
            {
                var complainDTO = new ComplainService(true)
                                  .GetAll()
                                  .ToList()
                                  .FirstOrDefault(v => v.Id == complainId);

                if (complainDTO != null)
                {
                    complainRemarkDTO.Complain         = complainDTO;
                    complainRemarkDTO.ComplainId       = complainDTO.Id;
                    complainRemarkDTO.Complain.Remarks =
                        complainDTO.Remarks.OrderByDescending(c => c.RemarkDate).ToList();
                    complainRemarkDTO.RemarkDate = DateTime.Now;
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }
            return(View(complainRemarkDTO));
        }
        public HttpResponseMessage DeleletComplain(int Complain_id)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);

                using (ComplainService service = new ComplainService())
                {
                    service.DeleteComplain(Complain_id);
                    data.result  = null;
                    data.status  = true;
                    data.message = "Se ha eliminado la queja";
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Eliminar queja");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
        public HttpResponseMessage UpdateComplainbyAdmin(Complain complain)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);

                using (ComplainService service = new ComplainService())
                {
                    service.UpdateComplainbyAdmin(complain.Complain_Id, complain.state, complain.Answer);
                    data.result  = null;
                    data.status  = true;
                    data.message = "Se actualizo la queja";
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "hubo un error");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
        public HttpResponseMessage PostFile(Complain queja)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);

                using (ComplainService service = new ComplainService())
                {
                    service.GuardarQueja(queja.Description, queja.state, queja.person_Id, queja.User_id, queja.employee_name, queja.employee, queja.department_id, queja.fecha);
                    data.result  = null;
                    data.status  = true;
                    data.message = "Su queja ha sido enviada correctamente";
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Error en la creación de la queja");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
        public HttpResponseMessage ListaFuncionarios(string depSeleccion)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);



                using (ComplainService service = new ComplainService())
                {
                    var funcionarios = service.TodosFuncionarios(depSeleccion);
                    data.result = new { funcionarios };
                    data.status = true;
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Lista de Funcionarios");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
        public HttpResponseMessage ListComplainsbyId(int Id_User)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);



                using (ComplainService service = new ComplainService())
                {
                    var complains = service.ListComplainsbyId(Id_User);
                    data.result = new { complains };
                    data.status = true;
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Lista de Quejas");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
        public HttpResponseMessage UpdateComplain([FromBody] Complain complain)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);

                using (ComplainService service = new ComplainService())
                {
                    service.UpdateComplain(complain.Complain_Id, complain.Description, complain.employee, complain.employee_name, complain.department_id, complain.fecha);
                    data.result  = null;
                    data.status  = true;
                    data.message = "Su queja se actualió correctament";
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Error actualizando la queja");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
        public HttpResponseMessage complaintsFilter(string desde, string hasta, string state, string department)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);

                if (desde == "_ALL_")
                {
                    desde = "";
                }

                if (hasta == "_ALL_")
                {
                    hasta = "";
                }

                if (state == "_ALL_")
                {
                    state = "";
                }

                if (department == "_ALL_")
                {
                    department = "";
                }


                using (ComplainService service = new ComplainService())
                {
                    var complaints = service.complaintsFilter(desde, hasta, state, department, config.usuario.usuario_Id);
                    data.result = new { complaints };
                    data.status = true;
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Lista de quejas");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
Example #9
0
        public ActionResult Delete(ComplainDTO complainDTO)
        {
            try
            {
                var compService = new ComplainService(false);
                compService.Delete(complainDTO.Id.ToString());
                compService.Dispose();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(complainDTO));
            }
        }
        public HttpResponseMessage AllComplains(string state, string from, string to)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            ResponseConfig      config   = VerifyAuthorization(Request.Headers);
            RestResponse        data     = new RestResponse();

            try
            {
                VerifyMessage(config.errorMessage);

                if (from == "_ALL_")
                {
                    from = "";
                }

                if (to == "_ALL_")
                {
                    to = "";
                }


                if (state == "-1")
                {
                    state = "";
                }


                using (ComplainService service = new ComplainService())
                {
                    var complains = service.AllComplains(state, to, from);
                    data.result = new { complains, service.attendedcomplaints, service.newcomplaints, service.complaintsinprocess };
                    data.status = true;
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized;
                data.status         = false;
                data.message        = ex.Message;
                data.error          = NewError(ex, "Lista de Quejas");
            }
            finally
            {
                response.Content = CreateContent(data);
            }

            return(response);
        }
Example #11
0
        private static void AddServices()
        {
            #region Basic Workflow Services

            // Add the SqlWorkflowPersistenceService to the runtime engine.
            SqlWorkflowPersistenceService PersistService = new SqlWorkflowPersistenceService(Settings.Default.AppConnectionString);
            Runtime.AddService(PersistService);

            //SqlTrackingService TrackingService = new SqlTrackingService(Settings.Default.AppConnectionString);
            //Runtime.AddService(TrackingService);

            // Add ExternalDataExchangeService to communicate with any running Workflow
            ExternalDataExchangeService DataExchangeService = new ExternalDataExchangeService();
            Runtime.AddService(DataExchangeService);

            #endregion


            #region Igrss Business Services

            ComplainServices = new ComplainService();
            DataExchangeService.AddService(ComplainServices);

            LicenseApplicationServices = new LicenseApplicationService();
            DataExchangeService.AddService(LicenseApplicationServices);

            AppealServices = new AppealService();
            DataExchangeService.AddService(AppealServices);

            RefundServices = new RefundService();
            DataExchangeService.AddService(RefundServices);

            AdjudicationServices = new AdjudicationService();
            DataExchangeService.AddService(AdjudicationServices);

            #endregion

            //ComplainService complainService = new ComplainService();
            //DataService.AddService(complainService);

            //OrderService orderService = OrderService.Instance;
            //dataService.AddService(orderService);

            //OrderTransactionService txnService = new OrderTransactionService();
            //Runtime.AddService(txnService);

            //ContextService = new HttpContextWrapper();
        }
Example #12
0
        public ActionResult Details(string compId)
        {
            int complainId  = EncryptionUtility.Hash64Decode(compId);
            var complainDTO = new ComplainDTO
            {
                Employee = new EmployeeDTO()
            };

            if (complainId != 0)
            {
                complainDTO = new ComplainService(true)
                              .GetAll()
                              .ToList()
                              .FirstOrDefault(v => v.Id == complainId);
            }
            return(View(complainDTO));
        }
Example #13
0
        public ActionResult CloseComplain(ComplainDTO complainDTO)
        {
            try
            {
                var complainService = new ComplainService(false);
                var compDTO         = complainService.Find(complainDTO.Id.ToString());
                compDTO.FinalSolution     = complainDTO.FinalSolution;
                compDTO.FinalSolutionDate = complainDTO.FinalSolutionDate;
                compDTO.Status            = ComplainStatusTypes.Closed;
                complainService.InsertOrUpdate(compDTO);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #14
0
        public ActionResult Confirm(string compId)
        {
            int complainId  = EncryptionUtility.Hash64Decode(compId);
            var complainDTO = new ComplainDTO
            {
                Employee = new EmployeeDTO()
            };

            if (complainId != 0)
            {
                complainDTO = new ComplainService(true)
                              .GetAll()
                              .ToList()
                              .FirstOrDefault(v => v.Id == complainId);
                if (complainDTO != null)
                {
                    complainDTO.ConfirmationDate = DateTime.Now;
                }
            }
            return(View(complainDTO));
        }
Example #15
0
        public ActionResult ReOpen(string compId)
        {
            int complainId  = EncryptionUtility.Hash64Decode(compId);
            var complainDTO = new ComplainDTO
            {
                AgencyId = Singleton.Agency.Id,
                Employee = new EmployeeDTO()
            };

            if (complainId != 0)
            {
                complainDTO = new ComplainService(true)
                              .GetAll()
                              .ToList()
                              .FirstOrDefault(v => v.Id == complainId);
                if (complainDTO != null)
                {
                    complainDTO.ReOpeningDate = DateTime.Now;
                }
            }
            return(View(complainDTO));
        }
Example #16
0
        public ActionResult AddRemark(ComplainRemarkDTO complainRemarkDTO)
        {
            try
            {
                var complainService = new ComplainService(false);
                var compDTO         = complainService.Find(complainRemarkDTO.ComplainId.ToString());

                var complainRemarkDTO2 = new ComplainRemarkDTO
                {
                    Complain   = compDTO,
                    AgencyId   = Singleton.Agency.Id,
                    RemarkDate = complainRemarkDTO.RemarkDate,
                    Remark     = complainRemarkDTO.Remark
                };

                complainService.InsertOrUpdateRemark(complainRemarkDTO2);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #17
0
 public ComplainDateController(ComplainService service)
 {
     _service = service;
 }
Example #18
0
 public ComplainQueryController(ComplainService service)
 {
     _service = service;
 }
Example #19
0
 public ComplainTrendController(ComplainService service)
 {
     _service = service;
 }
Example #20
0
 public ComplainProcessController(ComplainService service)
 {
     _service = service;
 }
Example #21
0
 public ComplainPositionController(ComplainService service)
 {
     _service = service;
 }
Example #22
0
 public ComplainQueryController(ComplainService service)
 {
     _service = service;
 }
Example #23
0
 public ComplainPositionController(ComplainService service)
 {
     _service = service;
 }
Example #24
0
 public ComplainTrendController(ComplainService service, OnlineSustainService onlineSustainService)
 {
     _service = service;
     _onlineSustainService = onlineSustainService;
 }