public void SetUserItem(string userName, UserStorageSections section, object data) { try { DataTable userTable = GetUserTable(userName, section); if (!userTable.Columns.Contains("userdata")) { userTable.Columns.Add("userdata"); userTable.Columns.Add("datatype"); } DataRow row; if (userTable.Rows.Count == 0) { row = userTable.NewRow(); userTable.Rows.Add(row); } else { row = userTable.Rows[0]; } Serialize(row, data); SaveUserSet(userName); } catch (Exception) { } }
private DataTable GetUserTable(string userName, UserStorageSections section) { DataSet userSet = GetUserSet(userName); if (!userSet.Tables.Contains(section.ToString())) { userSet.Tables.Add(section.ToString()); } return userSet.Tables[section.ToString()]; }
private DataTable GetUserTable(string userName, UserStorageSections section) { DataSet userSet = GetUserSet(userName); if (!userSet.Tables.Contains(section.ToString())) { userSet.Tables.Add(section.ToString()); } return(userSet.Tables[section.ToString()]); }
public object GetUserItem(string userName, UserStorageSections section) { try { DataTable userTable = GetUserTable(userName, section); if (!userTable.Columns.Contains("userdata")) { userTable.Columns.Add("userdata"); userTable.Columns.Add("datatype"); } DataRow row; if (userTable.Rows.Count == 0) { return(null); } row = userTable.Rows[0]; return(Deserialize(row)); } catch { return(null); } }
public object GetUserItem(string userName, UserStorageSections section) { try { DataTable userTable = GetUserTable(userName, section); if (!userTable.Columns.Contains("userdata")) { userTable.Columns.Add("userdata"); userTable.Columns.Add("datatype"); } DataRow row; if (userTable.Rows.Count == 0) { return null; } row = userTable.Rows[0]; return Deserialize(row); } catch { return null; } }