/// <summary> /// 按条码查询工件信息 /// </summary> /// <param name="workId"></param> /// <param name="MoList"></param> /// <returns></returns> public bool QueryData(int counter, ref List <ModalSpurtCodeInfo> MoList) { bool bRet = true; try { DataSet dt; SQLiteParameter[] parameters = { new SQLiteParameter("@Counter", DbType.Int32) }; parameters[0].Value = counter; dt = SQLiteHelper.Query(SQL_SELECT_ONE, parameters); if (dt != null) { if (MoList == null) { MoList = new List <ModalSpurtCodeInfo>(); } foreach (DataRow dr in dt.Tables[0].Rows) { ModalSpurtCodeInfo tmp = new ModalSpurtCodeInfo(); tmp.Row2Model(dr); MoList.Add(tmp); } } } catch (Exception ex) { Util.LogManager.Logger.Error("查询记录是出现错误,错误为{0}", ex.ToString()); bRet = false; } return(bRet); }
/// <summary> /// 克隆函数 /// </summary> public object Clone() { ModalSpurtCodeInfo ds = new ModalSpurtCodeInfo(); ds.Counter = Counter; ds.SpurtCode = SpurtCode; ds.Tab = Tab; return(ds); }
/// <summary> /// 按条件查询条码信息 /// </summary> /// <param name="condition"></param> /// <param name="MoList"></param> /// <returns></returns> public int AddData(ModalSpurtCodeInfo Mo) { int iRet = 0; try { SQLiteParameter[] parameters = { new SQLiteParameter("@Counter", DbType.Int32), new SQLiteParameter("@SpurtCode", DbType.String), new SQLiteParameter("@Tab", DbType.Int32), }; parameters[0].Value = Mo.Counter; parameters[1].Value = Mo.SpurtCode; parameters[2].Value = Mo.Tab; iRet = SQLiteHelper.ExecuteSql(SQL_INSERT, parameters); } catch (Exception ex) { Util.LogManager.Logger.Error("插入数据库出现错误,错误为{0}", ex.ToString()); iRet = 0; } return(iRet); }