Beispiel #1
0
        public ActionResult View(int id)
        {
            try
            {
                Employee employee = Employee.FetchEmployeeByID(id);
                if (employee.Name == null)
                {
                    return(RedirectToAction("Index", "Error", new { status = 404 }));
                }
                Tuple <Employee, Employee> T = new Tuple <Employee, Employee>((Employee)Session["Employee"], employee);

                List <Event>   Events   = Event.FetchAllEvents((new Database()).SelectFromViewWithWhere("vw_all_events", "created_by = " + id));
                List <Task>    Tasks    = Task.FetchAllTasks((new Database()).SelectFromViewWithWhere("vw_all_tasks", "created_by = " + id));
                List <Subtask> Subtasks = Subtask.FetchAllSubtasks((new Database()).SelectFromViewWithWhere("vw_all_subtasks", "created_by = " + id));

                ViewBag.Tasks           = Tasks;
                ViewBag.Events          = Events;
                ViewBag.Subtasks        = Subtasks;
                ViewBag.PendingTasks    = Task.GetPendingTasks(Tasks);
                ViewBag.PendingEvents   = Event.GetPendingEvents(Events);
                ViewBag.PendingSubtasks = Subtask.GetPendingSubtasks(Subtasks);
                return(View(T));
            }
            catch
            {
                throw new HttpException(404, "Not Found");
            }
        }
Beispiel #2
0
        public ActionResult Me()
        {
            InjectEmployeeDetails();
            Current C = new Current();

            C.Employee       = (Employee)Session["Employee"];
            ViewBag.Subtasks = Subtask.FetchAllSubtasks((new Database()).SelectFromViewWithWhere("vw_all_subtasks", "created_by = " + C.Employee.ID));
            return(View(C));
        }
Beispiel #3
0
        public ActionResult Index()
        {
            ViewBag.Subtasks = Subtask.FetchAllSubtasks((new Database()).SelectAllFromView("vw_all_subtasks"));
            InjectEmployeeDetails();
            Current C = new Current();

            C.Employee = (Employee)Session["Employee"];
            return(View(C));
        }