Ejemplo n.º 1
0
 private PhysicalInformation SetCreateUpdatePhysicalInformation(PhysicalInformation physicalInfo, PhysicalInformationArg physicalInfoArg, string personId, string userLoginId)
 {
     if (physicalInfo == null)
     {
         physicalInfo             = _mapper.Map <PhysicalInformation>(physicalInfoArg);
         physicalInfo.PersonId    = personId;
         physicalInfo.UserLoginId = userLoginId;
         physicalInfo.BmI         = UtilityMethods.CalculateBmI(physicalInfo.Height, physicalInfo.Weight);
         PhysicalInformation().Add(physicalInfo);
     }
     else
     {
         physicalInfo.Bust         = physicalInfoArg.Bust;
         physicalInfo.Complexion   = physicalInfoArg.Complexion;
         physicalInfo.DressSize    = physicalInfoArg.DressSize;
         physicalInfo.ShoeSize     = physicalInfoArg.ShoeSize;
         physicalInfo.EyeColor     = physicalInfoArg.EyeColor;
         physicalInfo.HairColor    = physicalInfoArg.HairColor;
         physicalInfo.Height       = physicalInfoArg.Height;
         physicalInfo.HeightEnumId = physicalInfoArg.HeightEnumId;
         physicalInfo.Hip          = physicalInfoArg.Hip;
         physicalInfo.Waist        = physicalInfoArg.Waist;
         physicalInfo.Weight       = physicalInfoArg.Weight;
         physicalInfo.BmI          = UtilityMethods.CalculateBmI(physicalInfo.Height, physicalInfo.Weight);
         physicalInfo.WeightEnumId = physicalInfoArg.WeightEnumId;
         physicalInfo.UserLoginId  = userLoginId;
         PhysicalInformation().UpdateEntity(physicalInfo);
     }
     return(physicalInfo);
 }