示例#1
0
        //llenar la entidad con los datos
        private CotizarArticulos LlenaClase()
        {
            CotizarArticulos cotizar = new CotizarArticulos();

            cotizar.CotizarId   = Convert.ToInt32(Id_numericUpDown.Value);
            cotizar.Fecha       = FechaCotizacion_dateTimePicker.Value.Date;
            cotizar.Total       = Total_numericUpDown.Value;
            cotizar.Comentarios = Comentarios_textBox.Text;

            foreach (DataGridViewRow item in DetalleDataGridView.Rows)
            {
                cotizar.AgregarDetalle(
                    ToInt(item.Cells["Id"].Value),
                    ToInt(item.Cells["CotizarId"].Value),
                    ToInt(item.Cells["ArticuloId"].Value),
                    ToInt(item.Cells["PersonaId"].Value),
                    ToInt(item.Cells["Cantidad"].Value),
                    ToInt(item.Cells["Precio"].Value),
                    ToInt(item.Cells["Importe"].Value)
                    );
            }

            return(cotizar);
        }