Integration 2.1l6 :
- aggiunta gestione Load90 (rotazione al carico) per Produzione/Supervisore.
This commit is contained in:
@@ -14,6 +14,7 @@ namespace ib.essetre.integration.egaltech
|
||||
{
|
||||
public string projectNumber ;
|
||||
public string barLength ;
|
||||
public string barLoad90 ;
|
||||
public List<Part> parts ;
|
||||
// I seguenti Id servono per il nome del file BTL
|
||||
public int productionId ;
|
||||
@@ -50,8 +51,8 @@ namespace ib.essetre.integration.egaltech
|
||||
tw.WriteLine( Constants.SCALE_UNIT + Constants.scaleUnit.ToString()) ;
|
||||
tw.WriteLine( Constants.USERATTRIBUTE + "\"PRODID\":" + "\"" + ( IsFromProject ? 0 : productionId) + "\"") ;
|
||||
tw.WriteLine( Constants.USERATTRIBUTE + "\"PATTID\":" + "\"" + ( IsFromProject ? 0 : patternId) + "\"") ;
|
||||
barLength = barLength.Replace( ",", ".") ;
|
||||
tw.WriteLine( Constants.USERATTRIBUTE + "\"BARLEN\":" + "\"" + barLength + "\"") ;
|
||||
tw.WriteLine( Constants.USERATTRIBUTE + "\"LOAD90\":" + "\"" + barLoad90 + "\"") ;
|
||||
|
||||
foreach ( Part singlePart in parts) {
|
||||
tw.WriteLine( Constants.PART) ;
|
||||
|
||||
@@ -344,7 +344,8 @@ namespace ib.essetre.integration.egaltech
|
||||
|
||||
DataRow dRow0 = dTab.Rows[0] ;
|
||||
btlObject.projectNumber = dRow0["projectId"].ToString() ;
|
||||
btlObject.barLength = Convert.ToString( GetBarLengthP( (int)dRow0["patternId"], (int)dRow0["productionId"])) ;
|
||||
btlObject.barLength = GetBarLengthP( (int)dRow0["patternId"], (int)dRow0["productionId"]).ToString( "F3", CultureInfo.InvariantCulture) ;
|
||||
btlObject.barLoad90 = GetBarLoad90P( (int)dRow0["patternId"], (int)dRow0["productionId"]).ToString( CultureInfo.InvariantCulture) ;
|
||||
btlObject.productionId = (int)dRow0["productionId"] ;
|
||||
btlObject.patternId = (int)dRow0["patternId"] ;
|
||||
btlObject.parts = new List<BTL.Part>() ;
|
||||
@@ -455,7 +456,8 @@ namespace ib.essetre.integration.egaltech
|
||||
|
||||
DataRow dRow0 = dTab.Rows[0] ;
|
||||
btlObject.projectNumber = dRow0["projectId"].ToString() ;
|
||||
btlObject.barLength = Convert.ToString( GetBarLengthO( (int)dRow0["elementId"], (int)dRow0["projectId"])) ;
|
||||
btlObject.barLength = GetBarLengthO( (int)dRow0["elementId"], (int)dRow0["projectId"]).ToString( "F3", CultureInfo.InvariantCulture) ;
|
||||
btlObject.barLoad90 = "0" ;
|
||||
btlObject.projectId = (int)dRow0["projectId"] ;
|
||||
btlObject.elementId = (int)dRow0["elementId"] ;
|
||||
btlObject.parts = new List<BTL.Part>() ;
|
||||
@@ -601,6 +603,35 @@ namespace ib.essetre.integration.egaltech
|
||||
return barLength ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
// Recupera il flag di carico con rotazione di 90° nel caso Produzione (colonna "load90")
|
||||
private static int GetBarLoad90P( int patternId, int productionId)
|
||||
{
|
||||
int nLoad90 = 0 ;
|
||||
|
||||
string sqlBarLength = "SELECT load90 " +
|
||||
"FROM dbo.vw_Pattern " +
|
||||
"WHERE patternId = @firstId " +
|
||||
"AND productionId = @secondId" ;
|
||||
|
||||
// Connessione al DB ed esecuzione query
|
||||
using ( SqlConnection cn = new SqlConnection( _SqlConnectionStr)) {
|
||||
cn.Open() ;
|
||||
using ( SqlCommand sqlCommand = new SqlCommand( sqlBarLength, cn)) {
|
||||
sqlCommand.Parameters.Add( "@firstId", SqlDbType.Int) ;
|
||||
sqlCommand.Parameters.Add( "@secondId", SqlDbType.Int) ;
|
||||
sqlCommand.Parameters["@firstId"].Value = patternId ;
|
||||
sqlCommand.Parameters["@secondId"].Value = productionId ;
|
||||
SqlDataReader reader = sqlCommand.ExecuteReader() ;
|
||||
while ( reader.Read()) {
|
||||
nLoad90 = Convert.ToInt32( reader["load90"]) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nLoad90 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
// Recupera lo stato della barra nel caso Produzione (colonna "state")
|
||||
private static int GetBarStateP( int patternId, int productionId)
|
||||
|
||||
@@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
|
||||
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
// usando l'asterisco '*' come illustrato di seguito:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.1.11.5")]
|
||||
[assembly: AssemblyFileVersion("2.1.11.5")]
|
||||
[assembly: AssemblyVersion("2.1.12.6")]
|
||||
[assembly: AssemblyFileVersion("2.1.12.6")]
|
||||
|
||||
Reference in New Issue
Block a user