Esempio n. 1
0
        public ActionResult Create(int Id = 0, int consult = 0)
        {
            int ModuleId   = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0;
            var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45172);

            ViewBag.Permission = permission;
            var varDetalle_de_Indicios = new Detalle_de_IndiciosModel();

            ViewBag.ObjectId  = "45172";
            ViewBag.Operation = "New";

            ViewBag.IsNew = true;



            if ((Id.GetType() == typeof(string) && Id.ToString() != "") || ((Id.GetType() == typeof(int) || Id.GetType() == typeof(Int16) || Id.GetType() == typeof(Int32) || Id.GetType() == typeof(Int64) || Id.GetType() == typeof(short)) && Id.ToString() != "0"))
            {
                ViewBag.IsNew     = false;
                ViewBag.Operation = "Update";
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDetalle_de_IndiciosApiConsumer.SetAuthHeader(_tokenManager.Token);
                var Detalle_de_IndiciosData = _IDetalle_de_IndiciosApiConsumer.GetByKeyComplete(Id).Resource.Detalle_de_Indicioss[0];
                if (Detalle_de_IndiciosData == null)
                {
                    return(HttpNotFound());
                }

                varDetalle_de_Indicios = new Detalle_de_IndiciosModel
                {
                    Clave = (int)Detalle_de_IndiciosData.Clave
                    , Numero_de_Indicio      = Detalle_de_IndiciosData.Numero_de_Indicio
                    , Nombre_de_Indicio      = Detalle_de_IndiciosData.Nombre_de_Indicio
                    , Descripcion_de_Indicio = Detalle_de_IndiciosData.Descripcion_de_Indicio
                    , Motivo_de_Indicio      = Detalle_de_IndiciosData.Motivo_de_Indicio
                    , Diligencia             = Detalle_de_IndiciosData.Diligencia
                    , DiligenciaServicio     = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_IndiciosData.Diligencia), "Servicios_Periciales") ?? (string)Detalle_de_IndiciosData.Diligencia_Servicios_Periciales.Servicio
                    , Ubicacion          = Detalle_de_IndiciosData.Ubicacion
                    , Estatus            = Detalle_de_IndiciosData.Estatus
                    , EstatusDescripcion = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_IndiciosData.Estatus), "Estatus_de_Indicio") ?? (string)Detalle_de_IndiciosData.Estatus_Estatus_de_Indicio.Descripcion
                };
            }
            if (!_tokenManager.GenerateToken())
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }

            _IServicios_PericialesApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Servicios_Pericialess_Diligencia = _IServicios_PericialesApiConsumer.SelAll(true);

            if (Servicios_Pericialess_Diligencia != null && Servicios_Pericialess_Diligencia.Resource != null)
            {
                ViewBag.Servicios_Pericialess_Diligencia = Servicios_Pericialess_Diligencia.Resource.Where(m => m.Servicio != null).OrderBy(m => m.Servicio).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Servicios_Periciales", "Servicio") ?? m.Servicio.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }
            _IEstatus_de_IndicioApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Estatus_de_Indicios_Estatus = _IEstatus_de_IndicioApiConsumer.SelAll(true);

            if (Estatus_de_Indicios_Estatus != null && Estatus_de_Indicios_Estatus.Resource != null)
            {
                ViewBag.Estatus_de_Indicios_Estatus = Estatus_de_Indicios_Estatus.Resource.Where(m => m.Descripcion != null).OrderBy(m => m.Descripcion).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Estatus_de_Indicio", "Descripcion") ?? m.Descripcion.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }


            ViewBag.Consult = consult == 1;
            if (consult == 1)
            {
                ViewBag.Operation = "Consult";
            }
            return(View(varDetalle_de_Indicios));
        }
Esempio n. 2
0
        public ActionResult Create(int Id = 0, int consult = 0)
        {
            int ModuleId   = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0;
            var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45160);

            ViewBag.Permission = permission;
            var varDetalle_de_Oficio_de_Servicio_Pericial = new Detalle_de_Oficio_de_Servicio_PericialModel();

            ViewBag.ObjectId  = "45160";
            ViewBag.Operation = "New";

            ViewBag.IsNew = true;



            if ((Id.GetType() == typeof(string) && Id.ToString() != "") || ((Id.GetType() == typeof(int) || Id.GetType() == typeof(Int16) || Id.GetType() == typeof(Int32) || Id.GetType() == typeof(Int64) || Id.GetType() == typeof(short)) && Id.ToString() != "0"))
            {
                ViewBag.IsNew     = false;
                ViewBag.Operation = "Update";
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDetalle_de_Oficio_de_Servicio_PericialApiConsumer.SetAuthHeader(_tokenManager.Token);
                var Detalle_de_Oficio_de_Servicio_PericialData = _IDetalle_de_Oficio_de_Servicio_PericialApiConsumer.GetByKeyComplete(Id).Resource.Detalle_de_Oficio_de_Servicio_Pericials[0];
                if (Detalle_de_Oficio_de_Servicio_PericialData == null)
                {
                    return(HttpNotFound());
                }

                varDetalle_de_Oficio_de_Servicio_Pericial = new Detalle_de_Oficio_de_Servicio_PericialModel
                {
                    Clave                       = (int)Detalle_de_Oficio_de_Servicio_PericialData.Clave
                    , Oficio                    = Detalle_de_Oficio_de_Servicio_PericialData.Oficio
                    , OficioDescripcion         = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Oficio_de_Servicio_PericialData.Oficio), "Tipo_de_Oficios") ?? (string)Detalle_de_Oficio_de_Servicio_PericialData.Oficio_Tipo_de_Oficios.Descripcion
                    , Servicio_Pericial         = Detalle_de_Oficio_de_Servicio_PericialData.Servicio_Pericial
                    , Servicio_PericialServicio = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Oficio_de_Servicio_PericialData.Servicio_Pericial), "Servicios_Periciales") ?? (string)Detalle_de_Oficio_de_Servicio_PericialData.Servicio_Pericial_Servicios_Periciales.Servicio
                };
            }
            if (!_tokenManager.GenerateToken())
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }

            _ITipo_de_OficiosApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Tipo_de_Oficioss_Oficio = _ITipo_de_OficiosApiConsumer.SelAll(true);

            if (Tipo_de_Oficioss_Oficio != null && Tipo_de_Oficioss_Oficio.Resource != null)
            {
                ViewBag.Tipo_de_Oficioss_Oficio = Tipo_de_Oficioss_Oficio.Resource.Where(m => m.Descripcion != null).OrderBy(m => m.Descripcion).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Tipo_de_Oficios", "Descripcion") ?? m.Descripcion.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }
            _IServicios_PericialesApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Servicios_Pericialess_Servicio_Pericial = _IServicios_PericialesApiConsumer.SelAll(true);

            if (Servicios_Pericialess_Servicio_Pericial != null && Servicios_Pericialess_Servicio_Pericial.Resource != null)
            {
                ViewBag.Servicios_Pericialess_Servicio_Pericial = Servicios_Pericialess_Servicio_Pericial.Resource.Where(m => m.Servicio != null).OrderBy(m => m.Servicio).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Servicios_Periciales", "Servicio") ?? m.Servicio.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }


            ViewBag.Consult = consult == 1;
            if (consult == 1)
            {
                ViewBag.Operation = "Consult";
            }
            return(View(varDetalle_de_Oficio_de_Servicio_Pericial));
        }
Esempio n. 3
0
        public ActionResult Create(int Id = 0, int consult = 0)
        {
            int ModuleId   = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0;
            var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45186);

            ViewBag.Permission = permission;
            var varDetalle_de_Solicitud_de_Indicio = new Detalle_de_Solicitud_de_IndicioModel();

            ViewBag.ObjectId  = "45186";
            ViewBag.Operation = "New";

            ViewBag.IsNew = true;



            if ((Id.GetType() == typeof(string) && Id.ToString() != "") || ((Id.GetType() == typeof(int) || Id.GetType() == typeof(Int16) || Id.GetType() == typeof(Int32) || Id.GetType() == typeof(Int64) || Id.GetType() == typeof(short)) && Id.ToString() != "0"))
            {
                ViewBag.IsNew     = false;
                ViewBag.Operation = "Update";
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDetalle_de_Solicitud_de_IndicioApiConsumer.SetAuthHeader(_tokenManager.Token);
                var Detalle_de_Solicitud_de_IndicioData = _IDetalle_de_Solicitud_de_IndicioApiConsumer.GetByKeyComplete(Id).Resource.Detalle_de_Solicitud_de_Indicios[0];
                if (Detalle_de_Solicitud_de_IndicioData == null)
                {
                    return(HttpNotFound());
                }

                varDetalle_de_Solicitud_de_Indicio = new Detalle_de_Solicitud_de_IndicioModel
                {
                    Clave = (int)Detalle_de_Solicitud_de_IndicioData.Clave
                    , Fecha_de_Solicitud     = (Detalle_de_Solicitud_de_IndicioData.Fecha_de_Solicitud == null ? string.Empty : Convert.ToDateTime(Detalle_de_Solicitud_de_IndicioData.Fecha_de_Solicitud).ToString(ConfigurationProperty.DateFormat))
                    , Hora_de_Solicitud      = Detalle_de_Solicitud_de_IndicioData.Hora_de_Solicitud
                    , Nombre_del_Solicitante = Detalle_de_Solicitud_de_IndicioData.Nombre_del_Solicitante
                    , Motivo                            = Detalle_de_Solicitud_de_IndicioData.Motivo
                    , Numero_de_Indicio                 = Detalle_de_Solicitud_de_IndicioData.Numero_de_Indicio
                    , Numero_de_IndicioDescripcion      = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Solicitud_de_IndicioData.Numero_de_Indicio), "Indicios_para_MPI") ?? (string)Detalle_de_Solicitud_de_IndicioData.Numero_de_Indicio_Indicios_para_MPI.Descripcion
                    , Nombre_de_Indicio                 = Detalle_de_Solicitud_de_IndicioData.Nombre_de_Indicio
                    , Descripcion_de_Entrega_de_Indicio = Detalle_de_Solicitud_de_IndicioData.Descripcion_de_Entrega_de_Indicio
                    , Diligencia_que_Solicita           = Detalle_de_Solicitud_de_IndicioData.Diligencia_que_Solicita
                    , Diligencia_que_SolicitaServicio   = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Solicitud_de_IndicioData.Diligencia_que_Solicita), "Servicios_Periciales") ?? (string)Detalle_de_Solicitud_de_IndicioData.Diligencia_que_Solicita_Servicios_Periciales.Servicio
                };
            }
            if (!_tokenManager.GenerateToken())
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }

            _IIndicios_para_MPIApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Indicios_para_MPIs_Numero_de_Indicio = _IIndicios_para_MPIApiConsumer.SelAll(true);

            if (Indicios_para_MPIs_Numero_de_Indicio != null && Indicios_para_MPIs_Numero_de_Indicio.Resource != null)
            {
                ViewBag.Indicios_para_MPIs_Numero_de_Indicio = Indicios_para_MPIs_Numero_de_Indicio.Resource.Where(m => m.Descripcion != null).OrderBy(m => m.Descripcion).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Indicios_para_MPI", "Descripcion") ?? m.Descripcion.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }
            _IServicios_PericialesApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Servicios_Pericialess_Diligencia_que_Solicita = _IServicios_PericialesApiConsumer.SelAll(true);

            if (Servicios_Pericialess_Diligencia_que_Solicita != null && Servicios_Pericialess_Diligencia_que_Solicita.Resource != null)
            {
                ViewBag.Servicios_Pericialess_Diligencia_que_Solicita = Servicios_Pericialess_Diligencia_que_Solicita.Resource.Where(m => m.Servicio != null).OrderBy(m => m.Servicio).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Servicios_Periciales", "Servicio") ?? m.Servicio.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }


            ViewBag.Consult = consult == 1;
            if (consult == 1)
            {
                ViewBag.Operation = "Consult";
            }
            return(View(varDetalle_de_Solicitud_de_Indicio));
        }
Esempio n. 4
0
        public ActionResult Create(int Id = 0, int consult = 0)
        {
            int ModuleId   = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0;
            var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45157);

            ViewBag.Permission = permission;
            var varDetalle_de_Servicios_Periciales = new Detalle_de_Servicios_PericialesModel();

            ViewBag.ObjectId  = "45157";
            ViewBag.Operation = "New";

            ViewBag.IsNew = true;



            if ((Id.GetType() == typeof(string) && Id.ToString() != "") || ((Id.GetType() == typeof(int) || Id.GetType() == typeof(Int16) || Id.GetType() == typeof(Int32) || Id.GetType() == typeof(Int64) || Id.GetType() == typeof(short)) && Id.ToString() != "0"))
            {
                ViewBag.IsNew     = false;
                ViewBag.Operation = "Update";
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDetalle_de_Servicios_PericialesApiConsumer.SetAuthHeader(_tokenManager.Token);
                var Detalle_de_Servicios_PericialesData = _IDetalle_de_Servicios_PericialesApiConsumer.GetByKeyComplete(Id).Resource.Detalle_de_Servicios_Pericialess[0];
                if (Detalle_de_Servicios_PericialesData == null)
                {
                    return(HttpNotFound());
                }

                varDetalle_de_Servicios_Periciales = new Detalle_de_Servicios_PericialesModel
                {
                    Clave                              = (int)Detalle_de_Servicios_PericialesData.Clave
                    , Servicio                         = Detalle_de_Servicios_PericialesData.Servicio
                    , ServicioServicio                 = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Servicios_PericialesData.Servicio), "Servicios_Periciales") ?? (string)Detalle_de_Servicios_PericialesData.Servicio_Servicios_Periciales.Servicio
                    , Especialista                     = Detalle_de_Servicios_PericialesData.Especialista
                    , Estatus_del_Dictamen             = Detalle_de_Servicios_PericialesData.Estatus_del_Dictamen
                    , Estatus_del_DictamenDescripcion  = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Servicios_PericialesData.Estatus_del_Dictamen), "Estatus_del_Dictamen") ?? (string)Detalle_de_Servicios_PericialesData.Estatus_del_Dictamen_Estatus_del_Dictamen.Descripcion
                    , Observaciones                    = Detalle_de_Servicios_PericialesData.Observaciones
                    , Fecha_del_Dictamen               = (Detalle_de_Servicios_PericialesData.Fecha_del_Dictamen == null ? string.Empty : Convert.ToDateTime(Detalle_de_Servicios_PericialesData.Fecha_del_Dictamen).ToString(ConfigurationProperty.DateFormat))
                    , Dictamen                         = Detalle_de_Servicios_PericialesData.Dictamen
                    , Rol_de_Donde_Proviene            = Detalle_de_Servicios_PericialesData.Rol_de_Donde_Proviene
                    , Rol_de_Donde_ProvieneDescripcion = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Servicios_PericialesData.Rol_de_Donde_Proviene), "Rol_de_Diligencia") ?? (string)Detalle_de_Servicios_PericialesData.Rol_de_Donde_Proviene_Rol_de_Diligencia.Descripcion
                    , ObservacionesD                   = Detalle_de_Servicios_PericialesData.ObservacionesD
                };
            }
            if (!_tokenManager.GenerateToken())
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }

            _IServicios_PericialesApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Servicios_Pericialess_Servicio = _IServicios_PericialesApiConsumer.SelAll(true);

            if (Servicios_Pericialess_Servicio != null && Servicios_Pericialess_Servicio.Resource != null)
            {
                ViewBag.Servicios_Pericialess_Servicio = Servicios_Pericialess_Servicio.Resource.Where(m => m.Servicio != null).OrderBy(m => m.Servicio).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Servicios_Periciales", "Servicio") ?? m.Servicio.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }
            _IEstatus_del_DictamenApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Estatus_del_Dictamens_Estatus_del_Dictamen = _IEstatus_del_DictamenApiConsumer.SelAll(true);

            if (Estatus_del_Dictamens_Estatus_del_Dictamen != null && Estatus_del_Dictamens_Estatus_del_Dictamen.Resource != null)
            {
                ViewBag.Estatus_del_Dictamens_Estatus_del_Dictamen = Estatus_del_Dictamens_Estatus_del_Dictamen.Resource.Where(m => m.Descripcion != null).OrderBy(m => m.Descripcion).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Estatus_del_Dictamen", "Descripcion") ?? m.Descripcion.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }
            _IRol_de_DiligenciaApiConsumer.SetAuthHeader(_tokenManager.Token);
            var Rol_de_Diligencias_Rol_de_Donde_Proviene = _IRol_de_DiligenciaApiConsumer.SelAll(true);

            if (Rol_de_Diligencias_Rol_de_Donde_Proviene != null && Rol_de_Diligencias_Rol_de_Donde_Proviene.Resource != null)
            {
                ViewBag.Rol_de_Diligencias_Rol_de_Donde_Proviene = Rol_de_Diligencias_Rol_de_Donde_Proviene.Resource.Where(m => m.Descripcion != null).OrderBy(m => m.Descripcion).Select(m => new SelectListItem
                {
                    Text = CultureHelper.GetTraduction(Convert.ToString(m.Clave), "Rol_de_Diligencia", "Descripcion") ?? m.Descripcion.ToString(), Value = Convert.ToString(m.Clave)
                }).ToList();
            }


            ViewBag.Consult = consult == 1;
            if (consult == 1)
            {
                ViewBag.Operation = "Consult";
            }
            return(View(varDetalle_de_Servicios_Periciales));
        }