Exemple #1
0
        public override void Nuevo()
        {
            TxtCodigoCliente.Text  = "";
            TxtCliente.Text        = "";
            TxtCodigoProducto.Text = "";
            TxtDescripcion.Text    = "";
            TxtPrecio.Text         = "";
            TxtCantidad.Text       = "";
            lbTotal.Text           = "USD$ 0";
            dataGridView1.Rows.Clear();
            contadorFila = 0;
            total        = 0;

            TxtCodigoCliente.Focus();
        }
Exemple #2
0
        void guardarContrato()
        {
            using (SqlConnection sqlCon = new SqlConnection(connectionString))
            {
                sqlCon.Open();
                string     query  = "INSERT INTO contrato (inmueble_id,persona_id) VALUES (@inmueble_id,@persona_id)";
                SqlCommand sqlCmd = new SqlCommand(query, sqlCon);
                sqlCmd.Parameters.AddWithValue("@inmueble_id", (TxtCodigoInmueble.FindControl("TxtCodigoInmueble") as TextBox).Text.Trim());
                sqlCmd.Parameters.AddWithValue("@persona_id", (TxtCodigoCliente.FindControl("TxtCodigoCliente") as TextBox).Text.Trim());
                sqlCmd.ExecuteNonQuery();

                lblSuccessMessage.Text    = "Registro Con Exito";
                lblSuccessMessage.Visible = true;
                lblErrorMessage.Text      = "";
                lblErrorMessage.Visible   = true;

                sqlCmd.Parameters.Clear();
            }
        }