Пример #1
0
 protected void btnKomentar_Click(object sender, EventArgs e)
 {
     using (PoslovniKlubBL temp = new PoslovniKlubBL())
     {
         user = (Data.EntityFramework.DAL.Users)Session["LoggedUser"];
         int uid = temp.GetUserIDByName(user.UserName);
         if (!string.IsNullOrWhiteSpace(txtKomentar.Text))
         {
             temp.SaveComment(txtKomentar.Text, uid, temp.GetUserBySpBr(txtSporazum.Text));
             ResetFields();
         }
         else
             ClientScript.RegisterStartupScript(this.GetType(), "Greška!", "alert('Žao mi je, ali ne možete upisati prazan komentar!');", true);
     }
 }