string user_name = textBox1.Text.
Trim();
string passward = textBox2.Text.Trim();
string user_type = comboBox1.Text.Trim();
bool success = loginDAL.LOGIN();
if (success == true)
MessageBox.Show("login successful");
else
MessageBox.Show("Invalid user_type");
SqlConnection conn = new SqlConnection("desktop-av1oimq\\sqlexpress.sj travel agency.dbo");
conn.Open();
string sql = "SELECT COUNT(*) FROM login WHERE
user_name=@user_name,passward=@passward,user_type=@user_type";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.AddWithValue("@user_name"= textBox1.Text);
cmd.Parameters.AddWithValue("@passward "= textBox2.Text);
cmd.Parameters.AddWithValue("@user_type"= comboBox1.Text);
int count =(int)cmd.ExecuteScalar();
conn.Close();
if(count > 0)
{
MessageBox.Show("loggin suuccessfully!","info", MessageBoxButtons.OK,
MessageBoxIcon.Information);
else
MessageBox.Show("error in login");
PAYMENT FORM
var payment = new Payment
{
payment_id = int.Parse(textBox1.Text),
booking_id = textBox2.Text,
amount = decimal.Parse(textBox2.Text),
payment_date = DateTime.Parse(dateTimePicker1.Text)
};
payments.Add(payment);
RefreshGrid();