Exemple #1
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;
 }
Exemple #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;
 }