public bool DeleteFDP(FDP fdp) { if (fdp == null) return false; _unitOfWork.FDPRepository.Delete(fdp); _unitOfWork.Save(); return true; }
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 }; }
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 }; }
public bool EditFDP(FDP fdp) { _unitOfWork.FDPRepository.Edit(fdp); _unitOfWork.Save(); return true; }
public bool AddFDP(FDP fdp) { _unitOfWork.FDPRepository.Add(fdp); _unitOfWork.Save(); return true; }