Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["username"] == null)
        {
            Response.Redirect("~/Login.aspx");

        }
        else
        {
            if (!Page.IsPostBack)
            {
                Logic lo = new Logic();
                Label lb = Page.Master.FindControl("lbTitle") as Label;
                lb.Text = "Welcome, to Task Manager Web App";
                lb.ForeColor = Color.Black;

                Label user = Page.Master.FindControl("lbUsername") as Label;
                string u = Session["username"].ToString();
                Person pp = lo.GetPerson(u);
                user.Text = pp.Username;

                int pend, complete, total;
                TaskManagerModelContainer db = new TaskManagerModelContainer();
                pend = lo.GetAllPendingTasks(pp.Id).Count;
                complete = lo.GetAllCompletedTasks(pp.Id).Count;
                total = lo.GetAllTasks(pp.Id).Count;

                Label1.Text = pend.ToString() + " Task(s) Pending";
                Label2.Text = complete.ToString() + " Task(s) Completed";
                Label3.Text = total.ToString() + " Task(s) in Total";
            }
        }
    }
Ejemplo n.º 2
0
    public void Load()
    {
        try
        {
            TaskManagerModelContainer db = new TaskManagerModelContainer();
            Logic lo = new Logic();
            Pendin p = new Pendin();
            List<Taskk> ts = lo.GetAllTasks(1);
            List<Pendin> pen = new List<Pendin>();
            List<string> fr = new List<string>();
            for (int i = 0; i < ts.Count; i++)
            {
                fr.Add(ts[i].Title);
            }

            drpTitles.DataSource = fr;
            drpTitles.DataBind();
        }
        catch
        {
            Label lb = new Label();
            lb.Text = "Loading Failed. Please Try Again";
            Panel1.CssClass = "divError";
            icon.CssClass = "img";
            icon.ImageUrl = "~/assets/icons/error3.png";
            icon.Visible = true;
            PlaceHolder1.Controls.Add(lb);
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["username"] == null)
        {
            Response.Redirect("~/Login.aspx");

        }
        else
        {
            if (!Page.IsPostBack)
            {
                Logic lo = new Logic();
                Label lb = Page.Master.FindControl("lbTitle") as Label;
                lb.Text = "Pending Tasks";
                lb.ForeColor = Color.Black;

                Label user = Page.Master.FindControl("lbUsername") as Label;
                string u = Session["username"].ToString();
                Person pp = lo.GetPerson(u);
                user.Text = pp.Username;

                TaskManagerModelContainer db = new TaskManagerModelContainer();

                Pendin p = new Pendin();
                List<Taskk> ts = lo.GetAllTasks(pp.Id);
                List<Pendin> pen = new List<Pendin>();
                List<string> fr = new List<string>();
                for (int i = 0; i < ts.Count; i++)
                {
                    fr.Add(ts[i].Title);
                }

                drpTitles.DataSource = fr;
                drpTitles.DataBind();
            }
        }
    }