예제 #1
0
        public static string uploadInspectionRecords(_XJmodel inspection)
        {
            Program.WriteLog("调用web服务,上传巡检信息");
            string ret = Program.g_trainService.SaveInspectionRecord("");

            Program.WriteLog("调用web服务返回:" + ret);
            return("");
        }
예제 #2
0
        public List <_XJmodel> GetInspectionRecordsByDate(DateTime startDate, DateTime endDate)
        {
            SQLiteDataReader dr       = null;
            List <_XJmodel>  tempList = new List <_XJmodel>();

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter(PARAM_STARTTIME, DbType.DateTime),
                new SQLiteParameter(PARAM_ENDTIME,   DbType.DateTime)
            };
            parameters[0].Value = startDate;
            parameters[1].Value = endDate;
            try
            {
                SQLiteDBHelper sdb = new SQLiteDBHelper(Program.g_dbPath);
                dr = sdb.ExecuteReader(SELECT_IR, parameters);
                while (dr.Read())
                {
                    _XJmodel inspectionRecord = new _XJmodel();

                    inspectionRecord.lcNumber  = dr.GetString(0).Trim();
                    inspectionRecord.getStatus = dr.GetString(1).Trim();
                    if (dr[3] != DBNull.Value)
                    {
                        inspectionRecord.getRecordTime = dr.GetDateTime(3);
                    }
                    else
                    {
                        inspectionRecord.getRecordTime = null;
                    }
                    if (dr[4] != DBNull.Value)
                    {
                        inspectionRecord.getWorker = dr.GetString(4).Trim();
                    }
                    else
                    {
                        inspectionRecord.getWorker = "";
                    }


                    tempList.Add(inspectionRecord);
                }
                return(tempList);
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                }
            }
        }