protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (var dbContext = new EntityFastWater.FastWaterContext()) { GridViewKoords.DataSource = DatabaseFastWaterService.GeographyKordinatesService.GetGeographicalKoordinatesEf() .Select(x => new { x.Id_GeographicalKoordinates, x.SRID, x.Koordinate, x.KoordinateText, x.HeighSeaLevel, x.TypeKoordinates, x.RadiusAction, x.description }); GridViewKoords.DataBind(); //GridViewFlood.DataSource = DatabaseFastWaterService.ALLInformationOnPostService.GetALLInformationOnPostEf(). // Select(x => new { x.Id_Post, x.NameLocality, x.Koordinate, x.DateAndTimes, x.LongitudeDay, x.}); GridViewPost.DataSource = DatabaseFastWaterService.PostService.GetPostEf(). Select(x => new { x.Id_Post, x.NamePost, x.Id_GeographicalKoordinates, x.Basin.NameBasin, x.Ground.TypeGround, x.Locality.NameLocality, x.DistanceBeetwenSensors, x.description }); GridViewPost.DataBind(); DropListIdKoordinat.DataSource = DatabaseFastWaterService.GeographyKordinatesService.GetGeographicalKoordinatesEf() .Select(x => x.Id_GeographicalKoordinates); DropListIdKoordinat.DataBind(); DropListBasin.DataSource = dbContext.Basins.Select(x => x.NameBasin).ToList(); DropListBasin.DataBind(); DropListGround.DataSource = dbContext.Grounds.Select(x => x.TypeGround).ToList(); DropListGround.DataBind(); DropListLocal.DataSource = dbContext.Localities.Select(x => x.NameLocality).ToList(); DropListLocal.DataBind(); } } }
protected void Button2_Click(object sender, EventArgs e) { if (DropListTypeKoords.SelectedValue.Equals("LINESTRING")) { GeographyKordinatesService.UpdateGeographyKoord(Convert.ToInt32(TextBoxIdKoords.Text), Convert.ToInt32(TextBoxSRID.Text), Convert.ToInt32(TextBoxRadiusKoords.Text), Convert.ToInt32(TextBoxHeightSea.Text), TextBoxDescriptionKoords.Text, DropListTypeKoords.SelectedValue, Convert.ToDouble(TextBoxKoords1.Text), Convert.ToDouble(TextBoxKoords2.Text), Convert.ToDouble(TextBoxKoords3.Text), Convert.ToDouble(TextBoxKoords4.Text)); } else if (DropListTypeKoords.SelectedValue.Equals("POINT")) { GeographyKordinatesService.UpdateGeographyKoord(Convert.ToInt32(TextBoxIdKoords.Text), Convert.ToInt32(TextBoxSRID.Text), Convert.ToInt32(TextBoxRadiusKoords.Text), Convert.ToInt32(TextBoxHeightSea.Text), TextBoxDescriptionKoords.Text, DropListTypeKoords.SelectedValue, Convert.ToDouble(TextBoxKoords1.Text), Convert.ToDouble(TextBoxKoords2.Text)); } using (var dbContext = new EntityFastWater.FastWaterContext()) { GridViewKoords.DataSource = DatabaseFastWaterService.GeographyKordinatesService.GetGeographicalKoordinatesEf() .Select(x => new { x.Id_GeographicalKoordinates, x.SRID, x.Koordinate, x.KoordinateText, x.HeighSeaLevel, x.TypeKoordinates, x.RadiusAction, x.description }); GridViewKoords.DataBind(); } }
protected void Button5_Click(object sender, EventArgs e) { PostService.RemovePostEf(Convert.ToInt32(TextBoxIdPost.Text)); GridViewKoords.DataBind(); }