コード例 #1
0
        public static string Insertar(int idingreso, int idtrabajador, int idproveedor, DateTime fecha, string tipo_pago,
                                      string num_comprobante, decimal igv, int estado, DataTable dtDetalles)
        {
            IngresoDAL proc    = new IngresoDAL();
            Ingreso    entidad = new Ingreso();

            entidad.IDIngreso       = idingreso;
            entidad.IDTrabajador    = idtrabajador;
            entidad.IDproveedor     = idproveedor;
            entidad.Fecha           = fecha;
            entidad.Tipo_Pago       = tipo_pago;
            entidad.Num_Comprobante = num_comprobante;
            entidad.IGV             = igv;
            entidad.Estado          = estado;


            List <Detalle_Ingreso> detalles = new List <Detalle_Ingreso>();

            foreach (DataRow row in dtDetalles.Rows)
            {
                Detalle_Ingreso detalle = new Detalle_Ingreso();
                detalle.Idarticulo        = Convert.ToInt32(row["idarticulo"].ToString());
                detalle.Precio_Compra     = Convert.ToDecimal(row["precio_compra"].ToString());
                detalle.Precio_Venta      = Convert.ToDecimal(row["precio_venta"].ToString());
                detalle.Stock_Inicial     = Convert.ToInt32(row["stock_inicial"].ToString());
                detalle.Stock_Actual      = Convert.ToInt32(row["stock_inicial"].ToString());
                detalle.Fecha_Produccion  = Convert.ToDateTime(row["fecha_produccion"].ToString());
                detalle.Fecha_Vencimiento = Convert.ToDateTime(row["fecha_vencimiento"].ToString());
                detalles.Add(detalle);
            }


            return(proc.Insertar(entidad, detalles));
        }
コード例 #2
0
        public JsonResult ModificaVehiculo(string patente, int tipo, string descripcion, int id)

        {
            StringBuilder   vehiculo_html = new StringBuilder();
            List <Vehiculo> vehiculos     = new List <Vehiculo>();
            var             respuesta     = new { mensaje = "", patente = "" };

            try
            {
                VehiculoDAL.ModificaPatenteIngreso(patente, tipo, descripcion, id);

                //Obtenemos nuevo listado de patente
                //vehiculo_html.AppendLine("<option value='" + "0" + "'>" + "Sin Vehículo" + "</option>");
                vehiculos = IngresoDAL.ListarPatente(id);
                foreach (Vehiculo item in vehiculos)
                {
                    if (patente == item.Patente)
                    {
                        vehiculo_html.AppendLine("<option value='" + item.Id + "'" + " selected>" + item.Patente + "</option>");
                    }
                    else
                    {
                        vehiculo_html.AppendLine("<option value='" + item.Id + "'" + ">" + item.Patente + "</option>");
                    }
                }

                respuesta = new { mensaje = "", patente = vehiculo_html.ToString() };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = "ERROR: " + ex.Message.ToString(), patente = "" };
                return(Json(respuesta));
            }
        }
コード例 #3
0
        public JsonResult VerIngreso(int rut, string pasaporte)
        {
            var             respuesta        = new { mensaje = "", solicitud = new IngresoCliente(), existe = 0, patente = "", total_patente = 0, aprobadores = "" };
            List <Vehiculo> vehiculos        = new List <Vehiculo>();
            IngresoCliente  resultado        = new IngresoCliente();
            StringBuilder   vehiculo_html    = new StringBuilder();
            string          aprobadores_html = "";

            try
            {
                resultado = AccesoClienteDAL.BuscarIngreso(rut, pasaporte);
                vehiculos = IngresoDAL.ListarPatente(resultado.Idsolicitud);



                if (vehiculos.Count() > 1)
                {
                    //vehiculo_html.AppendLine("<option value='" + "0" + "' selected>" + "Sin Vehículo" + "</option>");
                    foreach (Vehiculo item in vehiculos)

                    {
                        vehiculo_html.AppendLine("<option value='" + item.Id + "'>" + item.Patente + "</option>");
                    }
                }
                else if (vehiculos.Count() == 1)
                {
                    vehiculo_html.AppendLine("<option value='" + "0" + "'>" + "Sin Vehículo" + "</option>");
                    foreach (Vehiculo item in vehiculos)
                    {
                        vehiculo_html.AppendLine("<option value='" + item.Id + "' selected>" + item.Patente + "</option>");
                    }
                }
                else
                {
                    vehiculo_html.AppendLine("<option value='" + "0" + "' selected>" + "Sin Vehículo" + "</option>");
                }

                if (resultado.Idsolicitud != 0)
                {
                    aprobadores_html = IngresoDAL.DevuelveAprobadores(resultado.Idsolicitud, rut);


                    respuesta = new { mensaje = "", solicitud = resultado, existe = 1, patente = vehiculo_html.ToString(), total_patente = vehiculos.Count(), aprobadores = aprobadores_html };
                    return(Json(respuesta));
                }
                else
                {
                    respuesta = new { mensaje = "", solicitud = new IngresoCliente(), existe = 0, patente = "", total_patente = 0, aprobadores = aprobadores_html };
                    return(Json(respuesta));
                }
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), solicitud = new IngresoCliente(), existe = 0, patente = "", total_patente = 0, aprobadores = "" };
                return(Json(respuesta));
            }
        }
コード例 #4
0
 public static string Anular(int idingreso)
 {
     try
     {
         Ingreso    entidad = new Ingreso();
         IngresoDAL proc    = new IngresoDAL();
         entidad.IDIngreso = idingreso;
         return(proc.Anular(entidad));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #5
0
        public JsonResult UltimaPatente(int idPersonaAprobada)
        {
            Login login = new Login();

            login = (Login)Session["UsuarioAutentificado"];
            var respuesta = new { mensaje = "", idVehiculo = "", patente = "" };

            try
            {
                Vehiculo vel = IngresoDAL.ValidaVehiculo(idPersonaAprobada);
                respuesta = new { mensaje = "", idVehiculo = vel.Id.ToString(), patente = vel.Patente };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = "", idVehiculo = "0", patente = "" };
                return(Json(respuesta));
            }
        }
コード例 #6
0
        public JsonResult UltimasSolicitudes(int rut, string pasaporte)
        {
            Login login = new Login();

            login = (Login)Session["UsuarioAutentificado"];
            var    respuesta           = new { mensaje = "", html = "", nombre = "" };
            string ultimas_solicitudes = "";
            string mi_nombre           = "";

            try
            {
                ultimas_solicitudes = IngresoDAL.UltimasSolicitudes(rut, ref mi_nombre, pasaporte);
                respuesta           = new { mensaje = "", html = ultimas_solicitudes, nombre = mi_nombre };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), html = "", nombre = "" };
                return(Json(respuesta));
            }
        }
コード例 #7
0
        public JsonResult GuardaIngreso(int id, string patente, int registro)
        {
            if (patente == "0")
            {
                patente = null;
            }

            var respuesta = new { mensaje = "" };

            try
            {
                IngresoDAL.RegistraAcceso(registro, "", id, patente);
                respuesta = new { mensaje = "" };
                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message };
                return(Json(respuesta));
            }
        }
コード例 #8
0
 public static int Guardar(Ingreso pIngreso)
 {
     return(IngresoDAL.Guardar(pIngreso));
 }
コード例 #9
0
 public static int Eliminar(int pIdIngreso)
 {
     return(IngresoDAL.Eliminar(pIdIngreso));
 }
コード例 #10
0
 public IngresoController()
 {
     _oIngresoDAL = new IngresoDAL();
 }
コード例 #11
0
        public static DataTable MostrarDetalle(string textobuscar)
        {
            IngresoDAL Obj = new IngresoDAL();

            return(Obj.MostrarDetalle(textobuscar));
        }
コード例 #12
0
        public static DataTable Buscar_Articulo_Ingreso_Nombre(string textobuscar)
        {
            IngresoDAL Obj = new IngresoDAL();

            return(Obj.Buscar_Articulo_Ingreso_Nombre(textobuscar));
        }
コード例 #13
0
 public static int Modificar(Ingreso pIngreso)
 {
     return(IngresoDAL.Modificar(pIngreso));
 }
コード例 #14
0
 public static List <Ingreso> ObtenerTodos(string pCondicion = "%")
 {
     return(IngresoDAL.ObtenerTodos(pCondicion));
 }
コード例 #15
0
        //Método BuscarRazon_Social que llama al método BuscarNombre
        //de la clase DProveedor de la CapaDatos

        public static DataTable Buscar_Proveedor_Ingreso_RNC(string textobuscar)
        {
            IngresoDAL Obj = new IngresoDAL();

            return(Obj.Buscar_Proveedor_Ingreso_RNC(textobuscar));
        }
コード例 #16
0
 public static Ingreso BuscarPorNumeroCCF(int pIdMarca, DateTime pFechaIngreso, string pNumeroCCF)
 {
     return(IngresoDAL.BuscarPorNumeroCCF(pIdMarca, pFechaIngreso, pNumeroCCF));
 }
コード例 #17
0
 public static Ingreso BuscarPorId(int pId)
 {
     return(IngresoDAL.BuscarPorId(pId));
 }