Example #1
0
        /// <summary>
        /// Guarda los detalles
        /// </summary>
        /// <returns></returns>
        public bool GuardarDetalles()
        {
            if (ListarDetalle() != null)
            {
                if (ListarDetalle().Count > 0)
                {
                    List <DetalleMovimientoN> t_list = new List <DetalleMovimientoN>();



                    for (int a = 0; a < ListarDetalle().Count; a++)
                    {
                        DetalleMovimientoN _mov = (DetalleMovimientoN)ListarDetalle()[a];
                        _mov.GuardarDetalle();
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// Carga los detalles en memoria y devuelve un listado de detalles
        /// </summary>
        /// <returns></returns>
        public List <DetalleMovimientoN> CargarDetalle()
        {
            base.VaciarMovimientos();
            _Conexion = new Datos.MovimientoD();
            List <DetalleMovimientoN> t_list;
            DataTable t_DT = _Conexion.ObtenerDetalle(Id);

            if (t_DT != null)
            {
                t_list = new List <DetalleMovimientoN>();
                for (int a = 0; a < t_DT.Rows.Count; a++)
                {
                    DataRow            t_DR = t_DT.Rows[a];
                    DetalleMovimientoN t_DM = new DetalleMovimientoN
                                              (
                        int.Parse(t_DR["Id"].ToString()),
                        int.Parse(t_DR["ClaveMov"].ToString()),
                        int.Parse(t_DR["IdArticulo"].ToString()),
                        int.Parse(t_DR["Cantidad"].ToString()),
                        decimal.Parse(t_DR["PrecioUnitario"].ToString()),
                        decimal.Parse(t_DR["ImporteSubTotal"].ToString()),
                        this

                                              );
                    t_list.Add(t_DM);
                    AgregarDetalle(t_DM);
                }
                return(t_list);
            }
            return(null);
        }
Example #3
0
 /// <summary>
 /// Elimina un detalle de la base de datos
 /// </summary>
 /// <param name="p_detalle"></param>
 public void EliminarDetalle(DetalleMovimientoN p_detalle)
 {
     EliminarMovimiento(p_detalle);
 }
Example #4
0
 /// <summary>
 /// Inserta un detalle nuevo pero no guarda cambios
 /// </summary>
 /// <param name="p_detalle"></param>
 public void InsertarDetalle(DetalleMovimientoN p_detalle)
 {
     AgregarDetalle(p_detalle);
 }