private void Borrar() { try { oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1200804"); 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.Tasas oRegistro = new App_Code.Empresa.Tasas(int.Parse(this.lblFicha.Text.ToString())); this.Nuevo(); oRegistro.Eliminar(); MessageBox.Show(oRegistro.Msg, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception) { throw; } }
private void Presentar(int id) { App_Code.Empresa.Tasas oRegistro = new App_Code.Empresa.Tasas(id); this.lblFicha.Text = oRegistro.Id.ToString("0"); this.txtValor.Text = oRegistro.Valor.ToString("#,##0.00"); this.txtNombre.Text = oRegistro.Nombre.ToString(); oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1200804"); if (!oFuncion.Err) { this.btnEliminar.Enabled = true; } }
private void Guardar() { App_Code.Empresa.Tasas oRegistro = new App_Code.Empresa.Tasas(int.Parse(this.lblFicha.Text)); try { if (!Validar()) { oRegistro.Valor = decimal.Parse(this.txtValor.Text.ToString()); oRegistro.Nombre = this.txtNombre.Text.ToString().ToUpper(); if (oRegistro.Err) { oFuncion.Leer(panterasoftware.Formularios.frmPrincipal.id_grupo_usuario, "1200802"); 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, "1200803"); 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; } }