06-01-23, 01:42 PM
السلام عليكم ورحمة الله وبركاته جمعه مباركه علي الجميع
لمذا كود صلاحيات لايعمل
لدي مجموعة من ازرار علي شاشة رئيسة و menustrip به مجموعه من خيارات مسمي كل منه p1 ,p2......
والصلاحيه عباره عن مستخدم او مدير
جدول مستخدمين
لمذا كود صلاحيات لايعمل
لدي مجموعة من ازرار علي شاشة رئيسة و menustrip به مجموعه من خيارات مسمي كل منه p1 ,p2......
والصلاحيه عباره عن مستخدم او مدير
PHP كود :
If ComboBox1.SelectedIndex < 0 Then
MessageBox.Show("الرجاء اختيار اسم المستخدم ")
Exit Sub
End If
query = "select * from users where user_name='" & ComboBox1.Text & "' and user_password= '" & Textpass.Text & "'"
da = New SqlDataAdapter(query, Module1.con)
da.Fill(dt)
If dt.Rows.Count > 0 Then
If dt.Rows(0).Item("type") = "مدير".ToString() Then
Form_main.btn_con.Enabled = True
Form_main.p1.Enabled = True
Form_main.btn_customer.Enabled = True
Form_main.p2.Enabled = True
Form_main.btn_product.Enabled = True
Form_main.p3.Enabled = True
Form_main.btn_sales.Enabled = True
Form_main.p4.Enabled = True
Form_main.btn_users.Enabled = True
Form_main.p5.Enabled = True
Form_main.Label2.Text = Me.ComboBox1.Text
Form_main.ShowDialog()
Me.Close()
ElseIf dt.Rows(0).Item("type") = "مستخدم".ToString()
Form_main.btn_con.Enabled = True
Form_main.p1.Enabled = True
Form_main.btn_customer.Enabled = True
Form_main.p2.Enabled = True
Form_main.btn_product.Enabled = True
Form_main.p3.Enabled = True
Form_main.btn_sales.Enabled = True
Form_main.p4.Enabled = False
Form_main.btn_users.Enabled = False
Form_main.p5.Enabled = True
End If
End If