Ejemplo n.º 1
0
        public static string Insertar3(int idtrabajador, int idproveedor, DateTime fecha,
                                       string tipo_comprobante, string serie, string correlativo, decimal igv,
                                       string estado, DataTable dtDetalles)
        {
            Dingreso Obj = new Dingreso
            {
                Idtrabajador     = idtrabajador,
                Idproveedor      = idproveedor,
                Fecha            = fecha,
                Tipo_Comprobante = tipo_comprobante,
                Serie            = serie,
                Correlativo      = correlativo,
                Igv    = igv,
                Estado = estado
            };

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

            foreach (DataRow row in dtDetalles.Rows)
            {
                Ddetalleingreso detalle = new Ddetalleingreso
                {
                    Idarticulo        = Convert.ToInt32(row["idarticulo"].ToString()),
                    Precio_Compra     = Convert.ToDecimal(row["precio_compra"].ToString()),
                    Precio_Venta      = Convert.ToDecimal(row["precio_venta"].ToString()),
                    Stock_Inicial     = Convert.ToInt32(row["stock_inicial"].ToString()),
                    Stock_Actual      = Convert.ToInt32(row["stock_inicial"].ToString()),
                    Fecha_Produccion  = Convert.ToDateTime(row["fecha_ingreso"].ToString()),
                    Fecha_Vencimiento = Convert.ToDateTime(row["fecha_modificacion"].ToString())
                };
                detalles.Add(detalle);
            }
            return(Obj.Insertar3(Obj, detalles));
        }
Ejemplo n.º 2
0
        public static string Insertar(int idTrabajador, int idProveedor, DateTime fecha, string tipoComprobante,
                                      string serie, string correlativo, decimal itbis, string estado, DataTable dtDetalles)
        {
            Dingreso Ingreso = new Dingreso()
            {
                IdTrabajador    = idTrabajador,
                IdProveedor     = idProveedor,
                Fecha           = fecha,
                TipoComprobante = tipoComprobante,
                Serie           = serie,
                Correlativo     = correlativo,
                Itbis           = itbis,
                Estado          = estado
            };

            var ListaDetalles = new List <DdetalleIngreso>();

            foreach (DataRow filasDetalles in dtDetalles.Rows)
            {
                DdetalleIngreso detalleIngreso = new DdetalleIngreso();
                detalleIngreso.IdArticulo       = Convert.ToInt32(filasDetalles["idarticulo"].ToString());
                detalleIngreso.PrecioCompra     = Convert.ToDecimal(filasDetalles["precio_compra"].ToString());
                detalleIngreso.PrecioVenta      = Convert.ToDecimal(filasDetalles["precio_venta"].ToString());
                detalleIngreso.StockInicial     = Convert.ToInt32(filasDetalles["stock_inicial"].ToString());
                detalleIngreso.StockActual      = Convert.ToInt32(filasDetalles["stock_inicial"].ToString());
                detalleIngreso.FechaProduccion  = Convert.ToDateTime(filasDetalles["fecha_produccion"].ToString());
                detalleIngreso.FechaVencimiento = Convert.ToDateTime(filasDetalles["fecha_vencimiento"].ToString());

                ListaDetalles.Add(detalleIngreso);
            }
            return(Ingreso.Insertar(Ingreso, ListaDetalles));
        }
Ejemplo n.º 3
0
        public static string Anular(int idingreso)
        {
            Dingreso Obj = new Dingreso
            {
                Idingreso = idingreso
            };

            return(Obj.Anular(Obj));
        }
Ejemplo n.º 4
0
        public static string Anular(int idIngreso)
        {
            Dingreso Ingreso = new Dingreso()
            {
                IdIngreso = idIngreso
            };

            return(Ingreso.Anular(Ingreso));
        }
Ejemplo n.º 5
0
        public static DataTable MostrarDetalle(string textobuscar)
        {
            Dingreso Obj = new Dingreso();

            return(Obj.Mostrardetalle(textobuscar));
        }
Ejemplo n.º 6
0
        //Método BuscarFecha que llama al método BuscarNombre
        //de la clase DIngreso de la CapaDatos

        public static DataTable BuscarFechas(string textobuscar, string textobuscar2)
        {
            Dingreso Obj = new Dingreso();

            return(Obj.BuscarFechas(textobuscar, textobuscar2));
        }
Ejemplo n.º 7
0
        public static DataTable MostrarDetalles(string textoBuscar)
        {
            Dingreso Ingreso = new Dingreso();

            return(Ingreso.MostrarDetalles(textoBuscar));
        }
Ejemplo n.º 8
0
        public static DataTable BuscarFechas(string fechaInicio, string fechaFin)
        {
            Dingreso Ingreso = new Dingreso();

            return(Ingreso.BuscarFechas(fechaInicio, fechaFin));
        }