protected void Page_Load(object sender, EventArgs e) { using (TriglavBL temp = new TriglavBL()) { if (Request.QueryString != null) { if (Request.QueryString["PostID"] != null) { postId = Int32.Parse(Request.QueryString["PostID"]); post = temp.getPostByID(postId); } else { Response.Redirect("/Public/Home.aspx"); } } dl_WikiPoveznice.DataSource = Data.Lucene.Pretraga.getClanciPretrage(post.Tagovi).Take(5); dl_WikiPoveznice.DataBind(); dl_QAPoveznice.DataSource = Data.Lucene.Pretraga.getPitanjaPretrage(post.Tagovi).Take(5); dl_QAPoveznice.DataBind(); } btn_Clanak.BackColor = System.Drawing.Color.LightGray; btn_Razgovor.BackColor = System.Drawing.Color.White; btn_Citaj.BackColor = System.Drawing.Color.LightGray; btn_VidiIzvornik.BackColor = System.Drawing.Color.LightGray; btn_VidiIzmjene.BackColor = System.Drawing.Color.LightGray; }
protected void Page_Load(object sender, EventArgs e) { using (TriglavBL temp = new TriglavBL()) { if (Request.QueryString != null) { if (Request.QueryString["PostID"] != null) { postId = Int32.Parse(Request.QueryString["PostID"]); post = temp.getPostByID(postId); } else { Response.Redirect("/Public/Home.aspx"); } } dl_WikiPoveznice.DataSource = Data.Lucene.Pretraga.getClanciPretrage(post.Tagovi).Take(5); dl_WikiPoveznice.DataBind(); dl_QAPoveznice.DataSource = Data.Lucene.Pretraga.getPitanjaPretrage(post.Tagovi).Take(5); dl_QAPoveznice.DataBind(); } btn_Clanak.BackColor = System.Drawing.Color.LightGray; btn_Razgovor.BackColor = System.Drawing.Color.White; btn_Citaj.BackColor = System.Drawing.Color.LightGray; btn_VidiIzvornik.BackColor = System.Drawing.Color.LightGray; btn_VidiIzmjene.BackColor = System.Drawing.Color.LightGray; }
protected void Page_Load(object sender, EventArgs e) { using (TriglavBL temp = new TriglavBL()) { if (Request.QueryString != null) { if (Request.QueryString["PostID"] != null) { postId = Int32.Parse(Request.QueryString["PostID"]); post = temp.getPostByID(postId); } else { Response.Redirect("/Public/Home.aspx"); } } } btn_Clanak.BackColor = System.Drawing.Color.LightGray; btn_Razgovor.BackColor = System.Drawing.Color.White; btn_Citaj.BackColor = System.Drawing.Color.LightGray; btn_VidiIzvornik.BackColor = System.Drawing.Color.LightGray; btn_VidiIzmjene.BackColor = System.Drawing.Color.LightGray; }
protected void btn_SaveKomentar_Click(object sender, EventArgs e) { if (txt_Sadrzaj.Text == String.Empty) { return; } else { Data.EntityFramework.DAL.Korisnik korisnik = (Data.EntityFramework.DAL.Korisnik)Session["LogiraniKorisnik"]; if (korisnik == null) { Response.Redirect("/Login.aspx?ReturnUrl=" + Request.Url); } else { if (PostId != 0) { using (TriglavBL temp = new TriglavBL()) { Data.EntityFramework.DAL.Komentari komentar = new Data.EntityFramework.DAL.Komentari(); komentar.Sadrzaj = txt_Sadrzaj.Text; komentar.DatumKreiranja = DateTime.Now; komentar.Likes = 0; komentar.Unlikes = 0; komentar.PostID = PostId; komentar.KorisnikID = korisnik.id; komentar.isRazgovor = 0; temp.SaveKomentar(komentar); Data.EntityFramework.DAL.Post post = temp.getPostByID(PostId); post.BrojKomentara++; temp.UpdatePost(post); ResetirajPolja(); } } } } }
protected void dl_PrijedloziIzmjena_ItemDataBound(object sender, DataListItemEventArgs e) { using (TriglavBL temp = new TriglavBL()) { int id = (int)DataBinder.Eval(e.Item.DataItem, "id"); post_odobreni = temp.getPostByID(id); // Response.Write("<script>alert('"+id+"');</script>"); } if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) return; RadioButton cur = (RadioButton)e.Item.FindControl("rdbP"); string script = "SetSingleRadioButton('" + cur.ClientID + "',this)"; cur.Attributes.Add("onclick", script); }