private void GetCategoryDetail(int categoryId) { List <BlogEntry> entry = GenericBS <BlogEntry> .GetListByCriteria(x => x.CategoryId == categoryId && x.IsActive.Value); if (entry.Count != 0) { ControlBinder.BindRepeater(rptBlogEntries, entry); } else { NotificationMessage.Error(divMessage, "Bu Kategoride henüz bilgi yok.!!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (SessionManager.ActiveUser == null) { NotificationMessage.Error(divMessage, "Yetkisiz Giriş.."); divPanel.Style.Add("display", "none"); } else { divPanel.Controls.Add(Page.LoadControl("~/UserControls/UserPanel.ascx")); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Guid code = Guid.Parse(Request.QueryString["Code"]); User user = GenericBS <User> .GetSingleItemByCriteria(x => x.ActivationCode == code); if (user != null) { user.IsMailConfirmed = true; GenericBS <User> .Update(user); NotificationMessage.Error(divMessage, "Aktivasyon Başarılı.Yönetici onayından sonra giriş yapabilirsiniz."); } else { NotificationMessage.Error(divMessage, "Aktivasyon Başarısız.Lütfen maildeki linke tıklayın."); } } }
protected void btnSave_Click(object sender, EventArgs e) { try { BlogEntry be = new BlogEntry(); be.CategoryId = Convert.ToInt32(ddlCategory.SelectedValue); be.Content = txtContent.Value; be.Date = DateTime.Now; be.IsActive = false; be.Title = txtTitle.Value; be.UserId = SessionManager.ActiveUser.Id; be.Abstract = txtAbstract.Value; GenericBS <BlogEntry> .Insert(be); HttpFileCollection hfc = Request.Files; if (hfc.Count > 0) { string isim = Guid.NewGuid().ToString(); for (int i = 0; i < hfc.Count; i++) { HttpPostedFile hpf = hfc[i]; string filePath = "~/img/BlogPhotos/" + isim + hpf.FileName; hpf.SaveAs(Server.MapPath(filePath)); BlogEntryPhoto ph = new BlogEntryPhoto(); ph.BlogEntryId = be.Id; ph.PhotoPath = filePath; GenericBS <BlogEntryPhoto> .Insert(ph); } } NotificationMessage.Success(divMessage, "Kayıt Başarılı.."); txtTitle.Value = ""; txtContent.Value = ""; } catch (Exception) { NotificationMessage.Error(divMessage, "Kayıt Başarısız.."); } }