Пример #1
0
        protected void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (TbIdGasto.Text == string.Empty)
            {
                ObtenerDatos();


                if (gas.Insertar())
                {
                    Alert("Gasto Se Guardo Corectamente");

                    gas.CuentaResta(Convert.ToInt32(DdIdCuenta.SelectedValue), Convert.ToInt32(TbValor.Text));
                    Limpiar();
                }
                else
                {
                    Alert("Gasto No Se Pudo Guardar Corectamente");
                }
            }

            else
            {
                ObtenerDatos();

                if (gas.Modificar(TbIdGasto.Text))
                {
                    Alert("Gasto Se Modificada Corectamente");
                }
                else
                {
                    Alert("Cuenta No Se  Modificar Corectamente");
                }
            }
        }