@ -40,8 +40,8 @@ namespace WeighBusiness.BL
if ( teams . Count ( ) > 0 ) {
foreach ( var team in teams ) {
string insertSql = InsertUtil . GetInsertSql ( TableNames . 生 产 班 组 ,
new string [ ] { "ProductTeam_ID" , "Name" , "ProduceType" , "Employee_ID" , "RowVersion" } ,
new string [ ] { team . ProductTeam_ID . ToString ( ) , team . Name , team . ProduceType , team . Employee_ID = = null ? "null" : team . Employee_ID . Value . ToString ( ) , team . RowVersion . ToString ( ) } ) ;
new string [ ] { "ProductTeam_ID" , "Name" , "ProduceType" , "Employee_ID" , "RowVersion" , "ClientNode" } ,
new string [ ] { team . ProductTeam_ID . ToString ( ) , team . Name , team . ProduceType , team . Employee_ID = = null ? "null" : team . Employee_ID . Value . ToString ( ) , team . RowVersion . ToString ( ) , team . ClientNode } ) ;
she . ExecuteNonQuery ( insertSql , out success , out errorMessage ) ;
if ( ! success & & ! string . IsNullOrEmpty ( errorMessage ) ) {
she . Rollback ( ) ;
@ -94,9 +94,9 @@ namespace WeighBusiness.BL
public static void SyncProductTeam ( )
{
var domain_ID = ConfigurationManager . AppSettings [ "Domain_ID" ] ;
var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductTeamRowVersion" ;
var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductTeamRowVersion2 " ;
if ( domain_ID ! = null & & ! string . IsNullOrEmpty ( domain_ID ) ) {
var productTeamRowVersions = RpcFacade . Call < List < Tuple < long? , int? , string , string , long? > > > ( method , long . Parse ( domain_ID ) ) ;
var productTeamRowVersions = RpcFacade . Call < List < Tuple < long? , int? , string , string , long? , string > > > ( method , long . Parse ( domain_ID ) ) ;
var oldProductTeamRowVersions = GetProductTeamRowVersion ( ) ;
var needInsertProductTeamID = new List < long? > ( ) ;
@ -150,6 +150,7 @@ namespace WeighBusiness.BL
team . Name = result . Item3 ;
team . ProduceType = result . Item4 ;
team . Employee_ID = result . Item5 ;
team . ClientNode = result . Item6 ;
list . Add ( team ) ;
}
@ -187,9 +188,9 @@ namespace WeighBusiness.BL
return errorMessage ;
}
public static ProductTeam GetProductTeam ( long? employeeId )
public static ProductTeam GetProductTeam ( string clientNode )
{
var table = SqlHelperEx . DoQuery ( "select ProductTeam_ID,Name,ProduceType from {0} where Employee_ID = {1}" . FormatWith ( TableNames . 生 产 班 组 , employeeId = = null ? "null" : employeeId . Value . ToString ( ) ) ) ;
var table = SqlHelperEx . DoQuery ( "select ProductTeam_ID,Name,ProduceType from {0} where ClientNode = {1}" . FormatWith ( TableNames . 生 产 班 组 , clientNode = = null ? "null" : string . Format ( "'{0}'" , clientNode ) ) ) ;
if ( table . Rows . Count > 0 ) {
foreach ( DataRow row in table . Rows ) {
var team = new ProductTeam ( ) ;