private void button2_Click(object sender, EventArgs e) { VISA vs = new VISA(); vs.Show(); this.Hide(); }
public static bool IsValidEmail(string email) { VISA vs = new VISA(); vs.vsemailid.Text = email; return(Regex.IsMatch(email, @"\A[a-z0-9]+([-._][a-z0-9]+)*@([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,4}\z") && Regex.IsMatch(email, @"^(?=.{1,64}@.{4,64}$)(?=.{6,100}$).*")); }
public void ApplyVisa(string ab, string b, int c, string d, Int64 e, string f, string g, string h) { Visa vs = new Visa(); this.FirstName = ab; this.LastName = b; this.Age = c; this.nationality = d; this.PassportNumber = e; this.email = f; this.residency = g; vs.visatype = h; connec.Open(); string query = "insert into VISAAPPLICATIONS values (@fname,@lname,@age,@nationality,@ppnumber,@email,@residency,@visatype,@photo)"; SqlCommand command = new SqlCommand(query, connec); command.Parameters.AddWithValue("@fname", FirstName);; command.Parameters.AddWithValue("@lname", LastName); command.Parameters.AddWithValue("@age", Age); command.Parameters.AddWithValue("@nationality", nationality); command.Parameters.AddWithValue("@ppnumber", PassportNumber); command.Parameters.AddWithValue("@email", email); command.Parameters.AddWithValue("@residency", residency); command.Parameters.AddWithValue("@visatype", vs.visatype); command.Parameters.AddWithValue("@photo", vs.SaveImage()); int a = command.ExecuteNonQuery(); if (a > 0) { MessageBox.Show("Your Visa application has been submitted , You can proceed towards ticket booking now .", "Visa Succesfully Applied", MessageBoxButtons.OK, MessageBoxIcon.Information); vs.ShowBill(); TICKET tk = new TICKET(); tk.Show(); VISA VS = new VISA(); VS.Hide(); } else { MessageBox.Show("Visa Application submission unsuccesful .", "Apply Visa", MessageBoxButtons.OK, MessageBoxIcon.Error); } connec.Close(); }
public void bookhotel(string htname, int rm, int dy, string trans, string rt) { VISA vs = Application.OpenForms.OfType <VISA>().FirstOrDefault(); Hotel h = new Hotel(); hname = htname; rooms = rm; days = dy; transport = trans; roomtype = rt; string fullname = vs.vsfname.Text + " " + vs.vslname.Text; connec.Open(); string query = "insert into hotel values (@ppnumber,@fullname,@hotelname,@norooms,@noofdays,@transport ,@roomtype)"; SqlCommand cmd = new SqlCommand(query, connec); cmd.Parameters.AddWithValue("@ppnumber", vs.vsppnumber.Text); cmd.Parameters.AddWithValue("@fullname", fullname); cmd.Parameters.AddWithValue("@hotelname", hname); cmd.Parameters.AddWithValue("@norooms", rooms); cmd.Parameters.AddWithValue("noofdays", days); cmd.Parameters.AddWithValue("@transport", transport); cmd.Parameters.AddWithValue("@roomtype", roomtype); int a = cmd.ExecuteNonQuery(); if (a > 0) { MessageBox.Show("Your Hotel has been booked succesfully , You'll proceed towards billing now .", "Hotel Succesfully Booked", MessageBoxButtons.OK, MessageBoxIcon.Information); h.ShowBill(); } else { MessageBox.Show("Hotel Booking unsuccesful .", "Hotel Booking", MessageBoxButtons.OK, MessageBoxIcon.Error); } connec.Close(); }