|
|
|
|
@ -13,7 +13,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
public int Phase { get; set; }
|
|
|
|
|
public int? Width { get; set; }
|
|
|
|
|
public string? ChildRelations { get; set; }
|
|
|
|
|
public string? FatherRelations { get; set; }
|
|
|
|
|
public string? FatherRelation { get; set; }
|
|
|
|
|
public string? ChildNodes { get; set; }
|
|
|
|
|
public string? FatherNode { get; set; }
|
|
|
|
|
public string? Details { get; set; }
|
|
|
|
|
@ -33,8 +33,8 @@ namespace OMS.NET.DbClass
|
|
|
|
|
{
|
|
|
|
|
using MySqlConnection connection = new(GlobalArea.ConnectionStringWithDbName);
|
|
|
|
|
connection.Open();
|
|
|
|
|
var query = @"INSERT INTO map_0_data (type, points, point, color, phase, width, child_relations, father_relations, child_nodes, father_node, details, custom)
|
|
|
|
|
VALUES (@Type, @Points, @Point, @Color, @Phase, @Width, @ChildRelations, @FatherRelations, @ChildNodes, @FatherNode, @Details, @Custom)";
|
|
|
|
|
var query = @"INSERT INTO map_0_data (type, points, point, color, phase, width, child_relations, father_relation, child_nodes, father_node, details, custom)
|
|
|
|
|
VALUES (@Type, @Points, @Point, @Color, @Phase, @Width, @ChildRelations, @FatherRelation, @ChildNodes, @FatherNode, @Details, @Custom)";
|
|
|
|
|
using MySqlCommand command = new(query, connection);
|
|
|
|
|
command.Parameters.AddWithValue("@Type", mapData.Type);
|
|
|
|
|
command.Parameters.AddWithValue("@Points", mapData.Points);
|
|
|
|
|
@ -43,7 +43,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
command.Parameters.AddWithValue("@Phase", mapData.Phase);
|
|
|
|
|
command.Parameters.AddWithValue("@Width", mapData.Width ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@ChildRelations", mapData.ChildRelations ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@FatherRelations", mapData.FatherRelations ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@FatherRelation", mapData.FatherRelation ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@ChildNodes", mapData.ChildNodes ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@FatherNode", mapData.FatherNode ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@Details", mapData.Details ?? (object)DBNull.Value);
|
|
|
|
|
@ -57,7 +57,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
using MySqlConnection connection = new(GlobalArea.ConnectionStringWithDbName);
|
|
|
|
|
connection.Open();
|
|
|
|
|
var query = @"UPDATE map_0_data SET type = @Type, points = @Points, point = @Point, color = @Color, phase = @Phase, width = @Width,
|
|
|
|
|
child_relations = @ChildRelations, father_relations = @FatherRelations, child_nodes = @ChildNodes, father_node = @FatherNode,
|
|
|
|
|
child_relations = @ChildRelations, father_relation = @FatherRelation, child_nodes = @ChildNodes, father_node = @FatherNode,
|
|
|
|
|
details = @Details, custom = @Custom WHERE id = @Id";
|
|
|
|
|
using MySqlCommand command = new(query, connection);
|
|
|
|
|
command.Parameters.AddWithValue("@Id", mapData.Id);
|
|
|
|
|
@ -68,7 +68,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
command.Parameters.AddWithValue("@Phase", mapData.Phase);
|
|
|
|
|
command.Parameters.AddWithValue("@Width", mapData.Width ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@ChildRelations", mapData.ChildRelations ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@FatherRelations", mapData.FatherRelations ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@FatherRelation", mapData.FatherRelation ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@ChildNodes", mapData.ChildNodes ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@FatherNode", mapData.FatherNode ?? (object)DBNull.Value);
|
|
|
|
|
command.Parameters.AddWithValue("@Details", mapData.Details ?? (object)DBNull.Value);
|
|
|
|
|
@ -90,7 +90,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
{
|
|
|
|
|
using MySqlConnection connection = new(GlobalArea.ConnectionStringWithDbName);
|
|
|
|
|
connection.Open();
|
|
|
|
|
var query = @"SELECT id, type, points, point, color, phase, width, child_relations, father_relations, child_nodes, father_node, details, custom
|
|
|
|
|
var query = @"SELECT id, type, points, point, color, phase, width, child_relations, father_relation, child_nodes, father_node, details, custom
|
|
|
|
|
FROM map_0_data WHERE id = @Id";
|
|
|
|
|
using MySqlCommand command = new(query, connection);
|
|
|
|
|
command.Parameters.AddWithValue("@Id", id);
|
|
|
|
|
@ -107,7 +107,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
Phase = reader.GetInt32("phase"),
|
|
|
|
|
Width = reader["width"] as int?,
|
|
|
|
|
ChildRelations = reader["child_relations"] as string,
|
|
|
|
|
FatherRelations = reader["father_relations"] as string,
|
|
|
|
|
FatherRelation = reader["father_relation"] as string,
|
|
|
|
|
ChildNodes = reader["child_nodes"] as string,
|
|
|
|
|
FatherNode = reader["father_node"] as string,
|
|
|
|
|
Details = reader["details"] as string,
|
|
|
|
|
@ -139,7 +139,7 @@ namespace OMS.NET.DbClass
|
|
|
|
|
Phase = reader.GetInt32("phase"),
|
|
|
|
|
Width = reader.IsDBNull(reader.GetOrdinal("width")) ? (int?)null : reader.GetInt32("width"),
|
|
|
|
|
ChildRelations = reader.IsDBNull(reader.GetOrdinal("child_relations")) ? null : reader.GetString("child_relations"),
|
|
|
|
|
FatherRelations = reader.IsDBNull(reader.GetOrdinal("father_relations")) ? null : reader.GetString("father_relations"),
|
|
|
|
|
FatherRelation = reader.IsDBNull(reader.GetOrdinal("father_relation")) ? null : reader.GetString("father_relation"),
|
|
|
|
|
ChildNodes = reader.IsDBNull(reader.GetOrdinal("child_nodes")) ? null : reader.GetString("child_nodes"),
|
|
|
|
|
FatherNode = reader.IsDBNull(reader.GetOrdinal("father_node")) ? null : reader.GetString("father_node"),
|
|
|
|
|
Details = reader.IsDBNull(reader.GetOrdinal("details")) ? null : reader.GetString("details"),
|
|
|
|
|
|