示例#1
0
        private void btnQuitarPagadora_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvPagadoras.RowCount > 0)
                {
                    dialogResult = MessageBox.Show("Seguro de Eliminar la Pagadora: " + dgvPagadoras.CurrentRow.Cells["Pagadora"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dialogResult == DialogResult.Yes)
                    {
                        if (!String.IsNullOrEmpty(txtIdGrupoPagadora.Text.Trim()))
                        {
                            GrupoPagadoraDetalleBE GrupoPagadoraDetalleBE = new GrupoPagadoraDetalleBE();
                            GrupoPagadoraDetalleBE.OPCION          = 3;
                            GrupoPagadoraDetalleBE.USUARIO         = General.General.GetCodigoUsuario;
                            GrupoPagadoraDetalleBE.IdGrupoPagadora = txtIdGrupoPagadora.Text.Trim();
                            GrupoPagadoraDetalleBE.IdPagadora      = dgvPagadoras.CurrentRow.Cells["IdPagadora"].Value.ToString();
                            GrupoPagadoraDetalleBL.ProcesarGrupoPagadoraDetalle(GrupoPagadoraDetalleBE);
                            MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            CargarDetalle(txtIdGrupoPagadora.Text.Trim());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void CargarDetalle(String IdGrupoPagadora)
        {
            DataSet dsGrupoPagadoraDetalle = new DataSet();
            GrupoPagadoraDetalleBE GrupoPagadoraDetalleBE = new GrupoPagadoraDetalleBE()
            {
                OPCION          = 1,
                USUARIO         = General.General.GetCodigoUsuario,
                IdGrupoPagadora = IdGrupoPagadora
            };

            dsGrupoPagadoraDetalle = GrupoPagadoraDetalleBL.ProcesarGrupoPagadoraDetalle(GrupoPagadoraDetalleBE);

            if (dsGrupoPagadoraDetalle.Tables[0].Rows.Count > 0)
            {
                dgvPagadoras.DataSource = dsGrupoPagadoraDetalle.Tables[0];
            }
        }
        public DataSet ProcesarGrupoPagadoraDetalle(GrupoPagadoraDetalleBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("GrupoPagadoraDetalle_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdGrupoPagadora", DbType.String, BE.IdGrupoPagadora);
                db.AddInParameter(cmd, "IdPagadora", DbType.String, BE.IdPagadora);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
示例#4
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtvcGrupo.Text.Trim()))
                {
                    MessageBox.Show("Se debe Ingresar el nombre del Grupo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtvcGrupo.Focus();
                    return;
                }

                if (string.IsNullOrEmpty(cboIdCargo_tt.SelectedValue.ToString()))
                {
                    MessageBox.Show("Se debe seleccionar un Cargo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    cboIdCargo_tt.Focus();
                    return;
                }

                if (string.IsNullOrEmpty(txtvcContacto.Text.Trim()))
                {
                    MessageBox.Show("Se debe Ingresar nombre de Contacto", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtvcContacto.Focus();
                    return;
                }

                if (dtPagadoras.Rows.Count == 0)
                {
                    MessageBox.Show("Debe agregar al menos una pagadora.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    btnAgregarPagadora.Focus();
                    return;
                }

                DataSet         dsGrupoPagadoraBE = new DataSet();
                GrupoPagadoraBE GrupoPagadoraBE   = new GrupoPagadoraBE()
                {
                    OPCION          = 2,
                    USUARIO         = General.General.GetCodigoUsuario,
                    IdGrupoPagadora = txtIdGrupoPagadora.Text.Trim(),
                    vcGrupo         = txtvcGrupo.Text.Trim(),
                    IdCargo_tt      = cboIdCargo_tt.SelectedValue.ToString(),
                    vcContacto      = txtvcContacto.Text.Trim(),
                    vcTelefono1     = mskvcTelefono1.Text.Trim(),
                    vcTelefono2     = mskvcTelefono2.Text.Trim(),
                    vcAnexo         = txtvcAnexo.Text.Trim(),
                    vcCelular       = mskvcCelular.Text.Trim(),
                    vcEmail         = txtvcEmail.Text.Trim()
                };

                dsGrupoPagadoraBE = GrupoPagadoraBL.ProcesarGrupoPagadora(GrupoPagadoraBE);
                if (dsGrupoPagadoraBE.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in dtPagadoras.Rows)
                    {
                        GrupoPagadoraDetalleBE GrupoPagadoraDetalleBE = new GrupoPagadoraDetalleBE()
                        {
                            OPCION          = 2,
                            USUARIO         = General.General.GetCodigoUsuario,
                            IdGrupoPagadora = dsGrupoPagadoraBE.Tables[0].Rows[0]["IdGrupoPagadora"].ToString(),
                            IdPagadora      = row["IdPagadora"].ToString()
                        };
                        GrupoPagadoraDetalleBL.ProcesarGrupoPagadoraDetalle(GrupoPagadoraDetalleBE);
                    }
                }

                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#5
0
 public DataSet ProcesarGrupoPagadoraDetalle(GrupoPagadoraDetalleBE BE)
 {
     return(GrupoPagadoraDetalleDA.ProcesarGrupoPagadoraDetalle(BE));
 }