Example #1
0
 private void Borrar()
 {
     try
     {
         oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "0300304");
         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.Depositos oRegistro = new App_Code.Empresa.Depositos(int.Parse(this.lblFicha.Text.ToString()));
                 oRegistro.Eliminar();
                 this.Nuevo();
                 MessageBox.Show(oRegistro.Msg, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
        private void Guardar()
        {
            App_Code.Empresa.Depositos oRegistro = new App_Code.Empresa.Depositos(int.Parse(this.lblFicha.Text));

            try
            {
                if (!Validar())
                {
                    oRegistro.Codigo    = this.txtCodigo.Text.ToString().ToUpper();
                    oRegistro.Nombre    = this.txtNombre.Text.ToString().ToUpper();
                    oRegistro.Direccion = this.txtDireccion.Text.ToString().ToUpper();
                    oRegistro.Telefono  = this.txtTelOfi.Text.ToString();

                    if (oRegistro.Err)
                    {
                        oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "0300302");
                        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, "0300303");
                        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;
            }
        }
Example #3
0
        private void Presentar(int id)
        {
            App_Code.Empresa.Depositos oRegistro = new App_Code.Empresa.Depositos(id);


            this.lblFicha.Text     = oRegistro.Id.ToString("0");
            this.txtCodigo.Text    = oRegistro.Codigo.ToString();
            this.txtNombre.Text    = oRegistro.Nombre.ToString();
            this.txtDireccion.Text = oRegistro.Direccion.ToString();
            this.txtTelOfi.Text    = oRegistro.Telefono.ToString();
            oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "0300304");
            if (!oFuncion.Err)
            {
                this.btnEliminar.Enabled = true;
            }
        }