private async Task <Munition> UpdateDataWithFile()
        {
            using (var uploadController = new UploadController <Munition>())
            {
                uploadController.ControllerContext = this.ControllerContext;
                uploadController.Request           = this.Request;
                var munition = await uploadController.PostFileWithData("munitionFormData", "Munition");

                if (munition != null && uploadController.ListofFiles != null && uploadController.ListofFiles.Count > 0)
                {
                    munition.UpdateFileProperties(munition.GetType().GetProperties().Where(p => properties.Contains(p.Name)).ToArray(), this.Request, uploadController.ListofFiles);
                }

                return(munition);
            }
        }
Ejemplo n.º 2
0
        private async Task <Platform> UpdateDataWithFile()
        {
            using (var uploadController = new UploadController <Platform>())
            {
                uploadController.ControllerContext = this.ControllerContext;
                uploadController.Request           = this.Request;
                var platform = await uploadController.PostFileWithData("platformFormData", "Platform");

                if (platform != null && uploadController.ListofFiles != null && uploadController.ListofFiles.Count > 0)
                {
                    platform.UpdateFileProperties(platform.GetType().GetProperties().Where(p => properties.Contains(p.Name)).ToArray(), this.Request, uploadController.ListofFiles);
                }

                return(platform);
            }
        }
        private async Task <CCIRPIR> UpdateDataWithFile()
        {
            using (var uploadController = new UploadController <CCIRPIR>())
            {
                uploadController.ControllerContext = this.ControllerContext;
                uploadController.Request           = this.Request;
                var cCIRPIR = await uploadController.PostFileWithData("ccirpirFormData", "CCIRPIR");

                if (cCIRPIR != null && uploadController.ListofFiles != null && uploadController.ListofFiles.Count > 0)
                {
                    cCIRPIR.UpdateFileProperties(cCIRPIR.GetType().GetProperties().Where(p => properties.Contains(p.Name)).ToArray(), this.Request, uploadController.ListofFiles);
                }

                return(cCIRPIR);
            }
        }
Ejemplo n.º 4
0
        private async Task <Personnel> UpdateDataWithFile()
        {
            using (var uploadController = new UploadController <Personnel>())
            {
                uploadController.ControllerContext = this.ControllerContext;
                uploadController.Request           = this.Request;
                var personnel = await uploadController.PostFileWithData("personnelFormData", "Personnel");

                if (personnel != null && uploadController.ListofFiles != null && uploadController.ListofFiles.Count > 0)
                {
                    personnel.UpdateFileProperties(personnel.GetType().GetProperties().Where(p => properties.Contains(p.Name)).ToArray(), this.Request, uploadController.ListofFiles);
                    //personnel.PersonnelPhoto = Path.GetFileName(uploadController.ListofFiles.GetDictionaryValue("PersonnelPhoto", personnel.PersonnelPhoto));
                    //personnel.OrganizationLogo = Path.GetFileName(uploadController.ListofFiles.GetDictionaryValue("OrganizationLogo", personnel.OrganizationLogo));
                    //personnel.Datasheet = Path.GetFileName(uploadController.ListofFiles.GetDictionaryValue("Datasheet", personnel.Datasheet));
                }

                return(personnel);
            }
        }
        public async Task <Location> UpdateDataWithFile()
        {
            using (var uploadController = new UploadController <Location>())
            {
                uploadController.ControllerContext = this.ControllerContext;
                uploadController.Request           = this.Request;
                var location = await uploadController.PostFileWithData("locationFormData", "Location");

                if (location != null && uploadController.ListofFiles != null && uploadController.ListofFiles.Count > 0)
                {
                    location.UpdateFileProperties(location.GetType().GetProperties().Where(p => properties.Contains(p.Name)).ToArray(), this.Request, uploadController.ListofFiles);
                    //location.LocationPhoto = Path.GetFileName(controller.ListofFiles.GetDictionaryValue("locationPhotoFile", location.LocationPhoto));
                    //location.LocationMapImage = Path.GetFileName(controller.ListofFiles.GetDictionaryValue("locationMapFile", location.LocationMapImage));
                    //location.LocationDocument = Path.GetFileName(controller.ListofFiles.GetDictionaryValue("locationDocumentFile", location.LocationDocument));
                    //location.KML = Path.GetFileName(controller.ListofFiles.GetDictionaryValue("locationKMLFile", location.KML));
                }

                return(location);
            }
        }