Exemplo n.º 1
0
 protected void uiLinkButtonAdd_Click(object sender, EventArgs e)
 {
     uiPanelViewAllPages.Visible = false;
     uiPanelEdit.Visible = true;
     Clearfields();
     CurrentNews = null;
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         YMC.BLL.News news = new YMC.BLL.News();
         news.LoadAll();
         news.Query.Top = 5;
         uiRepeaterNews.DataSource = news.DefaultView;
         uiRepeaterNews.DataBind();
     }
 }
Exemplo n.º 3
0
 protected void uiGridViewNews_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditNews")
     {
         News objData = new News();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         CurrentNews = objData;
         uiTextBoxArTitle.Text = objData.Title;
         uiTextBoxCommitee.Text = objData.CommiteeName;
         uiFCKeditorContent.Value = Server.HtmlDecode(objData.Details);
         uiTextBoxBrief.Text = objData.Brief;
         uiPanelViewAllPages.Visible = false;
         uiPanelEdit.Visible = true;
     }
     else if (e.CommandName == "DeleteNews")
     {
         News objData = new News();
         objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
         objData.MarkAsDeleted();
         objData.Save();
         BindData();
     }
 }
Exemplo n.º 4
0
 protected void uiLinkButtonUpdate_Click(object sender, EventArgs e)
 {
     News objData = new News();
     if (CurrentNews != null)
         objData = CurrentNews;
     else
     {
         objData.AddNew();
     }
     objData.Title = uiTextBoxArTitle.Text;
     objData.CommiteeName = uiTextBoxCommitee.Text;
     objData.Details = Server.HtmlEncode(uiFCKeditorContent.Value);
     objData.Brief = uiTextBoxBrief.Text;
     objData.NewsDate = DateTime.Now;
     objData.Save();
     CurrentNews = null;
     uiPanelViewAllPages.Visible = true;
     uiPanelEdit.Visible = false;
     BindData();
 }
Exemplo n.º 5
0
 private void BindData()
 {
     News objData = new News();
     objData.LoadAll();
     uiGridViewNews.DataSource = objData.DefaultView;
     uiGridViewNews.DataBind();
 }