Exemple #1
0
        private void BtnRefrescar_Click(object sender, EventArgs e)
        {
            this.dataGridView1.Columns[0].Visible = true;
            DataSet DS = DatosEntidad.Dataset("LiquidacionPeriodo", "", Convert.ToInt32(this.CmbPeriodos.SelectedValue), 0.00);

            dataGridView1.DataSource = DS.Tables[0];
            dataGridView1.AutoResizeColumns();

            TotalGrid.MarcarSeleccion(this.dataGridView1);
            TotalGrid.HabilitarCheck(this.dataGridView1);
            this.ToolStripTxbRegistros.Text = TotalGrid.RegistrosSeleccionados(dataGridView1);
            this.ToolStripTxbDetalle.Text   = TotalGrid.TotalLiquidacion(this.dataGridView1);

            #region Aplicando accion del chech que activo Grupo Damasa
            if (this.ChbOmitirDamasa.Checked)
            {
                foreach (DataGridViewRow row in this.dataGridView1.Rows)
                {
                    if (Convert.ToString(row.Cells[1].Value).Trim() == "039" || Convert.ToString(row.Cells[1].Value).Trim() == "080" || Convert.ToString(row.Cells[1].Value).Trim() == "089")
                    {
                        row.Cells[0].Value = false;
                    }
                }
            }
            else
            {
                foreach (DataGridViewRow row in this.dataGridView1.Rows)
                {
                    if (Convert.ToString(row.Cells[1].Value).Trim() == "039" || Convert.ToString(row.Cells[1].Value).Trim() == "080" || Convert.ToString(row.Cells[1].Value).Trim() == "089")
                    {
                        row.Cells[0].Value = true;
                    }
                }
            }
            #endregion


            #region Aplicando accion del chech que activo Grupo Masora
            if (this.ChbOmitirMasora.Checked)
            {
                foreach (DataGridViewRow row in this.dataGridView1.Rows)
                {
                    if (Convert.ToString(row.Cells[1].Value).Trim() == "020" || Convert.ToString(row.Cells[1].Value).Trim() == "090" || Convert.ToString(row.Cells[1].Value).Trim() == "091")
                    {
                        row.Cells[0].Value = false;
                    }
                }
            }
            else
            {
                foreach (DataGridViewRow row in this.dataGridView1.Rows)
                {
                    if (Convert.ToString(row.Cells[1].Value).Trim() == "020" || Convert.ToString(row.Cells[1].Value).Trim() == "090" || Convert.ToString(row.Cells[1].Value).Trim() == "091")
                    {
                        row.Cells[0].Value = true;
                    }
                }
            }
            #endregion
        }
Exemple #2
0
 private void ChkMarcar_CheckedChanged(object sender, EventArgs e)
 {
     if (this.ChkMarcar.Checked)
     {
         foreach (DataGridViewRow row in dataGridView1.Rows)
         {
             int index = row.Index;
             if (Convert.ToInt32(row.Cells[8].Value) == 0)
             {
                 row.Cells[0].Value = false;
                 this.dataGridView1.Rows[index].DefaultCellStyle.BackColor = Color.LightSkyBlue;
             }
             else
             {
                 row.Cells[0].Value = true;
             }
         }
     }
     else
     {
         foreach (DataGridViewRow row in dataGridView1.Rows)
         {
             row.Cells[0].Value = false;
         }
     }
     this.ToolStripTxbRegistros.Text = TotalGrid.RegistrosSeleccionados(dataGridView1);
     this.ToolStripTxbDetalle.Text   = TotalGrid.TotalLiquidacion(dataGridView1);
 }
Exemple #3
0
 private void ToolStripTxbRegistros_Enter(object sender, EventArgs e)
 {
     this.ToolStripTxbRegistros.Text = TotalGrid.RegistrosSeleccionados(dataGridView1);
     this.ToolStripTxbDetalle.Text   = TotalGrid.TotalLiquidacion(dataGridView1);
 }