public void GetUserRight() { MyCurrentUserRight MyRight = new MyCurrentUserRight(); String Pdw = MyValidation.Getpassword(_Password); DataTable MyDr = new DataTable(); MySqlCommand MyCom = new MySqlCommand("GetPWD", null); MyCom.CommandType = CommandType.StoredProcedure; MyCom.Parameters.Add(new MySqlParameter("@Username1", MySqlDbType.VarChar, 20)); MyCom.Parameters.Add(new MySqlParameter("@PW", MySqlDbType.VarChar, 20)); MyCom.Parameters["@Username1"].Value = _UserName; MyCom.Parameters["@PW"].Value = Pdw; MySqlDataAdapter MyDA = new MySqlDataAdapter(MyCom); MyDA.Fill(MyDr); if (MyDr != null) { for (int i = 0; i < MyDr.Rows.Count; i++) { MyRight.ObgID = Int32.Parse(MyDr.Rows[i].ItemArray.GetValue(0).ToString()); _ObgID = Int32.Parse(MyDr.Rows[i].ItemArray.GetValue(0).ToString()); GetObjectName(); MyRight.ObgName = _ObjectName; MyRight.FormName = _FormName; MyRight.Save = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(1).ToString()); MyRight.Update = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(2).ToString()); MyRight.Delete = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(3).ToString()); MyRight.View = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(4).ToString()); MyRight.Print = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(5).ToString()); MyRight.Department = MyDr.Rows[i].ItemArray.GetValue(6).ToString(); MyActiveUserRight.Add(MyRight); } } }
public void GetUserRight() { MyCurrentUserRight MyRight = new MyCurrentUserRight(); String Pdw = MyValidation.Getpassword(_Password); DataTable MyDr = new DataTable(); MySqlCommand MyCom = new MySqlCommand("GetPWD",null ); MyCom.CommandType = CommandType.StoredProcedure; MyCom.Parameters.Add(new MySqlParameter("@Username1", MySqlDbType.VarChar, 20)); MyCom.Parameters.Add(new MySqlParameter("@PW", MySqlDbType.VarChar, 20)); MyCom.Parameters["@Username1"].Value = _UserName; MyCom.Parameters["@PW"].Value = Pdw; MySqlDataAdapter MyDA = new MySqlDataAdapter(MyCom); MyDA.Fill(MyDr); if (MyDr != null) { for (int i = 0; i < MyDr.Rows.Count; i++) { MyRight.ObgID = Int32.Parse(MyDr.Rows[i].ItemArray.GetValue(0).ToString()); _ObgID = Int32.Parse(MyDr.Rows[i].ItemArray.GetValue(0).ToString()); GetObjectName(); MyRight.ObgName = _ObjectName; MyRight.FormName = _FormName; MyRight.Save = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(1).ToString()); MyRight.Update = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(2).ToString()); MyRight.Delete = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(3).ToString()); MyRight.View = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(4).ToString()); MyRight.Print = Int16.Parse(MyDr.Rows[i].ItemArray.GetValue(5).ToString()); MyRight.Department = MyDr.Rows[i].ItemArray.GetValue(6).ToString(); MyActiveUserRight.Add(MyRight); } } }