Beispiel #1
0
 private void Borrar()
 {
     try
     {
         oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1201204");
         if (oFuncion.Err)
         {
             MessageBox.Show("Disculpe Usted No Tiene Acceso a Esta Accion", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
             return;
         }
         else
         {
             if (MessageBox.Show("Esta seguro de Borrar este Registro", "Atencion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 App_Code.Empresa.MediosCobroPago oRegistro = new App_Code.Empresa.MediosCobroPago(int.Parse(this.lblFicha.Text.ToString()));
                 oRegistro.Eliminar();
                 this.Nuevo();
                 MessageBox.Show(oRegistro.Msg, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        private void Guardar()
        {
            App_Code.Empresa.MediosCobroPago oRegistro = new App_Code.Empresa.MediosCobroPago(int.Parse(this.lblFicha.Text));

            try
            {
                if (!Validar())
                {
                    oRegistro.Codigo = this.txtCodigo.Text.ToString().ToUpper();
                    oRegistro.Nombre = this.txtNombre.Text.ToString().ToUpper();
                    oRegistro.Cobro  = this.chkCobro.Checked;
                    oRegistro.Pago   = this.chkPago.Checked;

                    if (oRegistro.Err)
                    {
                        oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1201202");
                        if (oFuncion.Err)
                        {
                            MessageBox.Show("Disculpe Usted No Tiene Acceso a Esta Accion", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            return;
                        }
                        else
                        {
                            oRegistro.Insertar();
                        }
                    }
                    else
                    {
                        oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1201203");
                        if (oFuncion.Err)
                        {
                            MessageBox.Show("Disculpe Usted No Tiene Acceso a Esta Accion", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            return;
                        }
                        else
                        {
                            oRegistro.Actualizar();
                        }
                    }
                    MessageBox.Show(oRegistro.Msg, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Consulta();
                    this.Presentar(oRegistro.Id);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
0
        private void Presentar(int id)
        {
            App_Code.Empresa.MediosCobroPago oRegistro = new App_Code.Empresa.MediosCobroPago(id);


            this.lblFicha.Text    = oRegistro.Id.ToString("0");
            this.txtCodigo.Text   = oRegistro.Codigo.ToString();
            this.txtNombre.Text   = oRegistro.Nombre.ToString();
            this.chkCobro.Checked = oRegistro.Cobro;
            this.chkPago.Checked  = oRegistro.Pago;
            oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1201204");
            if (!oFuncion.Err)
            {
                this.btnEliminar.Enabled = true;
            }
        }