Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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);
        }