Ejemplo n.º 1
0
        public bool UpdateInsuletPumpSettings(int siteId, string dataJson)
        {
            ServiceLog sl = new ServiceLog();

            try
            {
                SiteId = siteId;
                mq     = new MeterQueries(siteId);

                INSULETPUMPSETTINGSEntity data = JsonConvert.DeserializeObject <INSULETPUMPSETTINGSEntity>(dataJson);

                if (data == null)
                {
                    return(false);
                }

                mq.UpdateInsuletPumpSettings(data.PATIENTID, data);

                return(true);
            }
            catch (Exception ex)
            {
                //log...
                sl.Log(Guid.Empty, "UpdateInsuletPumpSettings", "FirebirdDatabaseService", ex.StackTrace, $"SiteId: {SiteId} - Exception: {ex.Message}", dataJson, ServiceLog.TraceEventType.Error);

                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool UpdateDmdata(int siteId, string dataJson)
        {
            ServiceLog sl = new ServiceLog();

            try
            {
                SiteId = siteId;
                mq     = new MeterQueries(siteId);

                DMDATAEntity data = JsonConvert.DeserializeObject <DMDATAEntity>(dataJson);
                if (data == null)
                {
                    return(false);
                }

                mq.UpdateDmDataValues(data.PATIENTID, data.LOWBGLEVEL, data.HIGHBGLEVEL, data.LASTMODIFIEDDATE);

                return(true);
            }
            catch (Exception ex)
            {
                //log...
                sl.Log(Guid.Empty, "UpdateDmdata", "FirebirdDatabaseService", ex.StackTrace, $"SiteId: {SiteId} - Exception: {ex.Message}", dataJson, ServiceLog.TraceEventType.Error);

                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool InsertPumpTimeSlots(int siteId, string dataJson)
        {
            ServiceLog sl = new ServiceLog();

            try
            {
                SiteId = siteId;
                mq     = new MeterQueries(siteId);

                List <PUMPTIMESLOTSEntity> data = JsonConvert.DeserializeObject <List <PUMPTIMESLOTSEntity> >(dataJson);

                if (data == null)
                {
                    return(false);
                }

                foreach (var slot in data)
                {
                    mq.AddPumpTimeSlot(slot.PATIENTID, slot);
                }

                return(true);
            }
            catch (Exception ex)
            {
                //log...
                sl.Log(Guid.Empty, "InsertPumpTimeSlots", "FirebirdDatabaseService", ex.StackTrace, $"SiteId: {SiteId} - Exception: {ex.Message}", dataJson, ServiceLog.TraceEventType.Error);

                return(false);
            }
        }
Ejemplo n.º 4
0
        public bool InsertPatientPumpProgram(int siteId, string dataJson)
        {
            ServiceLog sl = new ServiceLog();

            try
            {
                SiteId = siteId;
                mq     = new MeterQueries(siteId);

                PATIENTPUMPPROGRAMEntity data = JsonConvert.DeserializeObject <PATIENTPUMPPROGRAMEntity>(dataJson);

                if (data == null)
                {
                    return(false);
                }

                mq.AddPatientPumpProgram(data);

                return(true);
            }
            catch (Exception ex)
            {
                //log...
                sl.Log(Guid.Empty, "InsertPatientPumpProgram", "FirebirdDatabaseService", ex.StackTrace, $"SiteId: {SiteId} - Exception: {ex.Message}", dataJson, ServiceLog.TraceEventType.Error);

                return(false);
            }
        }
Ejemplo n.º 5
0
        public bool InsertMeterReadings(int siteId, string dataJson)
        {
            ServiceLog sl = new ServiceLog();

            try
            {
                SiteId = siteId;
                mq     = new MeterQueries(siteId);

                List <METERREADINGEntity> data = JsonConvert.DeserializeObject <List <METERREADINGEntity> >(dataJson);

                if (data == null)
                {
                    return(false);
                }

                mq.BulkInsertMeterReading(data);

                return(true);
            }
            catch (Exception ex)
            {
                //log...
                sl.Log(Guid.Empty, "InsertMeterReadings", "FirebirdDatabaseService", ex.StackTrace, $"SiteId: {SiteId} - Exception: {ex.Message}", dataJson, ServiceLog.TraceEventType.Error);

                return(false);
            }
        }