public bool QueryData(ref List <ModalWeightInfoTable> MoList) { bool bRet = true; try { DataSet dt = SQLiteHelper.Query(SQL_SELECT_ALL); if (dt != null) { if (MoList == null) { MoList = new List <ModalWeightInfoTable>(); } foreach (DataRow dr in dt.Tables[0].Rows) { ModalWeightInfoTable tmp = new ModalWeightInfoTable(); tmp.Row2Model(dr); MoList.Add(tmp); } } } catch (Exception ex) { Util.LogManager.Logger.Error("查询记录是出现错误,错误为{0}", ex.ToString()); bRet = false; } return(bRet); }
/// <summary> /// 按条码查询工件信息 /// </summary> /// <param name="workId"></param> /// <param name="MoList"></param> /// <returns></returns> public bool QueryData(Int32 tab, ref List <ModalWeightInfoTable> MoList) { bool bRet = true; try { DataSet dt; SQLiteParameter[] parameters = { new SQLiteParameter("@Tab", DbType.Int32) }; parameters[0].Value = tab; dt = SQLiteHelper.Query(SQL_SELECT_ONE, parameters); if (dt != null) { if (MoList == null) { MoList = new List <ModalWeightInfoTable>(); } foreach (DataRow dr in dt.Tables[0].Rows) { ModalWeightInfoTable tmp = new ModalWeightInfoTable(); tmp.Row2Model(dr); MoList.Add(tmp); } } } catch (Exception ex) { Util.LogManager.Logger.Error("查询记录是出现错误,错误为{0}", ex.ToString()); bRet = false; } return(bRet); }
/// <summary> /// 按时间查询工件信息 /// </summary> /// <param name="workId"></param> /// <param name="MoList"></param> /// <returns></returns> public bool QueryData(string time1, string time2, ref List <ModalWeightInfoTable> MoList) { bool bRet = true; try { DataSet dt; string sql = string.Format("{0} where Time BETWEEN '{1}' AND '{2}'", SQL_SELECT, time1, time2); dt = SQLiteHelper.Query(sql); if (dt != null) { if (MoList == null) { MoList = new List <ModalWeightInfoTable>(); } foreach (DataRow dr in dt.Tables[0].Rows) { ModalWeightInfoTable tmp = new ModalWeightInfoTable(); tmp.Row2Model(dr); MoList.Add(tmp); } } } catch (Exception ex) { Util.LogManager.Logger.Error("查询记录是出现错误,错误为{0}", ex.ToString()); bRet = false; } return(bRet); }