Beispiel #1
0
 public static List<myChatLine> GetAllChatLine()
 {
     myChatLineData tempADO = new myChatLineData();
     List<myChatLine> list=new List<myChatLine>();
     DataSet tempDS = tempADO.GetAllChatLine();
     if (tempADO.HasData) {
     foreach (DataRow row in tempDS.Tables[0].Rows)
     list.Add(new myChatLine(row));
      return list; }
     return new List<myChatLine>();
 }
Beispiel #2
0
 public bool UpdateData()
 {
     myChatLineData data=new myChatLineData();
     List<SqlParameter> tempAL = new List<SqlParameter>();
     SqlParameter tempP;
     tempP = new SqlParameter();
     tempP.ParameterName = "@ChatLineID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myChatLineID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@UserID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myUserID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(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 = "@ChatLineContent";
     tempP.Size = 1200;
     tempP.SqlDbType = SqlDbType.VarChar;
     tempP.Value = myChatLineContent;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@TimePosted";
     tempP.Size = 12;
     tempP.SqlDbType = SqlDbType.DateTime;
     tempP.Value = myTimePosted;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     data.RunProcedure("csp_UpdateChatLine", tempAL);
     return true;
 }
Beispiel #3
0
 public bool InsertData()
 {
     myChatLineData data=new myChatLineData();
     List<SqlParameter> tempAL = new List<SqlParameter>();
     SqlParameter tempP;DataSet tempDS;
     tempP = new SqlParameter();
     tempP.ParameterName = "@UserID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myUserID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(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 = "@ChatLineContent";
     tempP.Size = 1200;
     tempP.SqlDbType = SqlDbType.VarChar;
     tempP.Value = myChatLineContent;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@TimePosted";
     tempP.Size = 12;
     tempP.SqlDbType = SqlDbType.DateTime;
     tempP.Value = myTimePosted;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempDS = data.RunProcedure("csp_InsertChatLine", tempAL);
     myChatLineID= int.Parse(tempDS.Tables[0].Rows[0][0].ToString());
     tempDS.Dispose(); return true;
 }
Beispiel #4
0
 public bool GetChatLineByChatLineID(int val)
 {
     myChatLineData tempADO = new myChatLineData();
     DataSet tempDS = tempADO.GetChatLineByChatLineID(val);
     if (tempADO.HasData){
     UpdateChatLine(tempDS.Tables[0].Rows[0]);
     return true;}return false;
 }
Beispiel #5
0
 public static List<myChatLine> GetChatLinesByGameRoomID__Paging(int aGameRoomID,int aPageNumber,int aCount )
 {
     myChatLineData tempADO = new myChatLineData();
     List<myChatLine> list=new List<myChatLine>();
     DataSet tempDS = tempADO.GetChatLinesByGameRoomID__Paging( aGameRoomID,aPageNumber,aCount);
     if (tempADO.HasData) {
     foreach (DataRow row in tempDS.Tables[0].Rows)
     list.Add(new myChatLine(row));
      return list; }
     return new List<myChatLine>();
 }
Beispiel #6
0
 public static int GetChatLinesByGameRoomID__Count(int aGameRoomID )
 {
     myChatLineData tempADO = new myChatLineData();
     DataSet tempDS = tempADO.GetChatLinesByGameRoomID__Count( aGameRoomID);
     if (tempADO.HasData) {
      return int.Parse(tempDS.Tables[0].Rows[0][0].ToString()); }
     return 0;
 }