Ejemplo n.º 1
0
        public static List <AlarmHistoryData> getCNCAlarmSolutionDetails(string company, string plant, string machine, string alarmNum)
        {
            List <AlarmHistoryData> list = new List <AlarmHistoryData>();

            try
            {
                list = MongoDBAccess.getCNCAlarmSolutionData(company, plant, machine, alarmNum);
                //var filter = "{'metadata.AlarmNo':'" + alarmNum + "','metadata.MTB':'" + mtb + "'}";
                //var dataset = _MongoDatabase.GetCollection<BsonDocument>("CNC&PreventiveAlarms.files").Find(filter).ToList();
                //int slno = 1;
                //foreach (var item in dataset)
                //{
                //    data = new AlarmHistoryData();
                //    BsonDocument metadata = item["metadata"].AsBsonDocument;
                //    data.AlarmNo = metadata["AlarmNo"].ToString();
                //    data.AlarmCause = metadata["Cause"].ToString();
                //    data.AlarmSolution = metadata["Solution"].ToString();
                //    data.SlNo = slno.ToString();
                //    list.Add(data);
                //    slno++;
                //}
            }
            catch (Exception ex)
            {
            }
            return(list);
        }