Пример #1
0
 public bool DeleteFDP(FDP fdp)
 {
     if (fdp == null) return false;
     _unitOfWork.FDPRepository.Delete(fdp);
     _unitOfWork.Save();
     return true;
 }
Пример #2
0
 public static FDP BindFDP(FDPViewModel fdpViewModel, FDP fdp = null)
 {
     return fdp ?? new FDP()
     {
         FDPID = fdpViewModel.FDPID,
         Name = fdpViewModel.Name,
         NameAM = fdpViewModel.NameAM,
         AdminUnitID = fdpViewModel.AdminUnitID,
         //FDPLocation = DbGeography.FromText("POINT(47.605049 48.605049)"),
         //FDPLocation = DbGeography.FromText("POINT("+fdpViewModel.longitude.ToString()+" "+fdpViewModel.latitiude+")")
         Latitude = fdpViewModel.latitude,
         Longitude = fdpViewModel.longitude
     };
 }
Пример #3
0
        public static FDPViewModel BindFDPViewModel(FDP fdp)
        {
            return new FDPViewModel()
            {
                FDPID = fdp.FDPID,
                Name = fdp.Name,
                NameAM = fdp.NameAM,
                AdminUnitID = fdp.AdminUnitID,
                AdminUnit = fdp.AdminUnit.Name,
                //latitiude = fdp.FDPLocation!=null?fdp.FDPLocation.Latitude:0.0,
                //longitude = fdp.FDPLocation!=null?fdp.FDPLocation.Longitude: 0.0
                latitude = fdp.Latitude,
                longitude = fdp.Longitude

            };
        }
Пример #4
0
 public bool EditFDP(FDP fdp)
 {
     _unitOfWork.FDPRepository.Edit(fdp);
     _unitOfWork.Save();
     return true;
 }
Пример #5
0
 public bool AddFDP(FDP fdp)
 {
     _unitOfWork.FDPRepository.Add(fdp);
     _unitOfWork.Save();
     return true;
 }