Ejemplo n.º 1
0
        /// <summary>
        /// Submits a fault model to the database
        /// </summary>
        /// <param name="trackName"></param>
        /// <param name="faultComments"></param>
        /// <param name="faultType"></param>
        /// <param name="isUrgent"></param>
        /// <returns></returns>
        public async Task SubmitFaultToDb(Fault fault)
        {
            // TODO: add pictures Dictionary<string, byte[]> faultPics
            //Fault fault = new Fault()
            //{
            //    FaultId = faultId,
            //    TrackName = trackName,
            //    Employee = UserDataCache.CurrentEmployeeData.EmployeeCredentials,
            //    AreaAddress = InspectionDataCache.CurrentReportData.Address,
            //    FaultComments = faultComments,
            //    FaultType = faultType,
            //    IsUrgent = isUrgent,
            //    Latitude = lat,
            //    Longitude = lng,
            //    ReportId = InspectionDataCache.CurrentReportData.ReportId
            //};

            if (fault.FaultId != null)
            {
                await DatabaseService.UpdateFault(fault);
            }
            else
            {
                await DatabaseService.InsertFault(fault);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inserts a fault's coordinates into the database
        /// </summary>
        /// <param name="pin"></param>
        /// <returns></returns>
        public async Task InsertFault(Pin pinContainingFault)
        {
            var fault = new Fault()
            {
                Latitude  = pinContainingFault.Position.Latitude,
                Longitude = pinContainingFault.Position.Longitude,
            };

            await DatabaseService.InsertFault(fault);
        }