//维修记录查询 根据工单号 public DataTable repairLogQuery(String orderId) { RepairLogDB repairLogDb = new RepairLogDB(); DataSet ds = repairLogDb.repairLogQuery(orderId); if (ds.Tables[0].Rows.Count > 0) { return(ds.Tables[0]); } else { return(null); } }
public DataSet orderQueryByOrderId(String orderId, Boolean isOnlyOrderInfo) { DataSet orderInfoDataSet = new DataSet(); DataTable dt = orderDb.orderQueryByOrderId(orderId).Tables[0]; if (dt.Rows.Count == 0) { return(null); } dt.TableName = "OrderInfoTable"; orderInfoDataSet.Tables.Add(dt.Copy()); if (isOnlyOrderInfo == true) { return(orderInfoDataSet); } int customerId = Convert.ToInt16(dt.Rows[0]["CustomerId"]); int stationId = Convert.ToInt16(dt.Rows[0]["StationId"]); int createUserId = Convert.ToInt16(dt.Rows[0]["CreateUserId"]); int technicianId = Convert.ToInt16(dt.Rows[0]["TechnicianId"]); int adminId = Convert.ToInt16(dt.Rows[0]["AdminId"]); CustomerDB customerDb = new CustomerDB(); dt = customerDb.customerQueryByCustomerId(customerId).Tables[0]; dt.TableName = "CustomerTable"; orderInfoDataSet.Tables.Add(dt.Copy()); ProductDB productDb = new ProductDB(); dt = productDb.productQuery(orderId).Tables[0]; dt.TableName = "ProductTable"; orderInfoDataSet.Tables.Add(dt.Copy()); SparePartDB sparePartDb = new SparePartDB(); dt = sparePartDb.sparePartQuery(orderId).Tables[0]; dt.TableName = "SparePartTable"; orderInfoDataSet.Tables.Add(dt.Copy()); StationDB stationDb = new StationDB(); dt = stationDb.stationQueryByStationId(stationId).Tables[0]; dt.TableName = "StationTable"; orderInfoDataSet.Tables.Add(dt.Copy()); dt = orderDb.orderLogQuery(orderId).Tables[0]; dt.TableName = "OrderLogTable"; orderInfoDataSet.Tables.Add(dt.Copy()); UserDB userDb = new UserDB(); dt = userDb.userQueryByUserId(technicianId).Tables[0]; dt.TableName = "TechnicianTable"; orderInfoDataSet.Tables.Add(dt.Copy()); dt = userDb.userQueryByUserId(createUserId).Tables[0]; dt.TableName = "CreateUserTable"; orderInfoDataSet.Tables.Add(dt.Copy()); dt = userDb.userQueryByUserId(adminId).Tables[0]; dt.TableName = "AdminTable"; orderInfoDataSet.Tables.Add(dt.Copy()); RepairLogDB repairLogDb = new RepairLogDB(); dt = repairLogDb.repairLogQuery(orderId).Tables[0]; dt.TableName = "RepairLogTable"; orderInfoDataSet.Tables.Add(dt.Copy()); return(orderInfoDataSet); }