public void CreateMissingPerson(
            string firstName,
            string lastName,
            Gender gender,
            DateTime dateOfBirth,
            string placeOfBirth,
            DateTime dateOfDisappearance,
            string placeOfDisappearance,
            double height,
            double weight,
            Color hairColor,
            Color eyesColor,
            string pictureUrl,
            IEnumerable <int> nationalitiesIds,
            IEnumerable <int> languagesIds,
            string allNames,
            string scarsOrDistinguishingMarks)
        {
            this.ValidateMissingPeopleData(firstName, lastName, gender, dateOfBirth, placeOfBirth, dateOfDisappearance, placeOfDisappearance, height, weight, hairColor, eyesColor, pictureUrl, nationalitiesIds, languagesIds);

            var physicalDescription = new PhysicalDescription
            {
                Height     = height,
                Weight     = weight,
                HairColor  = hairColor,
                EyeColor   = eyesColor,
                PictureUrl = pictureUrl,
                ScarsOrDistinguishingMarks = scarsOrDistinguishingMarks
            };

            var missingPerson = new IdentityParticularsMissing
            {
                FirstName            = firstName,
                LastName             = lastName,
                Gender               = gender,
                DateOfBirth          = dateOfBirth,
                PlaceOfBirth         = placeOfBirth,
                DateOfDisappearance  = dateOfDisappearance,
                PlaceOfDisappearance = placeOfDisappearance,
                AllNames             = allNames,
                PhysicalDescription  = physicalDescription
            };

            // add the nationalities and languages to the person
            AddLanguagesAndCountriesCollections(nationalitiesIds, languagesIds, missingPerson);

            this.db.IdentityParticularsMissing.Add(missingPerson);
            this.db.SaveChanges();
        }
示例#2
0
        public async Task <int> SavePhysicalDescription(PhysicalDescription physicalDescription)
        {
            if (physicalDescription.Id != 0)
            {
                _context.PhysicalDescriptions.Update(physicalDescription);

                await _context.SaveChangesAsync();

                return(physicalDescription.Id);
            }
            else
            {
                await _context.PhysicalDescriptions.AddAsync(physicalDescription);

                await _context.SaveChangesAsync();

                return(physicalDescription.Id);
            }
        }
        public void CreateWantedPerson(
            string firstName,
            string lastName,
            Gender gender,
            DateTime dateOfBirth,
            string placeOfBirth,
            decimal reward,
            double height,
            double weight,
            Color hairColor,
            Color eyesColor,
            string pictureUrl,
            IEnumerable <int> nationalitiesIds,
            IEnumerable <int> languagesIds,
            string allNames = null,
            string scarsOrDistinguishingMarks = null)
        {
            this.ValidateWantedPeopleData(firstName, lastName, gender, dateOfBirth, placeOfBirth, height, weight, hairColor, eyesColor, pictureUrl, nationalitiesIds, languagesIds, reward);

            var physicalDescription = new PhysicalDescription
            {
                Height     = height,
                Weight     = weight,
                HairColor  = hairColor,
                EyeColor   = eyesColor,
                PictureUrl = pictureUrl,
                ScarsOrDistinguishingMarks = scarsOrDistinguishingMarks
            };

            var wantedPerson = new IdentityParticularsWanted
            {
                FirstName           = firstName,
                LastName            = lastName,
                Gender              = gender,
                DateOfBirth         = dateOfBirth,
                PlaceOfBirth        = placeOfBirth,
                AllNames            = allNames,
                PhysicalDescription = physicalDescription,
                Reward              = reward
            };

            foreach (var nationalityId in nationalitiesIds)
            {
                var countriesNationalities = new CountriesNationalitiesWanted
                {
                    CountryId = nationalityId,
                    IdentityParticularsWantedId = wantedPerson.Id
                };

                wantedPerson.Nationalities.Add(countriesNationalities);
            }

            foreach (var languageId in languagesIds)
            {
                var languageMissing = new LanguagesWanted
                {
                    LanguageId = languageId,
                    IdentityParticularsWantedId = wantedPerson.Id
                };

                wantedPerson.SpokenLanguages.Add(languageMissing);
            }

            this.db.IdentityParticularsWanted.Add(wantedPerson);
            this.db.SaveChanges();
        }
示例#4
0
        static void Main(string[] args)
        {
            #region PortTest
            var port    = new ComponentPort();
            var feature = new MechanicalElectricalFeature();
            port.Mechanical = new Mechanical();
            //port.Mechanical.Feature.Add(feature);
            #endregion

            #region Device


            ((SkillParameter <CartesianCoSy>)robot.Skills.GetSkill <SkillMoveBase>().GetParameter("TargetPose", Direction.Input)).Value = new CartesianCoSy()
            {
                Unit = "mm"
            };

            IDevice             retainer             = new DeviceBase();
            IDeviceCompletement retainerCompletement = new RetainingCylinder._384252240Completement();
            retainer = retainerCompletement.CompleteDeviceDriver(ref retainer);
            retainer.Identification.SerialNumber = "1";
            retainer.PresentationData.BrowseName = "Retainer";
            IDevice             robot             = new DeviceBase();
            IDeviceCompletement robotCompletement = new Mh5FCompletement();
            robot = robotCompletement.CompleteDeviceDriver(ref robot);
            robot.Identification.SerialNumber = "R145455863";

            #endregion

            #region opc
            OpcUaServer            server      = new OpcUaServer();
            OpcUaStartupParameters opcUaParams = new OpcUaStartupParameters()
            {
                RootNodeName = robot.PresentationData.BrowseName,
            };

            OpcUaServer            server2      = new OpcUaServer();
            OpcUaStartupParameters opcUaParams2 = new OpcUaStartupParameters()
            {
                RootNodeName      = retainer.PresentationData.BrowseName,
                IgnoreNullPointer = false
            };
            var physDescr = new PhysicalDescription()
            {
                Pose = new CartesianCoSy()
            };
            ((SkillParameter <IComponent>)retainer.Skills.FirstOrDefault().Parameters.First(x => x.Name == "Material" && x.Direction == Direction.Input)).Value = new Akomi.InformationModel.Product.ProductBase()
            {
                PhysicalDescription = physDescr
            };
            ((SkillParameter <IComponent>)robot.Skills.FirstOrDefault().Parameters.First(x => x.Name == "Material" && x.Direction == Direction.Input)).Value = new Akomi.InformationModel.Product.ProductBase()
            {
                PhysicalDescription = physDescr
            };
            //opcUaParams.CurrentDepth = 0;
            //opcUaParams.MaximumDepth = 3000;

            // It's more comfortable to use only OpcUaStartupParameters for server configuration and try to add missing options in it on demand
            //opcUaParams.TryUseAppConfigFile = false; // If this is true "AkomiServer.dll.config" properties will be used for server specifications
            //opcUaParams.UserCanSearchForConfigurationFile = false;
            opcUaParams.Ports  = new[] { 48060 };
            opcUaParams2.Ports = new[] { 48061 };
            #endregion
            //opcUaParams.InheritedObjectSimplification = new List<Type>() { typeof(IDevice) };
            server.StartServer(robot, opcUaParams);
            server2.StartServer(retainer, opcUaParams2);

            Console.WriteLine("press any Key to exit ...");
            Console.ReadKey();
        }
        //[AllowAnonymous]
        public async Task <IActionResult> SaveGDManInformation([FromBody] GDManInformationViewModel model)
        {
            //return Ok("Success");
            try
            {
                var user = await _userManager.FindByNameAsync(model.userName);

                string        gdNumber      = RandomString(6);
                GDInformation gDInformation = new GDInformation
                {
                    ApplicationUserId   = user.Id,
                    gdFor               = model.gdFor,
                    gdDate              = DateTime.Now,
                    gdNumber            = gdNumber,
                    gDTypeId            = model.gDTypeId,
                    productTypeId       = model.productTypeId,
                    documentTypeId      = model.documentTypeId == 0 ? null : model.documentTypeId,
                    documentDescription = model.documentDescription,
                    statusId            = 1
                };

                int gdId = await lostAndFoundService.SaveGDInformation(gDInformation);


                ManInformation manInformation = new ManInformation
                {
                    gDInformationId        = gdId,
                    relationTypeId         = model.relationTypeId,
                    name                   = model.name,
                    aproxAge               = model.aproxAge,
                    agePeriodId            = model.agePeriodId,
                    genderId               = model.genderId,
                    isHealthDisabled       = model.isHealthDisabled,
                    fatherName             = model.fatherName,
                    motherName             = model.motherName,
                    spouseName             = model.spouseName,
                    nationalIdentityTypeId = model.manNationalIdentityTypeId,
                    identityNo             = model.identityNo,
                    numberTypeId           = model.numberTypeId,
                    number                 = model.number
                };

                int manid = await lostAndFoundService.SaveManInformation(manInformation);

                if (model.gdFor == "OTHERS")
                {
                    OtherPersonInformation otherPerson = new OtherPersonInformation
                    {
                        gDInformationId        = gdId,
                        nationalIdentityTypeId = model.nationalIdentityTypeId == 0 ? null : model.nationalIdentityTypeId,
                        identityNo             = model.identityNo,
                        mobileNo = model.mobileNo
                    };
                    int opi = await lostAndFoundService.SaveOtherPersonInformation(otherPerson);
                }

                IndentifyInfo indentifyInfo = new IndentifyInfo
                {
                    gDInformationId           = gdId,
                    colorsId                  = model.colorsId,
                    identifySign              = model.identifySign,
                    descriptionCircumcisionId = model.descriptionCircumcisionId,
                    religionId                = model.religionId,
                    bloodGroup                = model.bloodGroup,
                    occupationId              = model.occupationId,
                    maritalStatusId           = model.maritalStatusId
                };
                int identityid = await lostAndFoundService.SaveIndentifyInfo(indentifyInfo);

                AddressInformation addressInformation = new AddressInformation
                {
                    districtId     = model.manDistrictId,
                    thanaId        = model.thanaId,
                    houseVillage   = model.postOffice,
                    addressDetails = model.addressDetails,
                    type           = model.addressType,
                    oneLineAddress = model.oneLineAddress,
                };
                int addressId = await addressInformationService.SaveAddressInformation(addressInformation);

                PhysicalDescription physical = new PhysicalDescription
                {
                    manInformationId                   = manid,
                    eyeTypeId                          = model.eyeTypeId,
                    noseTypeId                         = model.noseTypeId,
                    hairTypeId                         = model.hairTypeId,
                    foreHeadTypeId                     = model.foreHeadTypeId,
                    beardTypeId                        = model.beardTypeId,
                    weight                             = model.weight,
                    bodyStructureId                    = model.bodyStructureId,
                    faceShapeTypeId                    = model.faceShapeTypeId,
                    bodyChinTypeId                     = model.bodyChinTypeId,
                    bodyColorId                        = model.bodyColorId,
                    moustacheTypeId                    = model.moustacheTypeId,
                    earTypeId                          = model.earTypeId,
                    neckTypeId                         = model.neckTypeId,
                    heightFeet                         = model.heightFeet,
                    heightInch                         = model.heightInch,
                    specialBirthMarkTypeId             = model.specialBirthMarkTypeId,
                    specialBirthMarkBodyPartId         = model.specialBirthMarkBodyPartId,
                    specialBirthMarkBodyPartPositionId = model.specialBirthMarkBodyPartPositionId,
                    visibleTatto                       = model.visibleTatto,
                    otherIdentityfyMark                = model.otherIdentityfyMark,
                    teethTypeId                        = model.teethTypeId,
                    specialBodyConditionId             = model.specialBodyConditionId,
                };
                int phyId = await lostAndFoundService.SavePhysicalDescription(physical);

                DressDescription dress = new DressDescription
                {
                    manInformationId   = manid,
                    inTheHeadId        = model.inTheHeadId,
                    inTheHeadColorId   = model.inTheHeadColorId,
                    inTheBodyId        = model.inTheBodyId,
                    inTheBodyColorId   = model.inTheBodyColorId,
                    inTheThroatId      = model.inTheThroatId,
                    inTheThroatColorId = model.inTheThroatColorId,
                    inTheWaistId       = model.inTheWaistId,
                    inTheWaistColorId  = model.inTheWaistColorId,
                    inTheLegsId        = model.inTheLegsId,
                    inTheLegsColorId   = model.inTheLegsColorId,
                    inTheEyeId         = model.inTheEyeId,
                    inTheEyeColorId    = model.inTheEyeColorId,
                    shoesSize          = model.shoesSize,
                    shoesSizeType      = model.shoesSizeType,
                };
                int dressId = await lostAndFoundService.SaveDressDescription(dress);

                SpaceAndTime spaceAndTime = new SpaceAndTime
                {
                    gDInformationId = gdId,
                    placeDetails    = model.placeDetails,
                    lafDate         = model.lafDate,
                    lafTime         = model.lafTime,
                    postOfficeId    = model.postOfficeId,
                    thanaId         = model.thanaId,
                    districtId      = model.districtId,
                    divisionId      = model.divisionId
                };
                int sdid = await lostAndFoundService.SaveSpaceAndTime(spaceAndTime);


                if (model.dNAProfileViewModels != null)
                {
                    List <DNAProfileDetails> lstDNAProfile = new List <DNAProfileDetails>();
                    foreach (var item in model.dNAProfileViewModels)
                    {
                        DNAProfileDetails dNAProfileDetails = new DNAProfileDetails
                        {
                            manInformationId = manid,
                            locous           = item.locous,
                            genotype1        = item.genotype1,
                            genotype2        = item.genotype2
                        };
                        lstDNAProfile.Add(dNAProfileDetails);
                    }

                    int dnaId = await lostAndFoundService.SaveDNAProfileDetails(lstDNAProfile);
                }

                return(Ok(gdNumber));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }