Ejemplo n.º 1
0
        public JsonResult GetAllInformationContent()
        {
            InfrastructureModel <List <InformationContentSingleDataModel> > response = new InfrastructureModel <List <InformationContentSingleDataModel> >();
            List <InformationContentSingleDataModel> resultModel = new List <InformationContentSingleDataModel>();

            try
            {
                List <InformationContent> informationContextList = informationContentOperation.GetAllInformationContent();


                foreach (var info in informationContextList)
                {
                    resultModel.Add(new InformationContentSingleDataModel()
                    {
                        AuthorFullName = info.Author != null?info.Author.Name + " " + info.Author.Surname:string.Empty,
                        CategoryName   = info.Category != null?info.Category.Name:string.Empty,
                        Explanation    = info.Explanation,
                        ImagePath      = info.PostImagePath,
                        LikeCount      = info.LikeCount.ToString(),
                        Title          = info.Title
                    });
                }

                response.ResultStatus = true;
                response.ResultModel  = resultModel;
            }
            catch (Exception ex)
            {
                response.ResultStatus = false;
                throw ex;
            }
            return(new JsonResult(response));
        }
        public void InfrastructureLanguageService_FillInfrastructureLanguage_Test()
        {
            foreach (CultureInfo culture in setupData.cultureListGood)
            {
                SetupTest(contactModelListGood[0], culture);

                using (TransactionScope ts = new TransactionScope())
                {
                    InfrastructureModel infrastructureModelRet = infrastructureServiceTest.AddInfrastructureModel();
                    Assert.AreEqual("", infrastructureModelRet.Error);

                    infrastructureLanguageModelNew.InfrastructureID = infrastructureModelRet.InfrastructureID;
                    FillInfrastructureLanguageModel(infrastructureLanguageModelNew);

                    ContactOK contactOK = infrastructureLanguageService.IsContactOK();

                    string retStr = infrastructureLanguageService.FillInfrastructureLanguage(infrastructureLanguage, infrastructureLanguageModelNew, contactOK);
                    Assert.AreEqual("", retStr);
                    Assert.AreEqual(contactOK.ContactTVItemID, infrastructureLanguage.LastUpdateContactTVItemID);

                    contactOK = null;

                    retStr = infrastructureLanguageService.FillInfrastructureLanguage(infrastructureLanguage, infrastructureLanguageModelNew, contactOK);
                    Assert.AreEqual("", retStr);
                    Assert.AreEqual(2, infrastructureLanguage.LastUpdateContactTVItemID);
                }
            }
        }
        private InfrastructureLanguageModel AddInfrastructureLanguageModel(LanguageEnum LangToAdd)
        {
            InfrastructureModel infrastructureModel = infrastructureServiceTest.AddInfrastructureModel();

            if (!string.IsNullOrWhiteSpace(infrastructureModel.Error))
            {
                return(new InfrastructureLanguageModel()
                {
                    Error = infrastructureModel.Error
                });
            }

            infrastructureLanguageModelNew.InfrastructureID = infrastructureModel.InfrastructureID;
            FillInfrastructureLanguageModel(infrastructureLanguageModelNew);

            InfrastructureLanguageModel infrastructureLanguagModelRet = infrastructureLanguageService.PostAddInfrastructureLanguageDB(infrastructureLanguageModelNew);

            if (!string.IsNullOrWhiteSpace(infrastructureLanguagModelRet.Error))
            {
                return(infrastructureLanguagModelRet);
            }

            CompareInfrastructureLanguageModels(infrastructureLanguageModelNew, infrastructureLanguagModelRet);

            return(infrastructureLanguagModelRet);
        }
Ejemplo n.º 4
0
        public JsonResult ChangePassword(AppUserLoginModel appUserLoginModel)
        {
            Response <bool> response = new Response <bool>();

            appUserProvider = new AppUserProvider();

            AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session);

            if (appUserModel != null)
            {
                AppUserModel appUserTokenModel = SessionExtension.GetSessionUser(HttpContext.Session);

                appUserLoginModel.TokenKey  = appUserModel.TokenKey;
                appUserLoginModel.AppUserId = appUserModel.AppUser.AppUserId;

                InfrastructureModel <bool> infrastructureModel = appUserProvider.ChangePassword(appUserLoginModel);

                response = new Response <bool>()
                {
                    Data    = infrastructureModel.ResultModel,
                    Message = infrastructureModel.Message,
                    Status  = true,
                    Refresh = true
                };
            }
            return(Json(response));
        }
Ejemplo n.º 5
0
        public InfrastructureModel <bool> Update(AppUserInformationModel appUserInformationModel)
        {
            InfrastructureModel <bool> infrastructureModel = new InfrastructureModel <bool>();

            using (HttpClient client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", appUserInformationModel.TokenKey);
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json charset=utf-8");
                client.DefaultRequestHeaders.Accept.Clear();

                var serializePostModel = JsonConvert.SerializeObject(appUserInformationModel);

                StringContent       contentPost         = new StringContent(serializePostModel, Encoding.UTF8, "application/json");
                HttpResponseMessage httpResponceMessage = client.PostAsync(ConnectionHelper.GetConnectionUrl() + "AppUser/Update/", contentPost).Result;

                httpResponceMessage.EnsureSuccessStatusCode();

                string stringResponce = httpResponceMessage.Content.ReadAsStringAsync().Result;

                infrastructureModel = JsonConvert.DeserializeObject <InfrastructureModel <bool> >(stringResponce);

                if (infrastructureModel.ResultModel)
                {
                    infrastructureModel.ResultStatus = true;
                }
                return(infrastructureModel);
            }
        }
Ejemplo n.º 6
0
        public JsonResult UpdateAppUserInformation(AppUserInformationModel appUserInformationModel)
        {
            Response <bool> response = new Response <bool>();

            appUserProvider = new AppUserProvider();

            AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session);

            if (appUserModel != null)
            {
                AppUserModel appUserTokenModel = SessionExtension.GetSessionUser(HttpContext.Session);

                appUserInformationModel.TokenKey = appUserModel.TokenKey;

                appUserInformationModel.AppUserId = appUserModel.AppUser.AppUserId;

                InfrastructureModel <bool> infrastructureModel = appUserProvider.Update(appUserInformationModel);

                response = new Response <bool>
                {
                    Data    = infrastructureModel.ResultStatus,
                    Message = "success",
                    Status  = infrastructureModel.ResultStatus,
                };
            }
            return(Json(response));
        }
Ejemplo n.º 7
0
        public IActionResult UpdatePassword([FromBody] AppUserLoginModel appUserLoginModel)
        {
            InfrastructureModel <bool> infrastructureModel = new InfrastructureModel <bool>();

            var appUser = appUserOperation.GetById(appUserLoginModel.AppUserId);

            if (appUser != null)
            {
                if (appUser.Password == appUserLoginModel.NowPassword)
                {
                    if (appUserLoginModel.Password == appUserLoginModel.RePassword)
                    {
                        appUser.Password = appUserLoginModel.Password;

                        infrastructureModel.Message = "Şifre Değiştirildi";

                        appUserOperation.Update(appUser);
                    }
                    else
                    {
                        infrastructureModel.Message = "Şifreler Eşleşmiyor Veya Eski Şifreniz Yanlış";
                    }
                }
                else
                {
                    infrastructureModel.Message = "Şuanki Şifreniz Yanlış";
                }

                infrastructureModel.ResultModel  = true;
                infrastructureModel.ResultStatus = true;
            }

            return(Json(infrastructureModel));
        }
Ejemplo n.º 8
0
        public PartialViewResult _addressEditInfrastructure(int InfrastructureTVItemID)
        {
            ViewBag.AddressModel = null;
            TVItemModel tvItemModel = _TVItemService.GetTVItemModelWithTVItemIDDB(InfrastructureTVItemID);

            ViewBag.TVItemModel = tvItemModel;

            InfrastructureModel infrastructureModel = _InfrastructureService.GetInfrastructureModelWithInfrastructureTVItemIDDB(InfrastructureTVItemID);

            ViewBag.InfrastructureModel = infrastructureModel;

            if (infrastructureModel.CivicAddressTVItemID != null)
            {
                AddressModel addressModel = _AddressService.GetAddressModelWithAddressTVItemIDDB((int)infrastructureModel.CivicAddressTVItemID);
                if (string.IsNullOrWhiteSpace(addressModel.Error))
                {
                    ViewBag.AddressModel = addressModel;
                }
            }

            ViewBag.AddressController = _AddressController;
            ViewBag.AddressService    = _AddressService;

            return(PartialView());
        }
Ejemplo n.º 9
0
        public JsonResult GetJsonPost()
        {
            informationContentProvider = new InformationContentProvider();
            tokenProvider = new TokenProvider();
            string token = string.Empty;
            InfrastructureModel <InformationContentSingleDataModel> infrastructureModel = new InfrastructureModel <InformationContentSingleDataModel>();

            if (SessionExtension.GetSessionUser(HttpContext.Session) == null)
            {
                token = tokenProvider.GetAnonimToken();
                SessionExtension.Set(HttpContext.Session, "FreeToken", token);
                infrastructureModel = informationContentProvider.GetInformationContentSingleData(new InformationContentPostModel()
                {
                    TokenKey = token
                });
            }
            else
            {
                AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session);
                if (appUserModel != null)
                {
                    token = appUserModel.TokenKey;

                    infrastructureModel = informationContentProvider.GetInformationContentSingleData(new InformationContentPostModel()
                    {
                        AppUserId = appUserModel.AppUser.AppUserId, TokenKey = token
                    });
                }
            }
            return(Json(infrastructureModel));
        }
Ejemplo n.º 10
0
        public CategoryPage()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            CategoryProvider categoryOperation = new CategoryProvider();

            StackLayout stacklayout = new StackLayout();

            InfrastructureModel <List <Category> > data = categoryOperation.GetCategoryList(TokenAccesModel.accesValue);

            foreach (var category in data.ResultModel)
            {
                Button btnCategoryLink = new Button()
                {
                    Text        = category.Name,
                    ImageSource = category.CategoryImagePath,
                    ClassId     = category.CategoryId.ToString()
                };
                btnCategoryLink.Clicked += BtnCategoryLink_Clicked;
                stacklayout.Children.Add(btnCategoryLink);
            }

            this.Content = stacklayout;
        }
        public MainPageCategory(int categoryId = 0)
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);
            categoryglobalId = categoryId;
            InformationContentProvider informationContentProvider = new InformationContentProvider();

            //Todo:Dön burada appuserId yok
            InformationContentPostModel postModel = new InformationContentPostModel()
            {
                TokenKey   = TokenAccesModel.accesValue,
                CategoryId = categoryId,
                AppUserId  = 0
            };
            ///sayfaya yönlendir devam et

            InfrastructureModel <InformationContentSingleDataModel> informationContentSingleDataModelList = new InfrastructureModel <InformationContentSingleDataModel>();

            informationContentSingleDataModelList = informationContentProvider.GetInformationCategoryContentSingleData(postModel);

            lblExplanation.Text = informationContentSingleDataModelList.ResultModel.Explanation;
            lblTitle.Text       = informationContentSingleDataModelList.ResultModel.Title;
            imgContent.Source   = informationContentSingleDataModelList.ResultModel.ImagePath;

            btnChangeSingleData.Clicked += BtnChangeSingleData_Clicked;
        }
Ejemplo n.º 12
0
        public JsonResult GetCategorySingleContent(InformationContentPostModel model)
        {
            try
            {
                InfrastructureModel <InformationContentSingleDataModel> response = new InfrastructureModel <InformationContentSingleDataModel>();
                InformationContentSingleDataModel resultModel = new InformationContentSingleDataModel();
                try
                {
                    InformationContent informationContext = informationContentOperation.GetCategorySingleInformationContent(model.AppUserId, model.CategoryId);
                    resultModel.AuthorFullName = informationContext.Author.Name + " " + informationContext.Author.Surname;
                    resultModel.Explanation    = informationContext.Explanation;
                    resultModel.ImagePath      = informationContext.PostImagePath;
                    resultModel.LikeCount      = informationContext.LikeCount.ToString();
                    resultModel.Title          = informationContext.Title;

                    response.ResultModel  = resultModel;
                    response.ResultStatus = true;
                }
                catch (Exception ex)
                {
                    response.ResultStatus = false;
                    throw ex;
                }
                return(new JsonResult(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 13
0
        public void InfrastructureController_SetInfrastructureChildParentJSON_Test()
        {
            controllerAction = "_infrastructureInfo";

            foreach (CultureInfo culture in setupData.cultureListGood)
            {
                SetupTest(contactModelListGood[0], culture, controllerAction);

                using (TransactionScope ts = new TransactionScope())
                {
                    TVItemModel tvItemModelSubsector = randomService.RandomTVItem(TVTypeEnum.Subsector);

                    Assert.AreEqual("", tvItemModelSubsector.Error);

                    TVItemModel tvItemModelMunicipality = tvItemService.PostAddChildTVItemDB(tvItemModelSubsector.TVItemID, "Unique Municipality Name", TVTypeEnum.Municipality);

                    Assert.AreEqual("", tvItemModelMunicipality.Error);

                    TVItemModel tvItemModelInfrastructure = tvItemService.PostAddChildTVItemDB(tvItemModelMunicipality.TVItemID, randomService.RandomString("Infra ", 20), TVTypeEnum.Infrastructure);

                    Assert.AreEqual("", tvItemModelInfrastructure.Error);

                    InfrastructureModel infrastructureModelNew = new InfrastructureModel();
                    infrastructureModelNew.InfrastructureTVItemID = tvItemModelInfrastructure.TVItemID;
                    infrastructureModelNew.InfrastructureTVText   = tvItemModelInfrastructure.TVText;
                    FillInfrastructureModel(infrastructureModelNew);

                    InfrastructureModel infrastructureModelRet = infrastructureService.PostAddInfrastructureDB(infrastructureModelNew);

                    Assert.AreEqual("", infrastructureModelRet.Error);

                    TVItemModel tvItemModelInfrastructure2 = tvItemService.PostAddChildTVItemDB(tvItemModelMunicipality.TVItemID, randomService.RandomString("Infra ", 20), TVTypeEnum.Infrastructure);

                    Assert.AreEqual("", tvItemModelInfrastructure2.Error);

                    InfrastructureModel infrastructureModelNew2 = new InfrastructureModel();
                    infrastructureModelNew2.InfrastructureTVItemID = tvItemModelInfrastructure2.TVItemID;
                    infrastructureModelNew2.InfrastructureTVText   = tvItemModelInfrastructure2.TVText;
                    FillInfrastructureModel(infrastructureModelNew2);

                    InfrastructureModel infrastructureModelRet2 = infrastructureService.PostAddInfrastructureDB(infrastructureModelNew2);

                    // Assert
                    Assert.AreEqual("", infrastructureModelRet2.Error);

                    JsonResult jsonResult = controller.SetInfrastructureChildParentJSON(infrastructureModelRet.InfrastructureTVItemID, infrastructureModelRet2.InfrastructureTVItemID) as JsonResult;

                    string retStr = (string)jsonResult.Data;
                    Assert.AreEqual("", retStr);

                    TVItemLinkModel tvItemLinkModelRet = tvItemLinkService.GetTVItemLinkModelWithFromTVItemIDAndToTVItemIDDB(infrastructureModelRet.InfrastructureTVItemID, infrastructureModelRet2.InfrastructureTVItemID);

                    // Assert
                    Assert.AreEqual("", tvItemLinkModelRet.Error);
                    Assert.AreEqual(infrastructureModelRet.InfrastructureTVItemID, tvItemLinkModelRet.FromTVItemID);
                    Assert.AreEqual(infrastructureModelRet2.InfrastructureTVItemID, tvItemLinkModelRet.ToTVItemID);
                }
            }
        }
        public IActionResult Index()
        {
            informationContentProvider = new InformationContentProvider();

            InfrastructureModel <List <InformationContentSingleDataModel> > infrastructureModelList = informationContentProvider.GetListInformationContent(SessionExtension.GetSessionUserTokeyKey(HttpContext.Session));

            return(View(infrastructureModelList));
        }
        public IActionResult Insert()
        {
            InformationContentCRUDModel informationContentCRUDModel = new InformationContentCRUDModel();

            categoryProvider = new CategoryProvider();

            InfrastructureModel <List <Category> > infrastructerCategoryList = categoryProvider.GetCategoryList(SessionExtension.GetSessionUserTokeyKey(HttpContext.Session));

            informationContentCRUDModel.CategoryList = new SelectList(infrastructerCategoryList.ResultModel, "CategoryId", "Name");

            return(View(informationContentCRUDModel));
        }
        public PartialViewResult _infrastructureEditAll(int InfrastructureTVItemID)
        {
            ViewBag.AddressModel = null;

            InfrastructureModel infrastructureModel = _InfrastructureService.GetInfrastructureModelWithInfrastructureTVItemIDDB(InfrastructureTVItemID);

            ViewBag.InfrastructureModel = infrastructureModel;


            if (infrastructureModel.CivicAddressTVItemID != null)
            {
                AddressModel addressModel = _AddressService.GetAddressModelWithAddressTVItemIDDB((int)infrastructureModel.CivicAddressTVItemID);

                ViewBag.AddressModel = addressModel;
            }

            MapInfoPointModel mapInfoPointModelInfrastructure = new MapInfoPointModel();
            MapInfoPointModel mapInfoPointModelOutfall        = new MapInfoPointModel();

            if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.WWTP)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.WasteWaterTreatmentPlant, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }
            else if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.LiftStation)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.LiftStation, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }
            else if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.LineOverflow)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.LineOverflow, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }
            else if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.Other)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.OtherInfrastructure, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }
            else if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.SeeOtherMunicipality)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.SeeOtherMunicipality, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(InfrastructureTVItemID, TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }

            ViewBag.MapInfoPointModelInfrastructure = mapInfoPointModelInfrastructure;
            ViewBag.MapInfoPointModelOutfall        = mapInfoPointModelOutfall;

            ViewBag.InfrastructureController = _InfrastructureController;

            return(PartialView());
        }
Ejemplo n.º 17
0
        public void InfrastructureController__infrastructureList_Test()
        {
            controllerAction = "_infrastructureList";

            foreach (CultureInfo culture in setupData.cultureListGood)
            {
                SetupTest(contactModelListGood[0], culture, controllerAction);

                using (TransactionScope ts = new TransactionScope())
                {
                    TVItemModel tvItemModelSubsector = randomService.RandomTVItem(TVTypeEnum.Subsector);

                    Assert.AreEqual("", tvItemModelSubsector.Error);

                    TVItemModel tvItemModelMunicipality = tvItemService.PostAddChildTVItemDB(tvItemModelSubsector.TVItemID, "Unique Municipality Name", TVTypeEnum.Municipality);

                    Assert.AreEqual("", tvItemModelMunicipality.Error);

                    TVItemModel tvItemModelInfrastructure = tvItemService.PostAddChildTVItemDB(tvItemModelMunicipality.TVItemID, randomService.RandomString("Infra ", 20), TVTypeEnum.Infrastructure);

                    Assert.AreEqual("", tvItemModelInfrastructure.Error);

                    InfrastructureModel infrastructureModelNew = new InfrastructureModel();
                    infrastructureModelNew.InfrastructureTVItemID = tvItemModelInfrastructure.TVItemID;
                    infrastructureModelNew.InfrastructureTVText   = tvItemModelInfrastructure.TVText;
                    FillInfrastructureModel(infrastructureModelNew);

                    InfrastructureModel infrastructureModelRet = infrastructureService.PostAddInfrastructureDB(infrastructureModelNew);

                    Assert.AreEqual("", infrastructureModelRet.Error);

                    string            Q = "!View/" + tvItemModelMunicipality.TVText + "|||" + tvItemModelMunicipality.TVItemID;
                    PartialViewResult partialViewResult = controller._infrastructureList(Q) as PartialViewResult;

                    URLModel urlModel = (URLModel)partialViewResult.ViewBag.URLModel;
                    Assert.IsNotNull(partialViewResult);
                    Assert.AreEqual(2, urlModel.TVTextList.Count);
                    Assert.AreEqual("!View", urlModel.TVTextList[0]);
                    Assert.AreEqual(tvItemModelMunicipality.TVText, urlModel.TVTextList[1]);
                    Assert.AreEqual(1, urlModel.TVItemIDList.Count);
                    Assert.AreEqual(tvItemModelMunicipality.TVItemID, urlModel.TVItemIDList[0]);
                    Assert.AreEqual(StartVarShow, urlModel.VariableShow);

                    List <TVItemModelInfrastructureTypeTVItemLinkModel> tvItemModelInfrastructureTypeTVItemLinkModelList = (List <TVItemModelInfrastructureTypeTVItemLinkModel>)partialViewResult.ViewBag.TVItemModelInfrastructureTypeTVItemLinkModelList;
                    Assert.IsNotNull(tvItemModelInfrastructureTypeTVItemLinkModelList);
                    Assert.AreEqual(1, tvItemModelInfrastructureTypeTVItemLinkModelList.Count);
                    Assert.AreEqual(tvItemModelInfrastructure.TVPath, tvItemModelInfrastructureTypeTVItemLinkModelList[0].TVItemModel.TVPath);
                    Assert.AreEqual(tvItemModelInfrastructure.TVText, tvItemModelInfrastructureTypeTVItemLinkModelList[0].TVItemModel.TVText);
                }
            }
        }
Ejemplo n.º 18
0
        public JsonResult ResetAllInformationAppUser([FromBody] AppUserModel appUserModel)
        {
            InfrastructureModel <bool> infrastructureModel = new InfrastructureModel <bool>();

            var appUser = appUserOperation.GetById(appUserModel.AppUser.AppUserId);

            if (appUser != null)
            {
                InformationReadLogOperation = new InformationReadLogOperation(db);

                int counter = InformationReadLogOperation.RemoveAllAppUserLog(appUser.AppUserId);

                infrastructureModel.Message      = counter.ToString() + " Kayıt Silindi";
                infrastructureModel.ResultModel  = true;
                infrastructureModel.ResultStatus = true;
            }

            return(Json(infrastructureModel));
        }
Ejemplo n.º 19
0
        public InfrastructureModel <List <InformationContentSingleDataModel> > GetListInformationContent(string tokenKey)
        {
            InfrastructureModel <List <InformationContentSingleDataModel> > resultModel = new InfrastructureModel <List <InformationContentSingleDataModel> >();

            using (HttpClient client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenKey);
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json charset=utf-8");
                client.DefaultRequestHeaders.Accept.Clear();

                HttpResponseMessage httpResponceMessage = client.GetAsync(ConnectionHelper.GetConnectionUrl() + "Information/GetAllInformationContent/").Result;
                httpResponceMessage.EnsureSuccessStatusCode();

                string stringResponce = httpResponceMessage.Content.ReadAsStringAsync().Result;

                resultModel = JsonConvert.DeserializeObject <InfrastructureModel <List <InformationContentSingleDataModel> > >(stringResponce);
                return(resultModel);
            }
        }
        public PartialViewResult _infrastructureInfo(string Q)
        {
            SetArgs(Q);
            ViewBag.URLModel     = urlModel;
            ViewBag.AddressModel = null;

            InfrastructureModel infrastructureModel = _InfrastructureService.GetInfrastructureModelWithInfrastructureTVItemIDDB(urlModel.TVItemIDList[0]);

            ViewBag.InfrastructureModel = infrastructureModel;

            if (infrastructureModel.CivicAddressTVItemID != null)
            {
                AddressModel addressModel = _AddressService.GetAddressModelWithAddressTVItemIDDB((int)infrastructureModel.CivicAddressTVItemID);

                ViewBag.AddressModel = addressModel;
            }

            MapInfoPointModel mapInfoPointModelInfrastructure = new MapInfoPointModel();
            MapInfoPointModel mapInfoPointModelOutfall        = new MapInfoPointModel();

            if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.WWTP)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(urlModel.TVItemIDList[0], TVTypeEnum.WasteWaterTreatmentPlant, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(urlModel.TVItemIDList[0], TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }
            else if (infrastructureModel.InfrastructureType == InfrastructureTypeEnum.LiftStation)
            {
                mapInfoPointModelInfrastructure = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(urlModel.TVItemIDList[0], TVTypeEnum.LiftStation, MapInfoDrawTypeEnum.Point).FirstOrDefault();
                mapInfoPointModelOutfall        = _MapInfoPointService.GetMapInfoPointModelListWithTVItemIDAndTVTypeAndMapInfoDrawTypeDB(urlModel.TVItemIDList[0], TVTypeEnum.Outfall, MapInfoDrawTypeEnum.Point).FirstOrDefault();
            }

            ViewBag.MapInfoPointModelInfrastructure = mapInfoPointModelInfrastructure;
            ViewBag.MapInfoPointModelOutfall        = mapInfoPointModelOutfall;

            ViewBag.InfrastructureController = _InfrastructureController;

            ViewBag.IsShowMoreInfo = (GetURLVarShowEnumStr(URLVarShowEnum.ShowMoreInfo) == "0" ? false : true);
            ViewBag.IsShowMap      = (GetURLVarShowEnumStr(URLVarShowEnum.ShowMap) == "0" ? false : true);

            return(PartialView());
        }
        private async void BtnChangeSingleData_Clicked(object sender, EventArgs e)
        {
            InformationContentProvider informationContentProvider = new InformationContentProvider();

            //Todo:Dön burada appuserId yok
            InformationContentPostModel postModel = new InformationContentPostModel()
            {
                TokenKey   = TokenAccesModel.accesValue,
                CategoryId = categoryglobalId,
                AppUserId  = 0
            };
            ///sayfaya yönlendir devam et

            InfrastructureModel <InformationContentSingleDataModel> informationContentSingleDataModelList = new InfrastructureModel <InformationContentSingleDataModel>();

            informationContentSingleDataModelList = informationContentProvider.GetInformationCategoryContentSingleData(postModel);

            lblExplanation.Text = informationContentSingleDataModelList.ResultModel.Explanation;
            lblTitle.Text       = informationContentSingleDataModelList.ResultModel.Title;
            imgContent.Source   = informationContentSingleDataModelList.ResultModel.ImagePath;
        }
Ejemplo n.º 22
0
        public IActionResult GetById([FromBody] AppUserLoginModel appUserLoginModel)
        {
            InfrastructureModel <AppUserInformationModel> infrastructureModel = new InfrastructureModel <AppUserInformationModel>();

            var appUser = appUserOperation.GetById(appUserLoginModel.AppUserId);

            if (appUser != null)
            {
                AppUserInformationModel appUserInformationModel = new AppUserInformationModel()
                {
                    AppUserId = appUser.AppUserId,
                    Name      = appUser.Name,
                    Surname   = appUser.Surname,
                    Email     = appUser.Email,
                    Username  = appUser.Username
                };
                infrastructureModel.ResultModel  = appUserInformationModel;
                infrastructureModel.ResultStatus = true;
            }
            return(Json(infrastructureModel));
        }
Ejemplo n.º 23
0
        public IActionResult Update([FromBody] AppUserInformationModel appUserInformationModel)
        {
            InfrastructureModel <bool> infrastructureModel = new InfrastructureModel <bool>();

            var appUser = appUserOperation.GetById(appUserInformationModel.AppUserId);

            if (appUser != null)
            {
                //appUser.Email = appUserInformationModel.Email;
                appUser.Name    = appUserInformationModel.Name;
                appUser.Surname = appUserInformationModel.Surname;
                // appUser.Username = appUserInformationModel.Username;

                appUserOperation.Update(appUser);

                infrastructureModel.ResultModel  = true;
                infrastructureModel.ResultStatus = true;
            }

            return(Json(infrastructureModel));
        }
Ejemplo n.º 24
0
        public InfrastructureModel InsertInformationContent(InformationApiContentCRUDModel postModel)
        {
            InfrastructureModel resultModel = new InfrastructureModel();

            using (HttpClient client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", postModel.TokenKey);
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "multipart/form-data charset=utf-8");
                client.DefaultRequestHeaders.Accept.Clear();

                var serializeJsonObject = JsonConvert.SerializeObject(postModel);
                //StringContent content = new StringContent(serializeJsonObject, Encoding.UTF8, "multipart/form-data");

                MultipartFormDataContent multipartFormDataContent = new MultipartFormDataContent();

                multipartFormDataContent.Add(new StringContent(postModel.Title, UTF8Encoding.UTF8), "Title");

                multipartFormDataContent.Add(new StringContent(postModel.Explanation, UTF8Encoding.UTF8), "Explanation");

                if (postModel.CategoryId != null)
                {
                    multipartFormDataContent.Add(new StringContent(postModel.CategoryId.ToString(), UTF8Encoding.UTF8), "CategoryId");
                }

                if (postModel.AuthorId != null)
                {
                    multipartFormDataContent.Add(new StringContent(postModel.AuthorId.ToString(), UTF8Encoding.UTF8), "AuthorId");
                }


                multipartFormDataContent.Add(postModel.ImageArrayList, "PostImageFile", Guid.NewGuid().ToString() + postModel.PostImagePath);

                HttpResponseMessage httpResponceMessage = client.PostAsync(ConnectionHelper.GetConnectionUrl() + "Information/InsertInformationContent/", multipartFormDataContent).Result;
                httpResponceMessage.EnsureSuccessStatusCode();

                string response = httpResponceMessage.Content.ReadAsStringAsync().Result;

                return(resultModel);
            }
        }
Ejemplo n.º 25
0
        public InfrastructureModel <InformationContentSingleDataModel> GetInformationContentSingleData(InformationContentPostModel informationContentPostModel)
        {
            InfrastructureModel <InformationContentSingleDataModel> resultModel = new InfrastructureModel <InformationContentSingleDataModel>();

            using (HttpClient client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", informationContentPostModel.TokenKey);
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json charset=utf-8");
                client.DefaultRequestHeaders.Accept.Clear();

                var           serializeJsonObject = JsonConvert.SerializeObject(informationContentPostModel);
                StringContent content             = new StringContent(serializeJsonObject, Encoding.UTF8, "application/json");

                HttpResponseMessage httpResponceMessage = client.PostAsync(ConnectionHelper.GetConnectionUrl() + "Information/GetSingleContent/", content).Result;
                httpResponceMessage.EnsureSuccessStatusCode();

                string stringResponce = httpResponceMessage.Content.ReadAsStringAsync().Result;

                resultModel = JsonConvert.DeserializeObject <InfrastructureModel <InformationContentSingleDataModel> >(stringResponce);
            }
            return(resultModel);
        }
Ejemplo n.º 26
0
        public JsonResult ResetAllInformation()
        {
            Response <bool> response = new Response <bool>();

            appUserProvider = new AppUserProvider();
            AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session);

            if (appUserModel != null)
            {
                AppUserModel appUserTokenModel = SessionExtension.GetSessionUser(HttpContext.Session);

                InfrastructureModel <bool> infrastructureModel = appUserProvider.ResetAllInformationAppUser(appUserTokenModel);

                response = new Response <bool>
                {
                    Data    = infrastructureModel.ResultStatus,
                    Message = infrastructureModel.Message,
                    Status  = infrastructureModel.ResultStatus,
                };
            }
            return(Json(response));
        }
Ejemplo n.º 27
0
        public JsonResult GetAppUserInformation(AppUserLoginModel appUserLoginModel)
        {
            Response <AppUserInformationModel> response = new Response <AppUserInformationModel>();

            appUserProvider = new AppUserProvider();
            AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session);

            if (appUserModel != null)
            {
                AppUserModel appUserTokenModel = SessionExtension.GetSessionUser(HttpContext.Session);
                InfrastructureModel <AppUserInformationModel> appUserInformationModel = appUserProvider.GetById(new AppUserLoginModel()
                {
                    AppUserId = appUserModel.AppUser.AppUserId, TokenKey = appUserModel.TokenKey
                });
                response = new Response <AppUserInformationModel>()
                {
                    Data    = appUserInformationModel.ResultModel,
                    Message = "succes",
                    Status  = true
                };
            }
            return(Json(response));
        }
Ejemplo n.º 28
0
        public JsonResult GetAllCategoryList()
        {
            InfrastructureModel <List <Category> > response = new InfrastructureModel <List <Category> >();

            try
            {
                List <Category> categoryList = categoryOperation.GetAllCategoryList();

                response.ResultModel = categoryList;
                if (categoryList.Count() > 0)
                {
                    response.ResultStatus = true;
                }
                else
                {
                    response.ResultStatus = false;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(new JsonResult(response));
        }
Ejemplo n.º 29
0
        private void FillInfrastructureModel(InfrastructureModel infrastructureModel)
        {
            infrastructureModel.InfrastructureTVItemID = infrastructureModel.InfrastructureTVItemID;
            infrastructureModel.InfrastructureTVText   = infrastructureModel.InfrastructureTVText;
            infrastructureModel.Comment = randomService.RandomString("Comment", 100);
            infrastructureModel.PrismID = randomService.RandomInt(1, 100);
            infrastructureModel.TPID    = randomService.RandomInt(1, 100);
            infrastructureModel.LSID    = randomService.RandomInt(1, 100);
            infrastructureModel.SiteID  = randomService.RandomInt(1, 100);
            infrastructureModel.Site    = randomService.RandomInt(1, 100);
            infrastructureModel.InfrastructureCategory = "F";
            infrastructureModel.InfrastructureType     = InfrastructureTypeEnum.LiftStation;
            infrastructureModel.TreatmentType          = TreatmentTypeEnum.ActivatedSludge;
            infrastructureModel.DisinfectionType       = DisinfectionTypeEnum.ChlorinationNoDechlorinationSeasonal;
            infrastructureModel.CollectionSystemType   = CollectionSystemTypeEnum.Combined10Separated90;
            infrastructureModel.AlarmSystemType        = AlarmSystemTypeEnum.OnlyVisualLight;
            infrastructureModel.DesignFlow_m3_day      = randomService.RandomDouble(1, 100000);
            infrastructureModel.AverageFlow_m3_day     = randomService.RandomDouble(1, 100000);
            infrastructureModel.PeakFlow_m3_day        = randomService.RandomDouble(1, 100000);
            infrastructureModel.PopServed                    = randomService.RandomInt(50, 100000);
            infrastructureModel.CanOverflow                  = true;
            infrastructureModel.PercFlowOfTotal              = randomService.RandomDouble(0, 100);
            infrastructureModel.TimeOffset_hour              = randomService.RandomDouble(-8, -4);
            infrastructureModel.TempCatchAllRemoveLater      = randomService.RandomString("TempCatchAllRemoveLater", 200);
            infrastructureModel.AverageDepth_m               = randomService.RandomDouble(0.1, 1000);
            infrastructureModel.NumberOfPorts                = randomService.RandomInt(1, 100);
            infrastructureModel.PortDiameter_m               = randomService.RandomDouble(0.1, 10);
            infrastructureModel.PortSpacing_m                = randomService.RandomDouble(0.1, 10000);
            infrastructureModel.PortElevation_m              = randomService.RandomDouble(0.1, 10000);
            infrastructureModel.VerticalAngle_deg            = randomService.RandomDouble(-90, 90);
            infrastructureModel.HorizontalAngle_deg          = randomService.RandomDouble(-180, 180);
            infrastructureModel.DecayRate_per_day            = randomService.RandomDouble(0, 1000);
            infrastructureModel.NearFieldVelocity_m_s        = randomService.RandomDouble(0, 10);
            infrastructureModel.FarFieldVelocity_m_s         = randomService.RandomDouble(0, 10);
            infrastructureModel.ReceivingWaterSalinity_PSU   = randomService.RandomDouble(0, 35);
            infrastructureModel.ReceivingWaterTemperature_C  = randomService.RandomDouble(0, 35);
            infrastructureModel.ReceivingWater_MPN_per_100ml = randomService.RandomInt(0, 1000000);
            infrastructureModel.DistanceFromShore_m          = randomService.RandomDouble(0, 10000);

            Assert.IsTrue(infrastructureModel.InfrastructureTVItemID > 0);
            Assert.IsTrue(infrastructureModel.InfrastructureTVText.Length > 0);
            Assert.IsTrue(infrastructureModel.Comment.Length == 100);
            Assert.IsTrue(infrastructureModel.PrismID >= 1 && infrastructureModel.PrismID <= 100);
            Assert.IsTrue(infrastructureModel.TPID >= 1 && infrastructureModel.TPID <= 100);
            Assert.IsTrue(infrastructureModel.LSID >= 1 && infrastructureModel.LSID <= 100);
            Assert.IsTrue(infrastructureModel.SiteID >= 1 && infrastructureModel.SiteID <= 100);
            Assert.IsTrue(infrastructureModel.Site >= 1 && infrastructureModel.Site <= 100);
            Assert.IsTrue(infrastructureModel.InfrastructureCategory == "F");
            Assert.IsTrue(infrastructureModel.InfrastructureType == InfrastructureTypeEnum.LiftStation);
            Assert.IsTrue(infrastructureModel.TreatmentType == TreatmentTypeEnum.ActivatedSludge);
            Assert.IsTrue(infrastructureModel.DisinfectionType == DisinfectionTypeEnum.ChlorinationNoDechlorinationSeasonal);
            Assert.IsTrue(infrastructureModel.CollectionSystemType == CollectionSystemTypeEnum.Combined10Separated90);
            Assert.IsTrue(infrastructureModel.AlarmSystemType == AlarmSystemTypeEnum.OnlyVisualLight);
            Assert.IsTrue(infrastructureModel.DesignFlow_m3_day >= 1 && infrastructureModel.DesignFlow_m3_day <= 100000);
            Assert.IsTrue(infrastructureModel.AverageFlow_m3_day >= 1 && infrastructureModel.AverageFlow_m3_day <= 100000);
            Assert.IsTrue(infrastructureModel.PeakFlow_m3_day >= 1 && infrastructureModel.PeakFlow_m3_day <= 100000);
            Assert.IsTrue(infrastructureModel.PopServed >= 50 && infrastructureModel.PopServed <= 100000);
            Assert.IsTrue(infrastructureModel.CanOverflow == true);
            Assert.IsTrue(infrastructureModel.PercFlowOfTotal >= 0 && infrastructureModel.PercFlowOfTotal <= 100);
            Assert.IsTrue(infrastructureModel.TimeOffset_hour >= -8 && infrastructureModel.TimeOffset_hour <= -4);
            Assert.IsTrue(infrastructureModel.TempCatchAllRemoveLater.Length == 200);
            Assert.IsTrue(infrastructureModel.AverageDepth_m >= 0.1 && infrastructureModel.AverageDepth_m <= 1000);
            Assert.IsTrue(infrastructureModel.NumberOfPorts >= 1 && infrastructureModel.NumberOfPorts <= 100);
            Assert.IsTrue(infrastructureModel.PortDiameter_m >= 0.1 && infrastructureModel.PortDiameter_m <= 10);
            Assert.IsTrue(infrastructureModel.PortSpacing_m >= 0.1 && infrastructureModel.PortSpacing_m <= 10000);
            Assert.IsTrue(infrastructureModel.PortElevation_m >= 0.1 && infrastructureModel.PortElevation_m <= 10000);
            Assert.IsTrue(infrastructureModel.VerticalAngle_deg >= -90 && infrastructureModel.VerticalAngle_deg <= 90);
            Assert.IsTrue(infrastructureModel.HorizontalAngle_deg >= -180 && infrastructureModel.HorizontalAngle_deg <= 180);
            Assert.IsTrue(infrastructureModel.DecayRate_per_day >= 0 && infrastructureModel.DecayRate_per_day <= 1000);
            Assert.IsTrue(infrastructureModel.NearFieldVelocity_m_s >= 0 && infrastructureModel.NearFieldVelocity_m_s <= 10);
            Assert.IsTrue(infrastructureModel.FarFieldVelocity_m_s >= 0 && infrastructureModel.FarFieldVelocity_m_s <= 10);
            Assert.IsTrue(infrastructureModel.ReceivingWaterSalinity_PSU >= 0 && infrastructureModel.ReceivingWaterSalinity_PSU <= 35);
            Assert.IsTrue(infrastructureModel.ReceivingWaterTemperature_C >= 0 && infrastructureModel.ReceivingWaterTemperature_C <= 35);
            Assert.IsTrue(infrastructureModel.ReceivingWater_MPN_per_100ml >= 0 && infrastructureModel.ReceivingWater_MPN_per_100ml <= 1000000);
            Assert.IsTrue(infrastructureModel.ReceivingWaterSalinity_PSU >= 0 && infrastructureModel.ReceivingWaterSalinity_PSU <= 35);
            Assert.IsTrue(infrastructureModel.DistanceFromShore_m >= 0 && infrastructureModel.DistanceFromShore_m <= 10000);
        }
Ejemplo n.º 30
0
        public void InfrastructureController_SaveInfrastructureJSON_Test()
        {
            controllerAction = "SaveInfrastructureJSON";

            foreach (CultureInfo culture in setupData.cultureListGood)
            {
                SetupTest(contactModelListGood[0], culture, controllerAction);

                using (TransactionScope ts = new TransactionScope())
                {
                    TVItemModel tvItemModelSubsector = randomService.RandomTVItem(TVTypeEnum.Subsector);

                    Assert.AreEqual("", tvItemModelSubsector.Error);

                    TVItemModel tvItemModelMunicipality = tvItemService.PostAddChildTVItemDB(tvItemModelSubsector.TVItemID, "Unique Municipality Name", TVTypeEnum.Municipality);

                    Assert.AreEqual("", tvItemModelMunicipality.Error);

                    TVItemModel tvItemModelInfrastructure = tvItemService.PostAddChildTVItemDB(tvItemModelMunicipality.TVItemID, randomService.RandomString("Infra ", 20), TVTypeEnum.Infrastructure);

                    Assert.AreEqual("", tvItemModelInfrastructure.Error);

                    InfrastructureModel infrastructureModelNew = new InfrastructureModel();
                    infrastructureModelNew.InfrastructureTVItemID = tvItemModelInfrastructure.TVItemID;
                    infrastructureModelNew.InfrastructureTVText   = tvItemModelInfrastructure.TVText;
                    FillInfrastructureModel(infrastructureModelNew);

                    InfrastructureModel infrastructureModelRet = infrastructureService.PostAddInfrastructureDB(infrastructureModelNew);

                    Assert.AreEqual("", infrastructureModelRet.Error);

                    FormCollection fc = new FormCollection();
                    fc.Add("InfrastructureTVItemID", tvItemModelInfrastructure.TVItemID.ToString());
                    fc.Add("infrastructurecategory", "F");
                    fc.Add("infrastructuretype", InfrastructureTypeEnum.LiftStation.ToString());
                    fc.Add("treatmenttype", TreatmentTypeEnum.ActivatedSludge.ToString());
                    fc.Add("disinfectiontype", DisinfectionTypeEnum.ChlorinationNoDechlorinationSeasonal.ToString());
                    fc.Add("collectionsystemtype", CollectionSystemTypeEnum.Combined10Separated90.ToString());
                    fc.Add("alarmsystemtype", AlarmSystemTypeEnum.OnlyVisualLight.ToString());
                    fc.Add("DesignFlow_m3_s", randomService.RandomDouble(0.3, 10000.0).ToString());
                    fc.Add("AverageFlow_m3_s", randomService.RandomDouble(0.3, 10000.0).ToString());
                    fc.Add("PeakFlow_m3_s", randomService.RandomDouble(0.3, 10000.0).ToString());
                    fc.Add("PopServed", randomService.RandomDouble(10, 10000).ToString());
                    fc.Add("CanOverflow", "on");
                    fc.Add("PercFlowOfTotal", randomService.RandomDouble(0.1, 100.0).ToString());
                    fc.Add("InputDataComments", randomService.RandomString("Input Data Comments", 30));
                    fc.Add("Comments", randomService.RandomString("Comments", 30));
                    fc.Add("TimeOffset_hour", randomService.RandomInt(-7, -3).ToString());
                    fc.Add("TempCatchAllRemoveLater", randomService.RandomString("Temp catch all remove later", 100));
                    fc.Add("AverageDepth_m", randomService.RandomDouble(0.1, 100.0).ToString());
                    fc.Add("NumberOfPorts", randomService.RandomInt(1, 100).ToString());
                    fc.Add("PortDiameter_m", randomService.RandomDouble(0.1, 10.0).ToString());
                    fc.Add("PortSpacing_m", randomService.RandomDouble(0.1, 1000.0).ToString());
                    fc.Add("PortElevation_m", randomService.RandomDouble(0.1, 100.0).ToString());
                    fc.Add("VerticalAngle_deg", randomService.RandomDouble(0.1, 100.0).ToString());
                    fc.Add("HorizontalAngle_deg", randomService.RandomDouble(0.1, 100.0).ToString());
                    fc.Add("DecayRate_per_day", randomService.RandomDouble(0.1, 4.6821).ToString());
                    fc.Add("NearFieldVelocity_m_s", randomService.RandomDouble(0.1, 10.0).ToString());
                    fc.Add("FarFieldVelocity_m_s", randomService.RandomDouble(0.1, 10.0).ToString());
                    fc.Add("ReceivingWaterSalinity_PSU", randomService.RandomDouble(0.0, 35.0).ToString());
                    fc.Add("ReceivingWaterTemperature_C", randomService.RandomDouble(0.1, 35.0).ToString());
                    fc.Add("ReceivingWater_MPN_per_100ml", randomService.RandomInt(0, 3500000).ToString());
                    fc.Add("DistanceFromShore_m", randomService.RandomDouble(1.0, 35000.0).ToString());
                    fc.Add("Lat", "45");
                    fc.Add("Lng", "-66");

                    JsonResult jsonResult = controller.InfrastructureAddOrModifyJSON(fc) as JsonResult;

                    Assert.IsNotNull(jsonResult);
                    string retStr = (string)jsonResult.Data;
                }
            }
        }