/// <summary> /// 获取指定车间指定人员交路未在牌人员的人员列表 /// </summary> public InterfaceOutPut GetTMNotInNameGroup(String Data) { InterfaceOutPut output = new InterfaceOutPut(); output.result = 1; try { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); InGetPrepareTrainmans InParams = javaScriptSerializer.Deserialize <InGetPrepareTrainmans>(Data); OutGetPrepareTrainmans OutParams = new OutGetPrepareTrainmans(); string str = ""; if (!string.IsNullOrEmpty(InParams.WorkShopGUID)) { str += " and strWorkShopGUID = @strWorkShopGUID"; } if (!string.IsNullOrEmpty(InParams.TrainmanJiaoluGUID)) { str += " and strTrainmanJiaoluGUID = @strTrainmanJiaoluGUID"; } string strSql = string.Format(@"SELECT * FROM TAB_Org_Trainman where ( nTrainmanState=7 or len(nTrainmanState)=0 or ( nTrainmanState=1 and (len(strTrainmanJiaoluGUID)=0 or strTrainmanJiaoluGUID not in(select strTrainmanJiaoluGUID from TAB_Base_TrainmanJiaolu)) ) ) {0} order by strTrainmanNumber ", str); SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("strWorkShopGUID", InParams.WorkShopGUID), new SqlParameter("strTrainmanJiaoluGUID", InParams.TrainmanJiaoluGUID) }; DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { TrainmanNamePlate trainman = new TrainmanNamePlate(); PSNameBoard.TrainmanNamePlateFromDB(trainman, dt.Rows[i]); OutParams.Trainmans.Add(trainman); } output.data = OutParams; output.result = 0; } catch (Exception ex) { output.resultStr = ex.Message; LogClass.log("Interface.GetPrepareTrainmans:" + ex.Message); throw ex; } return(output); }
/// <summary> /// 获取指定车间的指定人员交路下的预备人员列表 /// </summary> public InterfaceOutPut GetPrepareTrainmans(String Data) { InterfaceOutPut output = new InterfaceOutPut(); output.result = 1; try { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); InGetPrepareTrainmans InParams = javaScriptSerializer.Deserialize <InGetPrepareTrainmans>(Data); OutGetPrepareTrainmans OutParams = new OutGetPrepareTrainmans(); string strSql = @"select * from VIEW_Nameplate_TrainmanJiaolu_Prepare where nTrainmanState <> 7 and strWorkShopGUID = @strWorkShopGUID and strTrainmanJiaoluGUID = @strTrainmanJiaoluGUID order by dtLastEndworkTime,strTrainmanNumber"; SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("strWorkShopGUID", InParams.WorkShopGUID), new SqlParameter("strTrainmanJiaoluGUID", InParams.TrainmanJiaoluGUID) }; DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { TrainmanNamePlate trainman = new TrainmanNamePlate(); PSNameBoard.TrainmanNamePlateFromDB(trainman, dt.Rows[i]); OutParams.Trainmans.Add(trainman); } output.data = OutParams; output.result = 0; } catch (Exception ex) { output.resultStr = ex.Message; LogClass.log("Interface.GetPrepareTrainmans:" + ex.Message); throw ex; } return(output); }