//Tutaj ładowanie przycisków dla odpowiedniej roli
    protected void load_button()
    {
        sessionUser u = new sessionUser();
        u = (sessionUser)Session["online"];

        switch(u.roleProject)
        {
            case "ProductOwner":
                    HtmlGenericControl buttonDivAdd = new HtmlGenericControl("div");
                    buttonDivAdd.Attributes["class"] = "option";
                    buttonPlaceHolder.Controls.Add(buttonDivAdd);

                    HyperLink linkAdd = new HyperLink();
                    linkAdd.NavigateUrl = "~/add.aspx";
                    linkAdd.Attributes["class"] = "buttonlink";
                    linkAdd.Text = "User";
                    buttonDivAdd.Controls.Add(linkAdd);

                    HtmlGenericControl buttonDivTaskSprint = new HtmlGenericControl("div");
                    buttonDivTaskSprint.Attributes["class"] = "option";
                    buttonPlaceHolder.Controls.Add(buttonDivTaskSprint);

                    HyperLink linkTaskSprint = new HyperLink();
                    linkTaskSprint.NavigateUrl = "~/tasksprint.aspx";
                    linkTaskSprint.Attributes["class"] = "buttonlink";
                    linkTaskSprint.Text = "Task/Sprint";
                    buttonDivTaskSprint.Controls.Add(linkTaskSprint);
                    break;
            case "DevelopmentTeam":
                    HtmlGenericControl button = new HtmlGenericControl("div");
                    button.Attributes["class"] = "option";
                    buttonPlaceHolder.Controls.Add(button);

                    HyperLink link = new HyperLink();
                    link.NavigateUrl = "~/default.aspx";
                    link.Attributes["class"] = "buttonlink";
                    link.Text = "DweloperButton";
                    button.Controls.Add(link);
                    break;
            case "ScrumMaster":
                    HtmlGenericControl button2 = new HtmlGenericControl("div");
                    button2.Attributes["class"] = "option";
                    buttonPlaceHolder.Controls.Add(button2);

                    HyperLink link2 = new HyperLink();
                    link2.NavigateUrl = "~/default.aspx";
                    link2.Attributes["class"] = "buttonlink";
                    link2.Text = "ScrumMasterButton";
                    button2.Controls.Add(link2);
                    break;

        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     titleProject.Text = "Tutaj z bazy tytuł projektu";
     if(Session["online"]!=null)
     {
         us = (sessionUser)Session["online"];
         if (us.roleProject == "DevelopmentTeam")
         {
             roleProject.Text = us.roleProject;
         }
     }else
         Response.Redirect("~/Default.aspx");
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if(Session["online"]!=null)
     {
         sessionUser u = new sessionUser();
         u = (sessionUser)Session["online"];
         if(u.roleProject == "ProductOwner")
         {
             Response.Redirect("~/DefaultProductOwner.aspx");
         }
         else if (u.roleProject == "DevelopmentTeam")
         {
             Response.Redirect("~/DefaultDevelopmentTeam.aspx");
         }
         else if (u.roleProject == "ScrumMaster")
         {
             Response.Redirect("~/DefaultScrumMaster.aspx");
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if((sessionUser)Session["online"] != null)
        {
            sessionUser u = new sessionUser();
            u = (sessionUser)Session["online"];
            lbLogin.Text = u.userName;
            icon.Attributes["class"] = "icon-user";
            loginClick.Attributes["onclick"] = "document.getElementById('logout').style.display='block';document.getElementById('fade').style.display='block'";

            if (u.selectedProjectId == 0 && u.roleProject == null)
            {
                if (Request.QueryString["id_project"] == null && Request.QueryString["id_role"] == null)
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Func(true)", true);
                }
                else
                {
                    u.selectedProjectId = Convert.ToInt32(Request.QueryString["id_project"]);
                    u.roleProject = (string)Request.QueryString["id_role"];
                }
                load_popup_project(13);

            }
            load_button();

        }
        else
        {
            icon.Attributes["class"] = "icon-login";
            loginClick.Attributes["onclick"] = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'";
            //load_button();
        }
    }
    protected void log_in_Click(object sender, EventArgs e)
    {
        DBConnect db = new DBConnect();
        if (db.AuthorizationLogin(tbLogin.Text, tbHaslo.Text) == true)//Autoryzacja logowanaia metoda w App_Code/DataBase/DBConnect
        {
            /*Te dane pobrane z bazy*/
            sessionUser user = new sessionUser();
            user.userId = 1; //Pobrać z bazy
            user.userName = tbLogin.Text; //Pobrać z bazy albo text boxa z loginem

            Session["online"] = user;
            Response.Redirect("~/Default.aspx");
        }
        else
        {
            Session["online"] = null;
        }
    }