Implement Admin Panel (Reimplements Admin Features)

This commit is contained in:
Alan Moon 2025-12-11 14:21:19 -08:00
parent 23435fdc8a
commit 72899af1e4
9 changed files with 994 additions and 0 deletions

View File

@ -0,0 +1,89 @@
namespace qtcnet_client.Forms
{
partial class AddRoomForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
lblHeader = new Label();
txtRoomName = new TextBox();
btnCreate = new Button();
SuspendLayout();
//
// lblHeader
//
lblHeader.AutoSize = true;
lblHeader.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold, GraphicsUnit.Point, 0);
lblHeader.ForeColor = Color.White;
lblHeader.Location = new Point(99, 9);
lblHeader.Name = "lblHeader";
lblHeader.Size = new Size(217, 21);
lblHeader.TabIndex = 0;
lblHeader.Text = "Enter A Name For The Room";
//
// txtRoomName
//
txtRoomName.Location = new Point(12, 40);
txtRoomName.Name = "txtRoomName";
txtRoomName.Size = new Size(397, 23);
txtRoomName.TabIndex = 1;
//
// btnCreate
//
btnCreate.Location = new Point(189, 73);
btnCreate.Name = "btnCreate";
btnCreate.Size = new Size(52, 23);
btnCreate.TabIndex = 2;
btnCreate.Text = "Create";
btnCreate.UseVisualStyleBackColor = true;
btnCreate.Click += btnCreate_Click;
//
// AddRoomForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.DodgerBlue;
ClientSize = new Size(421, 106);
Controls.Add(btnCreate);
Controls.Add(txtRoomName);
Controls.Add(lblHeader);
FormBorderStyle = FormBorderStyle.FixedDialog;
MaximizeBox = false;
MinimizeBox = false;
Name = "AddRoomForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "Add Room";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label lblHeader;
private TextBox txtRoomName;
private Button btnCreate;
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace qtcnet_client.Forms
{
public partial class AddRoomForm : Form
{
public string RoomName { get; private set; } = string.Empty;
public AddRoomForm()
{
InitializeComponent();
}
private void btnCreate_Click(object sender, EventArgs e)
{
if(!string.IsNullOrWhiteSpace(txtRoomName.Text))
{
RoomName = txtRoomName.Text;
DialogResult = DialogResult.OK;
Close();
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,363 @@
namespace qtcnet_client.Forms
{
partial class AdminPanelForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdminPanelForm));
pbLogo = new PictureBox();
lblServerAdmin = new Label();
tcMain = new TabControl();
tpRooms = new TabPage();
dgRooms = new DataGridView();
idDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
nameDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
creatorIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
createdAtDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
userCountDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
cmsRoomAdd = new ContextMenuStrip(components);
tsiAddRoom = new ToolStripMenuItem();
bsRooms = new BindingSource(components);
tpUsers = new TabPage();
dgUsers = new DataGridView();
idDataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
usernameDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
profilePictureDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
bioDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
roleDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
dateOfBirthDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
createdAtDataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
lastLoginDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
statusDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
currencyAmountDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
profileCosmeticIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
bsUsers = new BindingSource(components);
ilTabIcons = new ImageList(components);
((System.ComponentModel.ISupportInitialize)pbLogo).BeginInit();
tcMain.SuspendLayout();
tpRooms.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dgRooms).BeginInit();
cmsRoomAdd.SuspendLayout();
((System.ComponentModel.ISupportInitialize)bsRooms).BeginInit();
tpUsers.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dgUsers).BeginInit();
((System.ComponentModel.ISupportInitialize)bsUsers).BeginInit();
SuspendLayout();
//
// pbLogo
//
pbLogo.Image = Properties.Resources.QtCNETIcon;
pbLogo.Location = new Point(-16, -23);
pbLogo.Name = "pbLogo";
pbLogo.Size = new Size(179, 125);
pbLogo.SizeMode = PictureBoxSizeMode.Zoom;
pbLogo.TabIndex = 0;
pbLogo.TabStop = false;
//
// lblServerAdmin
//
lblServerAdmin.AutoSize = true;
lblServerAdmin.Font = new Font("Segoe UI Semibold", 20F, FontStyle.Bold | FontStyle.Italic);
lblServerAdmin.ForeColor = Color.White;
lblServerAdmin.Location = new Point(399, 26);
lblServerAdmin.Name = "lblServerAdmin";
lblServerAdmin.Size = new Size(174, 37);
lblServerAdmin.TabIndex = 1;
lblServerAdmin.Text = "Admin Panel";
//
// tcMain
//
tcMain.Controls.Add(tpRooms);
tcMain.Controls.Add(tpUsers);
tcMain.ImageList = ilTabIcons;
tcMain.Location = new Point(12, 66);
tcMain.Name = "tcMain";
tcMain.SelectedIndex = 0;
tcMain.Size = new Size(561, 372);
tcMain.TabIndex = 2;
//
// tpRooms
//
tpRooms.Controls.Add(dgRooms);
tpRooms.ImageKey = "Rooms";
tpRooms.Location = new Point(4, 24);
tpRooms.Name = "tpRooms";
tpRooms.Padding = new Padding(3);
tpRooms.Size = new Size(553, 344);
tpRooms.TabIndex = 0;
tpRooms.Text = "Rooms";
tpRooms.UseVisualStyleBackColor = true;
//
// dgRooms
//
dgRooms.AutoGenerateColumns = false;
dgRooms.BackgroundColor = Color.White;
dgRooms.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dgRooms.Columns.AddRange(new DataGridViewColumn[] { idDataGridViewTextBoxColumn, nameDataGridViewTextBoxColumn, creatorIdDataGridViewTextBoxColumn, createdAtDataGridViewTextBoxColumn, userCountDataGridViewTextBoxColumn });
dgRooms.ContextMenuStrip = cmsRoomAdd;
dgRooms.DataSource = bsRooms;
dgRooms.Dock = DockStyle.Fill;
dgRooms.Location = new Point(3, 3);
dgRooms.Name = "dgRooms";
dgRooms.ReadOnly = true;
dgRooms.Size = new Size(547, 338);
dgRooms.TabIndex = 0;
dgRooms.UserDeletingRow += dgRooms_UserDeletingRow;
//
// idDataGridViewTextBoxColumn
//
idDataGridViewTextBoxColumn.DataPropertyName = "Id";
idDataGridViewTextBoxColumn.HeaderText = "Id";
idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn";
idDataGridViewTextBoxColumn.ReadOnly = true;
//
// nameDataGridViewTextBoxColumn
//
nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
nameDataGridViewTextBoxColumn.HeaderText = "Name";
nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
nameDataGridViewTextBoxColumn.ReadOnly = true;
//
// creatorIdDataGridViewTextBoxColumn
//
creatorIdDataGridViewTextBoxColumn.DataPropertyName = "CreatorId";
creatorIdDataGridViewTextBoxColumn.HeaderText = "CreatorId";
creatorIdDataGridViewTextBoxColumn.Name = "creatorIdDataGridViewTextBoxColumn";
creatorIdDataGridViewTextBoxColumn.ReadOnly = true;
//
// createdAtDataGridViewTextBoxColumn
//
createdAtDataGridViewTextBoxColumn.DataPropertyName = "CreatedAt";
createdAtDataGridViewTextBoxColumn.HeaderText = "CreatedAt";
createdAtDataGridViewTextBoxColumn.Name = "createdAtDataGridViewTextBoxColumn";
createdAtDataGridViewTextBoxColumn.ReadOnly = true;
//
// userCountDataGridViewTextBoxColumn
//
userCountDataGridViewTextBoxColumn.DataPropertyName = "UserCount";
userCountDataGridViewTextBoxColumn.HeaderText = "UserCount";
userCountDataGridViewTextBoxColumn.Name = "userCountDataGridViewTextBoxColumn";
userCountDataGridViewTextBoxColumn.ReadOnly = true;
//
// cmsRoomAdd
//
cmsRoomAdd.Items.AddRange(new ToolStripItem[] { tsiAddRoom });
cmsRoomAdd.Name = "cmsRoomAdd";
cmsRoomAdd.Size = new Size(132, 26);
//
// tsiAddRoom
//
tsiAddRoom.Name = "tsiAddRoom";
tsiAddRoom.Size = new Size(131, 22);
tsiAddRoom.Text = "Add Room";
tsiAddRoom.Click += tsiAddRoom_Click;
//
// bsRooms
//
bsRooms.DataSource = typeof(QtCNETAPI.Models.Room);
//
// tpUsers
//
tpUsers.Controls.Add(dgUsers);
tpUsers.ImageKey = "Users";
tpUsers.Location = new Point(4, 24);
tpUsers.Name = "tpUsers";
tpUsers.Padding = new Padding(3);
tpUsers.Size = new Size(553, 344);
tpUsers.TabIndex = 1;
tpUsers.Text = "Users";
tpUsers.UseVisualStyleBackColor = true;
//
// dgUsers
//
dgUsers.AutoGenerateColumns = false;
dgUsers.BackgroundColor = Color.White;
dgUsers.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dgUsers.Columns.AddRange(new DataGridViewColumn[] { idDataGridViewTextBoxColumn1, usernameDataGridViewTextBoxColumn, profilePictureDataGridViewTextBoxColumn, bioDataGridViewTextBoxColumn, roleDataGridViewTextBoxColumn, dateOfBirthDataGridViewTextBoxColumn, createdAtDataGridViewTextBoxColumn1, lastLoginDataGridViewTextBoxColumn, statusDataGridViewTextBoxColumn, currencyAmountDataGridViewTextBoxColumn, profileCosmeticIdDataGridViewTextBoxColumn });
dgUsers.DataSource = bsUsers;
dgUsers.Dock = DockStyle.Fill;
dgUsers.Location = new Point(3, 3);
dgUsers.Name = "dgUsers";
dgUsers.ReadOnly = true;
dgUsers.Size = new Size(547, 338);
dgUsers.TabIndex = 0;
dgUsers.UserDeletingRow += dgUsers_UserDeletingRow;
//
// idDataGridViewTextBoxColumn1
//
idDataGridViewTextBoxColumn1.DataPropertyName = "Id";
idDataGridViewTextBoxColumn1.HeaderText = "Id";
idDataGridViewTextBoxColumn1.Name = "idDataGridViewTextBoxColumn1";
idDataGridViewTextBoxColumn1.ReadOnly = true;
//
// usernameDataGridViewTextBoxColumn
//
usernameDataGridViewTextBoxColumn.DataPropertyName = "Username";
usernameDataGridViewTextBoxColumn.HeaderText = "Username";
usernameDataGridViewTextBoxColumn.Name = "usernameDataGridViewTextBoxColumn";
usernameDataGridViewTextBoxColumn.ReadOnly = true;
//
// profilePictureDataGridViewTextBoxColumn
//
profilePictureDataGridViewTextBoxColumn.DataPropertyName = "ProfilePicture";
profilePictureDataGridViewTextBoxColumn.HeaderText = "ProfilePicture";
profilePictureDataGridViewTextBoxColumn.Name = "profilePictureDataGridViewTextBoxColumn";
profilePictureDataGridViewTextBoxColumn.ReadOnly = true;
//
// bioDataGridViewTextBoxColumn
//
bioDataGridViewTextBoxColumn.DataPropertyName = "Bio";
bioDataGridViewTextBoxColumn.HeaderText = "Bio";
bioDataGridViewTextBoxColumn.Name = "bioDataGridViewTextBoxColumn";
bioDataGridViewTextBoxColumn.ReadOnly = true;
//
// roleDataGridViewTextBoxColumn
//
roleDataGridViewTextBoxColumn.DataPropertyName = "Role";
roleDataGridViewTextBoxColumn.HeaderText = "Role";
roleDataGridViewTextBoxColumn.Name = "roleDataGridViewTextBoxColumn";
roleDataGridViewTextBoxColumn.ReadOnly = true;
//
// dateOfBirthDataGridViewTextBoxColumn
//
dateOfBirthDataGridViewTextBoxColumn.DataPropertyName = "DateOfBirth";
dateOfBirthDataGridViewTextBoxColumn.HeaderText = "DateOfBirth";
dateOfBirthDataGridViewTextBoxColumn.Name = "dateOfBirthDataGridViewTextBoxColumn";
dateOfBirthDataGridViewTextBoxColumn.ReadOnly = true;
//
// createdAtDataGridViewTextBoxColumn1
//
createdAtDataGridViewTextBoxColumn1.DataPropertyName = "CreatedAt";
createdAtDataGridViewTextBoxColumn1.HeaderText = "CreatedAt";
createdAtDataGridViewTextBoxColumn1.Name = "createdAtDataGridViewTextBoxColumn1";
createdAtDataGridViewTextBoxColumn1.ReadOnly = true;
//
// lastLoginDataGridViewTextBoxColumn
//
lastLoginDataGridViewTextBoxColumn.DataPropertyName = "LastLogin";
lastLoginDataGridViewTextBoxColumn.HeaderText = "LastLogin";
lastLoginDataGridViewTextBoxColumn.Name = "lastLoginDataGridViewTextBoxColumn";
lastLoginDataGridViewTextBoxColumn.ReadOnly = true;
//
// statusDataGridViewTextBoxColumn
//
statusDataGridViewTextBoxColumn.DataPropertyName = "Status";
statusDataGridViewTextBoxColumn.HeaderText = "Status";
statusDataGridViewTextBoxColumn.Name = "statusDataGridViewTextBoxColumn";
statusDataGridViewTextBoxColumn.ReadOnly = true;
//
// currencyAmountDataGridViewTextBoxColumn
//
currencyAmountDataGridViewTextBoxColumn.DataPropertyName = "CurrencyAmount";
currencyAmountDataGridViewTextBoxColumn.HeaderText = "CurrencyAmount";
currencyAmountDataGridViewTextBoxColumn.Name = "currencyAmountDataGridViewTextBoxColumn";
currencyAmountDataGridViewTextBoxColumn.ReadOnly = true;
//
// profileCosmeticIdDataGridViewTextBoxColumn
//
profileCosmeticIdDataGridViewTextBoxColumn.DataPropertyName = "ProfileCosmeticId";
profileCosmeticIdDataGridViewTextBoxColumn.HeaderText = "ProfileCosmeticId";
profileCosmeticIdDataGridViewTextBoxColumn.Name = "profileCosmeticIdDataGridViewTextBoxColumn";
profileCosmeticIdDataGridViewTextBoxColumn.ReadOnly = true;
//
// bsUsers
//
bsUsers.DataSource = typeof(QtCNETAPI.Dtos.User.UserInformationDto);
//
// ilTabIcons
//
ilTabIcons.ColorDepth = ColorDepth.Depth32Bit;
ilTabIcons.ImageStream = (ImageListStreamer)resources.GetObject("ilTabIcons.ImageStream");
ilTabIcons.TransparentColor = Color.Transparent;
ilTabIcons.Images.SetKeyName(0, "Contacts");
ilTabIcons.Images.SetKeyName(1, "Rooms");
ilTabIcons.Images.SetKeyName(2, "Users");
ilTabIcons.Images.SetKeyName(3, "Games");
ilTabIcons.Images.SetKeyName(4, "Store");
//
// AdminPanelForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.DodgerBlue;
ClientSize = new Size(585, 450);
Controls.Add(tcMain);
Controls.Add(lblServerAdmin);
Controls.Add(pbLogo);
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
Name = "AdminPanelForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "QtC.NET Server Admin Panel";
Load += AdminPanelForm_Load;
((System.ComponentModel.ISupportInitialize)pbLogo).EndInit();
tcMain.ResumeLayout(false);
tpRooms.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dgRooms).EndInit();
cmsRoomAdd.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)bsRooms).EndInit();
tpUsers.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dgUsers).EndInit();
((System.ComponentModel.ISupportInitialize)bsUsers).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pbLogo;
private Label lblServerAdmin;
private TabControl tcMain;
private TabPage tpRooms;
private TabPage tpUsers;
private ImageList ilTabIcons;
private DataGridView dgRooms;
private DataGridView dgUsers;
private ContextMenuStrip cmsRoomAdd;
private ToolStripMenuItem tsiAddRoom;
private DataGridViewTextBoxColumn idDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn creatorIdDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn createdAtDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn userCountDataGridViewTextBoxColumn;
private BindingSource bsRooms;
private DataGridViewTextBoxColumn idDataGridViewTextBoxColumn1;
private DataGridViewTextBoxColumn usernameDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn profilePictureDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn bioDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn roleDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn dateOfBirthDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn createdAtDataGridViewTextBoxColumn1;
private DataGridViewTextBoxColumn lastLoginDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn statusDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn currencyAmountDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn profileCosmeticIdDataGridViewTextBoxColumn;
private BindingSource bsUsers;
}
}

View File

@ -0,0 +1,106 @@
using Krypton.Toolkit;
using QtCNETAPI.Models;
using QtCNETAPI.Services.ApiService;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace qtcnet_client.Forms
{
public partial class AdminPanelForm : Form
{
private IApiService _apiService;
public AdminPanelForm(IApiService apiService)
{
_apiService = apiService;
InitializeComponent();
}
private async void AdminPanelForm_Load(object sender, EventArgs e)
{
// get data
var _roomData = await _apiService.GetAllRoomsAsync();
var _userData = await _apiService.GetAllUsersAsync();
if (_roomData.Success && _roomData.Data != null)
bsRooms.DataSource = _roomData.Data;
if (_userData.Success && _userData.Data != null)
bsUsers.DataSource = _userData.Data;
dgUsers.Update();
dgRooms.Update();
}
private async void tsiAddRoom_Click(object sender, EventArgs e)
{
// create a form to get room name
AddRoomForm _nameForm = new();
var _result = _nameForm.ShowDialog();
if (_result == DialogResult.OK)
{
// create the room and refresh room list
var now = DateTime.UtcNow;
var _apiRes = await _apiService.CreateRoomAsync(new()
{
Name = _nameForm.RoomName,
CreatedAt = now,
});
if (_apiRes.Success)
AdminPanelForm_Load(sender, e); // refresh data
}
}
private async void dgRooms_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if (dgRooms.CurrentCell?.Value is string roomId)
{
DialogResult _res = KryptonMessageBox.Show("Are You Sure You Want To Delete This Room?\n" +
"Deleting Rooms Also Kicks All Users In It Out.", "are you sure...?",
KryptonMessageBoxButtons.YesNo, KryptonMessageBoxIcon.Question);
if (_res == DialogResult.Yes)
{
var _apiRes = await _apiService.DeleteRoomAsync(roomId);
if (_apiRes.Success)
AdminPanelForm_Load(sender, e); // refresh data
}
e.Cancel = true; // cancel the local delete, refresh should get rid of it
}
}
private async void dgUsers_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
if(dgUsers.CurrentCell?.Value is string userId)
{
if(_apiService.CurrentUser?.Id == userId)
{
KryptonMessageBox.Show("lol why would you delete yourself", "what");
e.Cancel = true;
return;
}
DialogResult _res = KryptonMessageBox.Show("Deleting Users Should Only Be Done As A Last Resort. Proper Moderation Features Are Coming Soon.\n" +
"Are You Sure?", "are you sure...?",
KryptonMessageBoxButtons.YesNo, KryptonMessageBoxIcon.Warning);
if (_res == DialogResult.Yes)
{
// delete the user
var _apiRes = await _apiService.DeleteUserById(userId);
if(_apiRes.Success)
AdminPanelForm_Load(sender, e); // refresh data
}
e.Cancel = true; // cancel the local delete, refresh should get rid of it
}
}
}
}

View File

@ -0,0 +1,245 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="cmsRoomAdd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>120, 21</value>
</metadata>
<metadata name="bsRooms.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>250, 21</value>
</metadata>
<metadata name="bsUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>353, 21</value>
</metadata>
<metadata name="ilTabIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="ilTabIcons.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAA2hgAAAJNU0Z0AUkBTAIBAQUB
AAFwAQEBcAEBARABAAEQAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABQAMAASADAAEBAQABIAYAASAa
AAM3AVoDWAG4A2MB3wJjAV0B3wFiAl0B3wNdAd8DXQHfAWECXQHfA2MB3wNjAd8DVQGsAzABS8wAAzsB
YgNdAcUDaAH0AZ8BZQExAf8BlwFTARcB/wGWAUsBCQH/AZMBRgEBAf8BjAFDAQMB/wF9AUABCwH/AWsB
QAEaAf8BbgFQATYB/wNoAfADWgG3AzQBVMQAAzUBVQNdAccCbgFaAfUBuAFlARsB/wG5AVgBAgH/AckB
XwEAAf8B2A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4BhQL/AaoBXwL/AZkB
PgL/AY0BJwL/AYYBGgL/AYMBFQL/AYUBGQL/AYoBIgL/AY0BKAL/AZMBMwH/Am4BaAH1A10BxQM2AVkE
/wH0Ac0BbAH/AfQBywFmAf8B9AHLAWUB/wH0AcsBZQH/AfEBwQFJAf8B+QHjAawB/wOJAf8DiQH/A4kB
/wOJAf8DiQH/A4kB/wOJAf8DiQH/A5oB/wgAAyIBMQNfAckCfQFnAfoB8wHKAWUB/wH5AeEBpgH/AfsB
7QHMAf8B+wHsAcgB/wH4Ad0BmwH/AZYBgAF/Af4CZQFeAeIDPQFoBAEIAAMGAQgDMQFMA1ABmwNlAewD
fQH6A4EB/wOBAf8DgQH/A4EB/wOBAf8DgQH/A4EB/wN9AfoDagHtA1ABmwMvAUkEAANCAXIDYwHVAXcB
bQFqAfkB/wHJAZkC/wG8AX8C/wGuAWYC/wGkAVMC/wGfAUoC/wGfAUsC/wGjAVEC/wGnAVgB/wN8AfgD
XQHHAzsBYgQAQP8QAAMPARMDRwGCA2QB2wJ+AW8B/ANnAeoDVAGoAygBOxwAAwUBBgMSARcDOgFgA1EB
nwNfAdMDZwHvA2MB9gNiAe4DXgHSA1EBngM5AV8DEQEWAwUBBgwAAzwBZQNeAdIB/wHvAeAC/wHcAbwC
/wHNAZ8C/wHBAYoC/wG7AX8C/wG/AYYC/wHNAaEC/wHpAdYB/wNcAcQDNQFVCAABQgFNAT4HAAE+AwAB
KAMAAUADAAEgAwABAQEAAQEGAAEBFgAD/wEAAcABAwYAAYABAWYAAYABAQYAAcABAwgAAf8B/AIAAcAB
AwIAAf8B/AIAAYABAQIAAf8B+QYAAf8B+QYAAfABEwYAAcABAwYAAYABAQL/BAABgAEBAcABAQUAAQEB
gAYAAQEHAAEBBwABAQcAAQEGAAGAAQEGAAHAAQMCAAGAAQECAAHwAR8BwAEBAcABAws=
</value>
</data>
</root>

View File

@ -45,6 +45,7 @@ namespace qtcnet_client
private readonly UpdateService _updateService;
private readonly AudioService _audioService;
private bool IsAdmin = false;
public MainForm(IApiService apiService,
IGatewayService gatewayService,
LoggingService loggingService,
@ -643,6 +644,27 @@ namespace qtcnet_client
Controls.Add(CurrentProfileControl);
Controls.Add(MainTabControl);
if(_apiService.CurrentUser.Role == "Admin")
{
// create a link label that opens the admin panel when clicked
LinkLabel llblAdminPanel = new()
{
Location = new(325, 9),
Text = "Admin Panel",
BackColor = Color.Transparent,
};
llblAdminPanel.Click += (sender, e) =>
{
// open the admin panel
AdminPanelForm adminPanelForm = new(_apiService);
adminPanelForm.ShowDialog();
adminPanelForm.Dispose();
};
Controls.Add(llblAdminPanel);
}
ResumeLayout(true);
// minimize main window if start minimized is on

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="UserInformationDto" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>QtCNETAPI.Dtos.User.UserInformationDto, QtCNETAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Room" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>QtCNETAPI.Models.Room, QtCNETAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>