protected void Page_Load(object sender, EventArgs e)
    {
        int vId = Int32.Parse(Request["id"]);

        UserInformationDataSetTableAdapters.PostTableAdapter pta;
        pta = new UserInformationDataSetTableAdapters.PostTableAdapter();
        postListView.DataSource = pta.GetDataByPostId(vId);
        postListView.DataBind();
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int vId = Int32.Parse(Request["id"].ToString());

        UserInformationDataSetTableAdapters.PostTableAdapter pta;
        pta = new UserInformationDataSetTableAdapters.PostTableAdapter();
        pta.Delete(vId);
        Server.Transfer("ViewPostForm.aspx");
    }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["username"] == null)
     {
         Server.Transfer("InvalidAccess.aspx");
     }
     UserInformationDataSetTableAdapters.PostTableAdapter pta;
     pta = new UserInformationDataSetTableAdapters.PostTableAdapter();
     pdt = pta.GetData();
 }
Пример #4
0
    protected void fPostButton_Click(object sender, EventArgs e)
    {
        string   vSubject  = fSubject.Text.Trim();
        string   vPostText = fPostText.Text.Trim();
        DateTime vDateTime = DateTime.Now;

        UserInformationDataSetTableAdapters.PostTableAdapter pta;
        pta = new UserInformationDataSetTableAdapters.PostTableAdapter();
        string vUsername = Session["username"].ToString().Trim();

        pta.Insert(vDateTime, vUsername, vSubject, vPostText);
        fPostText.Text = "";
        fMessages.Text = "Posted Successfully!!!";
        Server.Transfer("ViewPostForm.aspx");
    }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     UserInformationDataSetTableAdapters.PostTableAdapter pta;
     pta = new UserInformationDataSetTableAdapters.PostTableAdapter();
     currentThreadsListView.DataSource = pta.GetDataBySubject();
     currentThreadsListView.DataBind();
     if (Session["username"] != null)
     {
         fLoggedInUser.Text = "User: "******"username"].ToString().Trim();
         fMenuPanel.Visible = true;
     }
     else
     {
         fMenuPanel.Visible = false;
     }
 }
Пример #6
0
 protected void sortByDropDownList_SelectedIndexChanged(object sender, EventArgs e)
 {
     UserInformationDataSetTableAdapters.PostTableAdapter pta;
     pta = new UserInformationDataSetTableAdapters.PostTableAdapter();
     if (sortByDropDownList.SelectedItem.ToString().Equals("Username"))
     {
         pdt = pta.GetDataByUsername();
     }
     if (sortByDropDownList.SelectedItem.ToString().Equals("Subject"))
     {
         pdt = pta.GetDataBySubject();
     }
     if (sortByDropDownList.SelectedItem.ToString().Equals("Date"))
     {
         pdt = pta.GetData();
     }
 }