Пример #1
0
 public home()
 {
     home2 = this;
     InitializeComponent();
     panelWidth  = panel1.Width;
     isCollapsed = false;
     timer2.Start();
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         con.Open();
         SqlCommand cmd = new SqlCommand("select * from tbl_User where username=@username and password=@password", con);
         cmd.Parameters.AddWithValue("@username", textBox1.Text);
         cmd.Parameters.AddWithValue("@password", textBox2.Text);
         SqlDataReader dr;
         dr = cmd.ExecuteReader();
         int count = 0;
         while (dr.Read())
         {
             count          += 1;
             Program.user_ID = dr[0].ToString();
         }
         if (count == 1)
         {
             Program.ID_Year = Convert.ToInt32(comboBox2.SelectedValue);
             Recby           = textBox1.Text;
             this.Hide();
             home fm = new home();
             fm.Show();
         }
         else if (count > 0)
         {
             MessageBox.Show("err");
         }
         else
         {
             msg.Alert("اسم المستخدم وكلمة المرور غير صحيحه", Form_Alert.enumType.Error);
         }
         textBox1.Clear();
         textBox2.Clear();
         textBox1.Focus();
     }
     catch (Exception)
     {
         msg.Alert("لا يوجد إتصال بالانترنت الرجاء التأكد من إتصال الإنترنت ", Form_Alert.enumType.Error);
     }
     finally
     {
         con.Close();
     }
 }