示例#1
0
        public JsonResult ActualizaDescripcionLoc(int puerto, string descripcion, int locacion)
        {
            var respuesta = new { mensaje = "" };

            try
            {
                Mantenedores.ActualizaLocDescripcion(puerto, locacion, descripcion);
                respuesta = new { mensaje = "" };
                return(Json(respuesta));
            }
            catch (Exception ex)            {
                respuesta = new { mensaje = ex.Message.ToString() };
                return(Json(respuesta));
            }
        }
示例#2
0
        public JsonResult ActualizaDescripcionNave(int nave, string descripcion)
        {
            var respuesta = new { mensaje = "" };

            try
            {
                Mantenedores.CambiaDescripcionNave(nave, descripcion);
                respuesta = new { mensaje = "" };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString() };
                return(Json(respuesta));
            }
        }
示例#3
0
        public JsonResult GuardarNaves(int id, string nombre)
        {
            var respuesta = new { mensaje = "" };

            try
            {
                Mantenedores.AgregaNave(id, nombre);
                respuesta = new { mensaje = "" };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString() };
                return(Json(respuesta));
            }
        }
示例#4
0
        public JsonResult ActualizaEstadoLoc(int puerto, int locacion, int opcion)
        {
            var respuesta = new { mensaje = "" };

            try
            {
                Mantenedores.CambiaEstadoLoc(puerto, locacion, opcion);
                respuesta = new { mensaje = "" };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString() };
                return(Json(respuesta));
            }
        }
示例#5
0
        public JsonResult GetNavesPrincipal()
        {
            var    respuesta  = new { mensaje = "", total = 0, html = "" };
            string naves_html = "";

            try
            {
                naves_html = Mantenedores.GetNavesPrincipal_Html();
                respuesta  = new { mensaje = "", total = 1, html = naves_html };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), total = 0, html = "" };
                return(Json(respuesta));
            }
        }
示例#6
0
        public JsonResult GetLocacionPuertoPrincipal(int puerto)
        {
            var    respuesta     = new { mensaje = "", total = 0, html = "" };
            string locacion_html = "";

            try
            {
                locacion_html = Mantenedores.GetLocacionesPuertoPrincipal_Html(puerto);
                respuesta     = new { mensaje = "", total = 1, html = locacion_html };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), total = 0, html = "" };
                return(Json(respuesta));
            }
        }
        public JsonResult GetIgresosDia(int puerto)
        {
            var    respuesta  = new { mensaje = "", html = "" };
            string html_tabla = "";

            try
            {
                html_tabla = Mantenedores.GetIngresosDia(puerto);
                respuesta  = new { mensaje = "", html = html_tabla };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), html = "" };
                return(Json(respuesta));
            }
        }
        public JsonResult GetSolicitudes(int puerto)
        {
            var       respuesta = new { mensaje = "", ingresos = 0, vehiculos = 0, solicitudes = 0 };
            DashBoard Dash      = new DashBoard();

            try
            {
                Dash      = Mantenedores.Resumen(puerto);
                respuesta = new { mensaje = "", ingresos = Dash.Ingresos, vehiculos = Dash.Vehiculos, solicitudes = Dash.Solicitudes };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), ingresos = 0, vehiculos = 0, solicitudes = 0 };
                return(Json(respuesta));
            }
        }
        public JsonResult GetEmpresasActivas(int rut, string nombre)
        {
            var    respuesta     = new { mensaje = "", total = 0, html = "" };
            string empresas_html = "";

            try
            {
                empresas_html = Mantenedores.GetEmpresasActivas(rut, nombre);
                respuesta     = new { mensaje = "", total = 1, html = empresas_html };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), total = 0, html = "" };
                return(Json(respuesta));
            }
        }
        public JsonResult GetNavesActivas(int codigo, string nombre, int puerto)
        {
            var    respuesta  = new { mensaje = "", total = 0, html = "" };
            string naves_html = "";

            try
            {
                naves_html = Mantenedores.GetNavesActivas(codigo, nombre, puerto);
                respuesta  = new { mensaje = "", total = 1, html = naves_html };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), total = 0, html = "" };
                return(Json(respuesta));
            }
        }
示例#11
0
        public JsonResult CargarListados()
        {
            StringBuilder  puerto_html = new StringBuilder();
            var            respuesta   = new { mensaje = "", puerto = "" };
            List <Puertos> ls_puerto   = new List <Puertos>();

            ls_puerto = Mantenedores.GetPuertos();

            puerto_html.AppendLine("<option value='" + "0" + "' selected>" + "Seleccione" + "</option>");


            if (ls_puerto.Count > 0)
            {
                foreach (Puertos item in ls_puerto)
                {
                    puerto_html.AppendLine("<option  value='" + item.Id + "' data-rut='" + item.Rut + "'>" + item.Nombre + "</option>");
                }
            }


            respuesta = new { mensaje = "", puerto = puerto_html.ToString() };
            return(Json(respuesta));
        }
示例#12
0
        public JsonResult CargarSelect(int puerto)
        {
            var           respuesta     = new { mensaje = "", locaciones = "" };
            StringBuilder locacion_html = new StringBuilder();

            List <Locacion> ls_locacion = new List <Locacion>();

            ls_locacion = Mantenedores.GetLocaciones(puerto);

            locacion_html.AppendLine("<option value='" + "0" + "' selected>" + "Seleccione" + "</option>");


            if (ls_locacion.Count > 0)
            {
                foreach (Locacion item in ls_locacion)
                {
                    locacion_html.AppendLine("<option value='" + item.Id + "'>" + item.Nombre + "</option>");
                }
            }


            respuesta = new { mensaje = "", locaciones = locacion_html.ToString() };
            return(Json(respuesta));
        }
示例#13
0
        public JsonResult CargarListados()
        {
            StringBuilder puerto_html   = new StringBuilder();
            StringBuilder empresas_html = new StringBuilder();
            StringBuilder tipos_html    = new StringBuilder();
            StringBuilder nacion_html   = new StringBuilder();
            StringBuilder vehiculo_html = new StringBuilder();

            var respuesta = new { mensaje = "", puerto = "", empresa = "", tipo_ingreso = "", nacion = "", vehiculo = "" };

            List <Puertos>      ls_puerto   = new List <Puertos>();
            List <Empresas>     ls_empresa  = new List <Empresas>();
            List <TipoIngreso>  ls_tipos    = new List <TipoIngreso>();
            List <Nacionalidad> ls_nacion   = new List <Nacionalidad>();
            List <TipoVehiculo> ls_vehiculo = new List <TipoVehiculo>();


            ls_puerto   = Mantenedores.GetPuertos();
            ls_empresa  = Mantenedores.GetEmpresas("111", "N");
            ls_tipos    = Mantenedores.GetTipoIngreso();
            ls_nacion   = Mantenedores.GetNacionalidad();
            ls_vehiculo = Mantenedores.GetTipoVehiculos();

            //puerto_html.AppendLine("<option value='" + "0" + "' selected>" + "Seleccione" + "</option>");
            empresas_html.AppendLine("<option value='" + "0" + "' selected>" + "No Informada" + "</option>");
            tipos_html.AppendLine("<option value='" + "0" + "' selected>" + "Seleccione" + "</option>");
            nacion_html.AppendLine("<option value='" + "0" + "'>" + "Seleccione" + "</option>");
            vehiculo_html.AppendLine("<option value='" + "0" + "' selected>" + "Seleccione" + "</option>");



            if (ls_puerto.Count > 0)
            {
                foreach (Puertos item in ls_puerto)
                {
                    puerto_html.AppendLine("<option value='" + item.Id + "'>" + item.Nombre + "</option>");
                }
            }

            if (ls_empresa.Count > 0)
            {
                foreach (Empresas item in ls_empresa)
                {
                    empresas_html.AppendLine("<option value='" + item.Id + "'>" + item.Info + "</option>");
                }
            }

            if (ls_tipos.Count > 0)
            {
                foreach (TipoIngreso item in ls_tipos)
                {
                    tipos_html.AppendLine("<option value='" + item.Id + "'>" + item.Nombre + "</option>");
                }
            }
            if (ls_nacion.Count > 0)
            {
                foreach (Nacionalidad item in ls_nacion)
                {
                    if (item.Id == 39)
                    {
                        nacion_html.AppendLine("<option selected='selected'  value='" + item.Id + "'>" + item.Nombre + "</option>");
                    }
                    else
                    {
                        nacion_html.AppendLine("<option value='" + item.Id + "'>" + item.Nombre + "</option>");
                    }
                }
            }

            if (ls_vehiculo.Count > 0)
            {
                foreach (TipoVehiculo item in ls_vehiculo)
                {
                    vehiculo_html.AppendLine("<option value='" + item.id + "'>" + item.glosa + "</option>");
                }
            }


            respuesta = new { mensaje = "", puerto = puerto_html.ToString(), empresa = empresas_html.ToString(), tipo_ingreso = tipos_html.ToString(), nacion = nacion_html.ToString(), vehiculo = vehiculo_html.ToString() };
            return(Json(respuesta));
        }