Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            checkUsertype.filter("STAFF", Session["UserType"].ToString());
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('You have been inactive for too long. Please relogin.');window.location ='Out.aspx';", true);
        }

        if (!IsPostBack)
        {
            try
            {
                SqlCommand cmd = new SqlCommand("SELECT StaffId, LName + ', ' + FName + ' (' + MName + ')' as FullName, Status, DateRegistered FROM dbo.Staff WHERE STATUS = 'ACTIVE' AND UserId <> " + Session["UserId"]);
                ListViewStaff.DataSource = Class2.getDataSet(cmd);
                ListViewStaff.DataBind();
            }
            catch (Exception ex)
            {
            }
            Session["SArchive"] = "NO";
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        checkUsertype.filter("STAFF", Session["UserType"].ToString());

        SqlCommand cmd = new SqlCommand("SELECT StaffId, LName + ', ' + FName + ' (' + MName + ')' as FullName, Status, DateRegistered FROM dbo.Staff WHERE STATUS = 'ACTIVE'");

        ListViewStaff.DataSource = Class2.getDataSet(cmd);
        ListViewStaff.DataBind();
    }
Esempio n. 3
0
 protected void showArchive(object sender, EventArgs e)
 {
     if (Session["SArchive"] == "NO")
     {
         SqlCommand cmd = new SqlCommand("SELECT StaffId, LName + ', ' + FName + ' (' + MName + ')' as FullName, Status, DateRegistered FROM dbo.Staff WHERE STATUS = 'INACTIVE' AND UserId <> " + Session["UserId"]);
         ListViewStaff.DataSource = Class2.getDataSet(cmd);
         ListViewStaff.DataBind();
         Session["SArchive"] = "YES";
         archive.Title       = "View Active";
         rem.ToolTip         = "Move to Active";
     }
     else
     {
         SqlCommand cmd2 = new SqlCommand("SELECT StaffId, LName + ', ' + FName + ' (' + MName + ')' as FullName, Status, DateRegistered FROM dbo.Staff WHERE STATUS = 'ACTIVE' AND UserId <> " + Session["UserId"]);
         ListViewStaff.DataSource = Class2.getDataSet(cmd2);
         ListViewStaff.DataBind();
         Session["SArchive"] = "NO";
         archive.Title       = "View Archive";
         rem.ToolTip         = "Move to Archive";
     }
 }