protected void uiLinkButtonCancel_Click(object sender, EventArgs e) { uiPanelViewAllPages.Visible = true; uiPanelEdit.Visible = false; Clearfields(); CurrentLink = null; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ImportantLinks links = new ImportantLinks(); links.LoadAll(); links.Query.Top = 5; uiRepeaterLinks.DataSource = links.DefaultView; uiRepeaterLinks.DataBind(); } }
protected void uiGridViewLinks_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditLink") { ImportantLinks objData = new ImportantLinks(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentLink = objData; uiTextBoxArTitle.Text = objData.LinkName; uiTextBoxURL.Text = objData.LinkURL; uiPanelViewAllPages.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteLink") { ImportantLinks objData = new ImportantLinks(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); BindData(); } }
protected void uiLinkButtonUpdate_Click(object sender, EventArgs e) { ImportantLinks objData = new ImportantLinks(); if (CurrentLink != null) objData = CurrentLink; else { objData.AddNew(); } objData.LinkName = uiTextBoxArTitle.Text; objData.LinkURL = uiTextBoxURL.Text; objData.Save(); CurrentLink = null; uiPanelViewAllPages.Visible = true; uiPanelEdit.Visible = false; BindData(); }
private void BindData() { ImportantLinks objData = new ImportantLinks(); objData.LoadAll(); uiGridViewLinks.DataSource = objData.DefaultView; uiGridViewLinks.DataBind(); }