Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_step into develop
This commit is contained in:
@@ -11,5 +11,6 @@
|
||||
<serverPort>9000</serverPort>
|
||||
<language>en</language>
|
||||
<enableDirectoryBrowsing>true</enableDirectoryBrowsing>
|
||||
<databaseAddress>localhost</databaseAddress>
|
||||
</serverConfig>
|
||||
</root>
|
||||
@@ -21,6 +21,7 @@
|
||||
<xs:element name="serverPort" type="xs:int" minOccurs='1' maxOccurs='1'/>
|
||||
<xs:element name="language" type="xs:language" minOccurs='1' maxOccurs='1' default="en"/>
|
||||
<xs:element name="enableDirectoryBrowsing" type="xs:boolean" default="false"/>
|
||||
<xs:element name="databaseAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -38,7 +38,8 @@ namespace Step.Config
|
||||
{ // Set server config model data
|
||||
Language = CultureInfo.CreateSpecificCulture(x.Element("language").Value),
|
||||
ServerPort = Convert.ToInt32(x.Element("serverPort").Value),
|
||||
EnableDirectoryBrowsing = Convert.ToBoolean(x.Element("enableDirectoryBrowsing").Value)
|
||||
EnableDirectoryBrowsing = Convert.ToBoolean(x.Element("enableDirectoryBrowsing").Value),
|
||||
DatabaseAddress = x.Element("databaseAddress").Value
|
||||
}).FirstOrDefault();
|
||||
|
||||
// Get Areas file handler
|
||||
|
||||
@@ -26,8 +26,11 @@ namespace Step.Database
|
||||
public DbSet<MaintenanceModel> Maintenances { get; set; }
|
||||
public DbSet<PerformedMaintenanceModel> PerformedMaintenances { get; set; }
|
||||
|
||||
|
||||
public static string CONNECTION_STRING = "Server = " + ServerStartupConfig.DatabaseAddress + "; Database=" + DATABASE_NAME +";Uid="+ DATABASE_USER +";Pwd="+ DATABASE_PWD +";";
|
||||
|
||||
public DatabaseContext()
|
||||
: base("mySQLDatabaseConnection")
|
||||
: base(CONNECTION_STRING)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -12,5 +12,6 @@ namespace Step.Model.ConfigModels
|
||||
public CultureInfo Language { get; set; }
|
||||
public int ServerPort { get; set; }
|
||||
public bool EnableDirectoryBrowsing { get; set; }
|
||||
public string DatabaseAddress { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,11 @@ namespace Step.Utils
|
||||
public const string SIEMENS = "SIEMENS";
|
||||
public const string OSAI = "OSAI";
|
||||
}
|
||||
// Database config
|
||||
public const string DATABASE_USER = "root";
|
||||
public const string DATABASE_PWD = "root";
|
||||
public const string DATABASE_NAME = "step";
|
||||
|
||||
// Registry key
|
||||
public const string REGISTER_MACHINE_ID_KEY_NAME = "MachineUniqueId";
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace Step.Controllers.SignalR
|
||||
Groups.Add(Context.ConnectionId, "ncData");
|
||||
NewConnectedClients = true;
|
||||
ConnectedClients.Add(Context.ConnectionId);
|
||||
// Resends data to all the clients
|
||||
MessageServices.Current.Publish(BROADCAST_DATA);
|
||||
|
||||
var result = base.OnReconnected();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user