Пример #1
0
        private void btn_Cargar_Click(object sender, EventArgs e)
        {
            /*Función para validar si en el combo de fechas no existe ningun dato*/
            if (cmb_Mes.SelectedIndex == -1)                /*se coloca -1 porque el array empieza en 0=enero,1=febrero,2=marzo,etc*/
            {
                MessageBox.Show("Debe Seleccionar un MES"); /*mensaje de error cuando no esta seleccionado un mes*/
            }
            else
            {
                objListVentas         = objVentasDao.listarLibroVentas(lbl_anho.Text + cmb_Mes.SelectedValue.ToString(), DateTime.DaysInMonth(Convert.ToInt32(lbl_anho.Text), Convert.ToInt32(cmb_Mes.SelectedValue.ToString())).ToString());
                grd_Ventas.DataSource = objListVentas;
                grd_Ventas.Refresh();

                /*foreach (DataGridViewRow row in grd_Ventas.Rows)
                 *
                 * {
                 *  if (Convert.ToString(row.Cells["Moneda"].Value) == "PEN" && Convert.ToString(row.Cells["TipoCambio"].Value) == "0")
                 *  {
                 *
                 *      row.Cells["TipoCambio"].Value = "";
                 *
                 *  }
                 *
                 *
                 * }*/
            }
        }