Example #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txt_Nombre.Text == "")
            {
                MessageBox.Show("Debe ingresar un nombre para continuar", Clases.cMensaje.Mensaje());
                return;
            }

            if (txt_Apellido.Text == "")
            {
                MessageBox.Show("Debe ingresar un apellido para continuar", Clases.cMensaje.Mensaje());
                return;
            }

            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtCodigo.Text == "")
            {
                fun.GuardarNuevoGenerico(this, "Mecanico");
            }
            else
            {
                fun.ModificarGenerico(this, "Mecanico", "CodMecanico", txtCodigo.Text);
            }
            MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje());
            Botonera(1);
            fun.LimpiarGenerico(this);
            txtCodigo.Text = "";
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txt_Precio.Text.Trim() == "")
            {
                txt_Precio.Text = "0";
            }
            txt_Precio.Text = txt_Precio.Text.Replace(",", ".");
            if (txt_Nombre.Text == "")
            {
                MessageBox.Show("Debe ingresar un insumo continuar", Clases.cMensaje.Mensaje());
                return;
            }

            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtCodigo.Text == "")
            {
                fun.GuardarNuevoGenerico(this, "Insumo");
            }
            else
            {
                fun.ModificarGenerico(this, "Insumo", "CodInsumo", txtCodigo.Text);
            }
            MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje());
            Botonera(1);
            fun.LimpiarGenerico(this);
            txtCodigo.Text = "";
        }