public basicUserInformation getBasicUserInfo(int userID) { basicUserInformation returnInfo = new basicUserInformation(); Database Database = new Database(false, true); Database.addParameterWithValue("userid", userID); Database.Open(); if (Database.Ready) { try { DataRow dRow = Database.getRow("SELECT username,figure,sex,motto,motto_messenger,lastactivity FROM users WHERE id = @userid"); returnInfo.ID = userID; returnInfo.Username = (string)dRow["username"]; returnInfo.Figure = (string)dRow["figure"]; returnInfo.Sex = Convert.ToChar(dRow["sex"].ToString()); returnInfo.Motto = (string)dRow["motto"]; returnInfo.messengerMotto = (string)dRow["motto_messenger"]; returnInfo.lastActivity = (DateTime)dRow["lastactivity"]; } catch { returnInfo = new basicUserInformation(); } } return(returnInfo); }
public basicUserInformation getBasicUserInfo(int userID) { basicUserInformation returnInfo = new basicUserInformation(); Database Database = new Database(false, true); Database.addParameterWithValue("userid", userID); Database.Open(); if (Database.Ready) { try { DataRow dRow = Database.getRow("SELECT username,figure,sex,motto,motto_messenger,lastactivity FROM users WHERE id = @userid"); returnInfo.ID = userID; returnInfo.Username = (string)dRow["username"]; returnInfo.Figure = (string)dRow["figure"]; returnInfo.Sex = Convert.ToChar(dRow["sex"].ToString()); returnInfo.Motto = (string)dRow["motto"]; returnInfo.messengerMotto = (string)dRow["motto_messenger"]; returnInfo.lastActivity = (DateTime)dRow["lastactivity"]; } catch { returnInfo = new basicUserInformation(); } } return returnInfo; }