![]() |
|
طلب مساعدة بخصوص صلاحيات المستخدمين - نسخة قابلة للطباعة +- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb) +-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182) +--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183) +--- الموضوع : طلب مساعدة بخصوص صلاحيات المستخدمين (/showthread.php?tid=19862) |
طلب مساعدة بخصوص صلاحيات المستخدمين - ramimohammed - 02-04-17 السلام عليكم احتاج كود مبسط لصلاحيات المستخدمين ... اي يقوم بإدخال المستخدم ويقوم بفتح بعض الصلاحيات وإغلاق البعض ارجو الشرح لي بالتفصيل واين اضع كل كود بإي مكان ؟ الامر مستعجل من فضلكم ولكم جزيل الشكر RE: طلب مساعدة بخصوص صلاحيات المستخدمين - abdualla - 02-04-17 انظر هذا الموضوع ابسط مثال للتصاريح http://vb4arb.com/vb/showthread.php?tid=42 RE: طلب مساعدة بخصوص صلاحيات المستخدمين - ramimohammed - 04-04-17 السلام عليكم اخي انا قمت بعمل فورم للصلاحيات المستخدمين وهو فورم رقم 2 [attachment=13760] وشاشة الدخول فورم رقم 3 [attachment=13761] اريد عند ادخال اسم مستخدم معين تفتح له بعض الصلاحيات في الفورم 1 كما في المرفقات [attachment=13762] وهذه الاكواد المستخدمه كود فورم 2 (( كود الاضافة)) If db.State = ConnectionState.Closed Then db.Open() Dim s As String = "insert into pass(no_user,na_user,pass_user,marahel,malyaah,setting_sys)values(@no_user,@na_user,@pass_user,@marahel,@malyaah,@setting_sys)" Dim sw As New OleDbCommand(s, db) sw.Parameters.AddWithValue("@no_user", TextBox1.Text) sw.Parameters.AddWithValue("@na_user", TextBox2.Text) sw.Parameters.AddWithValue("@pass_user", TextBox3.Text) sw.Parameters.AddWithValue("@marahel", CheckBox1.Checked) sw.Parameters.AddWithValue("@malyaah", CheckBox2.Checked) sw.Parameters.AddWithValue("@setting_sys", CheckBox3.Checked) Try sw.ExecuteNonQuery() MsgBox("تم اضافة المستخدم", MsgBoxStyle.MsgBoxRight, "تنبية") clear1() Catch MsgBox("المستخدم موجود مسبقا", MsgBoxStyle.MsgBoxRight, "تنبية") TextBox1.Clear() TextBox1.Focus() If db.State = ConnectionState.Open Then db.Close() End Try -------------------------------------------------- كود فورم الدخول If ComboBox1.SelectedIndex = -1 Then MsgBox("حدد اسم المستخدم") Exit Sub End If If TextBox1.Text = "" Then MsgBox("ادخل كلمة المرور") Exit Sub End If On Error Resume Next If db.State = ConnectionState.Closed Then db.Open() Dim s As String = "select * from pass where (na_user=@na_user)and(pass_user=@pass_user)" dco = New OleDbCommand(s, db) dco.Parameters.AddWithValue("@x2", ComboBox1.Text) dco.Parameters.AddWithValue("@x3", TextBox1.Text) Dim reader As OleDbDataReader = dco.ExecuteReader If reader.Read = True Then reader.Close() Form1.ShowDialog() Dispose() Else reader.Close() MsgBox("الرجاء ادخال البيانات الصحيحة", MsgBoxStyle.Question, "تنبيه") End If If db.State = ConnectionState.Open Then db.Close() ----------------------------------------------------- كود فورم 1 شرط الصلاحية If CheckBox1.Checked = True Then Button1.Enabled = True Button2.Enabled = True Button4.Enabled = True Button5.Enabled = True Button6.Enabled = True Button7.Enabled = True Button8.Enabled = True Button9.Enabled = True Button10.Enabled = True Button11.Enabled = True Button12.Enabled = True Button13.Enabled = True Button14.Enabled = True Button15.Enabled = True End If If CheckBox2.Checked = True Then Button18.Enabled = True Button26.Enabled = True Button24.Enabled = True Button17.Enabled = True Button16.Enabled = True Button27.Enabled = True Button19.Enabled = True Button20.Enabled = True End If If CheckBox3.Checked = True Then Button22.Enabled = True End If ---------------------- السؤال هو اين اضع الشرط او ما هو النقص ؟ ارجو التعديل في الاكواد لمعرفة اين المشكلة |