Esempio n. 1
0
 public static List<myGameRoom> GetAllGameRoom()
 {
     myGameRoomData tempADO = new myGameRoomData();
     List<myGameRoom> list=new List<myGameRoom>();
     DataSet tempDS = tempADO.GetAllGameRoom();
     if (tempADO.HasData) {
     foreach (DataRow row in tempDS.Tables[0].Rows)
     list.Add(new myGameRoom(row));
      return list; }
     return new List<myGameRoom>();
 }
Esempio n. 2
0
 public bool InsertData()
 {
     myGameRoom n = new myGameRoom();
     n.GetGameRoomByGameRoomName(myGameRoomName);
     if (n.GameRoomID != 0) return false;
     myGameRoomData data=new myGameRoomData();
     List<SqlParameter> tempAL = new List<SqlParameter>();
     SqlParameter tempP;DataSet tempDS;
     tempP = new SqlParameter();
     tempP.ParameterName = "@GameRoomName";
     tempP.Size = 200;
     tempP.SqlDbType = SqlDbType.VarChar;
     tempP.Value = myGameRoomName;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempDS = data.RunProcedure("csp_InsertGameRoom", tempAL);
     myGameRoomID= int.Parse(tempDS.Tables[0].Rows[0][0].ToString());
     foreach(myUser temp in myUser.GetUserByGameRoom(this)) temp.DeleteGameRoom(myGameRoomID);
     foreach(myUser temp in myUser_) temp.UpdateGameRoom(myGameRoomID);
     tempDS.Dispose(); return true;
 }
Esempio n. 3
0
 public bool UpdateData()
 {
     myGameRoom n = new myGameRoom();
     n.GetGameRoomByGameRoomName(myGameRoomName);
     if (n.GameRoomID != 0 && n.GameRoomID != myGameRoomID){ return false;}
     myGameRoomData data=new myGameRoomData();
     List<SqlParameter> tempAL = new List<SqlParameter>();
     SqlParameter tempP;
     tempP = new SqlParameter();
     tempP.ParameterName = "@GameRoomID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myGameRoomID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@GameRoomName";
     tempP.Size = 200;
     tempP.SqlDbType = SqlDbType.VarChar;
     tempP.Value = myGameRoomName;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     data.RunProcedure("csp_UpdateGameRoom", tempAL);
     foreach(myUser temp in myUser.GetUserByGameRoom(this)) temp.DeleteGameRoom(myGameRoomID);
     foreach(myUser temp in myUser_) temp.UpdateGameRoom(myGameRoomID);
     return true;
 }
Esempio n. 4
0
 public bool GetGameRoomByGameRoomName(string val)
 {
     myGameRoomData tempADO = new myGameRoomData();
     DataSet tempDS = tempADO.GetGameRoomByGameRoomName(val);
     if (tempADO.HasData){
     UpdateGameRoom(tempDS.Tables[0].Rows[0]);
     return true;}return false;
 }