Пример #1
0
        private void btnBloquear_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvDatos.RowCount > 0)
                {
                    dialogResult = MessageBox.Show("Seguro de bloquear las cuentas por pagar seleccionadas?", "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dialogResult == DialogResult.Yes)
                    {
                        int count = 0;
                        foreach (DataGridViewRow row in dgvDatos.Rows)
                        {
                            DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["CheckSel"];
                            if (chk.Value != null)
                            {
                                if (chk.Value.ToString().Equals("True"))
                                {
                                    CuentasxPagarTMBloqueoBE oEntity = new CuentasxPagarTMBloqueoBE();
                                    oEntity.OPCION     = 2;
                                    oEntity.USUARIO    = General.General.GetCodigoUsuario;
                                    oEntity.ctaPagarID = row.Cells["ctaPagarID"].Value.ToString();
                                    new CuentasxPagarTMBloqueoBL().ProcesarCuentasxPagarTMBloqueo(oEntity);
                                    count++;
                                }
                            }
                        }

                        if (count > 0)
                        {
                            MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            BuscarDatos();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void BuscarDatos()
        {
            try
            {
                CuentasxPagarTMBloqueoBE oEntity = new CuentasxPagarTMBloqueoBE();
                oEntity.OPCION     = chkCuentasBloqueadas.Checked ? 1: 4;
                oEntity.USUARIO    = General.General.GetCodigoUsuario;
                oEntity.IdSocio    = TextBoxX1.Text;
                oEntity.IdPagadora = txtIdPagadora.Text;
                DataSet ds = new CuentasxPagarTMBloqueoBL().ProcesarCuentasxPagarTMBloqueo(oEntity);
                dgvDatos.DataSource = ds.Tables[0];
                lblRegistros.Text   = ds.Tables[0].Rows.Count + " registro(s)";

                ((CheckBox)dgvDatos.Controls.Find("CheckSel", true)[0]).Checked = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public DataSet ProcesarCuentasxPagarTMBloqueo(CuentasxPagarTMBloqueoBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("CuentasxPagarTMBloqueo_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "ctaPagarID", DbType.String, BE.ctaPagarID);
                db.AddInParameter(cmd, "IdLote", DbType.String, BE.IdLote);
                db.AddInParameter(cmd, "IdSocio", DbType.String, BE.IdSocio);
                db.AddInParameter(cmd, "IdPagadora", DbType.String, BE.IdPagadora);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
 public DataSet ProcesarCuentasxPagarTMBloqueo(CuentasxPagarTMBloqueoBE BE)
 {
     return(CuentasxPagarTMBloqueoDA.ProcesarCuentasxPagarTMBloqueo(BE));
 }