protected void Button3_Click(object sender, EventArgs e)
 {
     PostService.AddPostToDataBase(TextBoxNamePost.Text, Convert.ToDecimal(TextBoxSensors.Text),
                                   Convert.ToInt32(DropListIdKoordinat.SelectedValue), DropListBasin.SelectedValue,
                                   DropListGround.SelectedValue, DropListLocal.SelectedValue, TextBoxDescription.Text);
     GridViewPost.DataBind();
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable panelPopup = new DataTable();

            panelPopup.Columns.Add("Input");
            panelPopup.Columns.Add("Name");
            panelPopup.Columns.Add("Output");

            createActionTable("User", panelPopup);
            GridViewUser.DataSource = panelPopup;
            GridViewUser.DataBind();

            panelPopup.Clear();
            createActionTable("Friend", panelPopup);
            GridViewFriends.DataSource = panelPopup;
            GridViewFriends.DataBind();

            panelPopup.Clear();
            createActionTable("Album", panelPopup);
            GridViewAlbum.DataSource = panelPopup;
            GridViewAlbum.DataBind();

            panelPopup.Clear();
            createActionTable("Photo", panelPopup);
            GridViewPhoto.DataSource = panelPopup;
            GridViewPhoto.DataBind();

            panelPopup.Clear();
            createActionTable("Post", panelPopup);
            GridViewPost.DataSource = panelPopup;
            GridViewPost.DataBind();

            panelPopup.Clear();
            createActionTable("Video", panelPopup);
            GridViewVideo.DataSource = panelPopup;
            GridViewVideo.DataBind();

            panelPopup.Clear();
            createActionTable("Like", panelPopup);
            GridViewLike.DataSource = panelPopup;
            GridViewLike.DataBind();

            panelPopup.Clear();
            createActionTable("Comment", panelPopup);
            GridViewComment.DataSource = panelPopup;
            GridViewComment.DataBind();
        }
        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 Button6_Click(object sender, EventArgs e)
 {
     GeographyKordinatesService.RemoveGeographicalKoordinatesEf(Convert.ToInt32(TextBoxIdKoords.Text));
     GridViewPost.DataBind();
 }