public string AddDetailToRSnStationDetail(string SNDetailID, R_SN SN, string Line, string StationName, string DeviceName, OleExec DB) { string result = string.Empty; string sql = string.Empty; T_R_SN_STATION_DETAIL Table_R_Sn_Station_Detail = new T_R_SN_STATION_DETAIL(DB, DBType); Row_R_SN_STATION_DETAIL row = null; if (SN != null && !string.IsNullOrEmpty(SN.ID)) { row = (Row_R_SN_STATION_DETAIL)ConstructRow(SN); row.ID = SNDetailID; row.R_SN_ID = SN.ID; row.CLASS_NAME = GetWorkClass(DB); row.LINE = Line; row.STATION_NAME = StationName; row.DEVICE_NAME = DeviceName; row.EDIT_TIME = GetDBDateTime(DB); if (this.DBType == DB_TYPE_ENUM.Oracle) { sql = row.GetInsertString(this.DBType); result = DB.ExecSQL(sql); return(result); } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } } return(result); }
public R_SN_STATION_DETAIL GetSNLastPassStationDetail(string SN, OleExec DB) { R_SN_STATION_DETAIL R_Sn_Station_Detail = null; Row_R_SN_STATION_DETAIL Rows = (Row_R_SN_STATION_DETAIL)NewRow(); DataTable Dt = new DataTable(); string result = string.Empty; string StrSql = string.Empty; StrSql = $@"select*from (select*from r_sn_station_detail where sn='{SN}' and repair_failed_flag='0' order by edit_time desc)a where rownum=1 "; Dt = DB.ExecSelect(StrSql).Tables[0]; if (Dt.Rows.Count > 0) { Rows.loadData(Dt.Rows[0]); R_Sn_Station_Detail = Rows.GetDataObject(); } return(R_Sn_Station_Detail); }
public List <R_SN_STATION_DETAIL> GetSNStationDetailByPanel(string PanelSn, OleExec DB) { List <R_SN_STATION_DETAIL> R_SN_STATION_DETAIL_LIST = new List <R_SN_STATION_DETAIL>(); R_SN_STATION_DETAIL R_Sn_Station_Detail = null; Row_R_SN_STATION_DETAIL Rows = (Row_R_SN_STATION_DETAIL)NewRow(); DataTable Dt = new DataTable(); string result = string.Empty; string StrSql = string.Empty; StrSql = $@"SELECT * FROM R_SN_STATION_DETAIL WHERE SN IN (SELECT SN FROM R_PANEL_SN WHERE PANEL = '{PanelSn}') order by id "; Dt = DB.ExecSelect(StrSql).Tables[0]; foreach (DataRow r in Dt.Rows) { Rows.loadData(r); R_Sn_Station_Detail = Rows.GetDataObject(); R_SN_STATION_DETAIL_LIST.Add(R_Sn_Station_Detail); } return(R_SN_STATION_DETAIL_LIST); }