Beispiel #1
0
 public ActionResult Create()
 {
     ViewBag.DepartmentId = new SelectList(_departmentBusiness.GetAll(), "DepartmentId", "DeptName");
     ViewBag.CourseId     = new SelectList(_courseBusiness.GetAll(), "CourseId", "CourseName");
     ViewBag.StudentId    = new SelectList(_studentBusiness.GetAll(), "StudentId", "StudentName");
     return(View());
 }
Beispiel #2
0
        // GET: Students/Create
        public ActionResult Create()
        {
            ViewBag.DepartmentId = new SelectList(_departmentBusiness.GetAll(), "DepartmentId", "DeptName");
            ViewBag.SemesterId   = new SelectList(_semesterBusiness.GetAll(), "SemesterId", "SemesterName");
            ViewBag.SeassonId    = new SelectList(_seassonBusiness.GetAll(), "SeassonId", "SeassonName");

            return(View());
        }
Beispiel #3
0
 public ActionResult Department()
 {
     try
     {
         var result = _departmentBusiness.GetAll();
         return(View(result));
     }
     catch (Exception)
     {
         return(View());
     }
 }
 public IActionResult AddUpdateEmployee()
 {
     var deptList = idepartmentBusiness.GetAll().Select(item => new { Id = item.departmentId, Name = item.departmentname }).ToList();
     ViewBag.DepartmentList = new SelectList(deptList, "Id", "Name");
     EmployeeType employeeType = EmployeeType.Sales;
     var empTypeList = EnumHelper<EmployeeType>.GetValues(employeeType).Select(item => new { Id = (int)item, Name = item.ToString() }).ToList();
     ViewBag.EmployeeType = new SelectList(empTypeList, "Id", "Name");
     return PartialView("_AddUpdateEmployee");
 }
Beispiel #5
0
        public IActionResult bindSummary()
        {
            var taskdata     = new List <TaskDepartmentViewModel>();
            var departmensts = idepartmentBusiness.GetAll();

            foreach (var department in departmensts)
            {
                var targetCompletion = db.Tasks.Where(w => w.departmentId == department.departmentId).FirstOrDefault();
                var targetCreatedOn  = db.Tasks.Where(w => w.departmentId == department.departmentId).FirstOrDefault();
                if (targetCompletion != null && targetCreatedOn != null)
                {
                    TimeSpan ts    = targetCompletion.TargetCompletionDate - DateTime.Now;
                    var      weeks = Math.Round((ts).TotalDays / 7, 0);
                    var      days  = Math.Round((ts).TotalDays % 7, 0);
                    //var curruntDate = targetCompletion.TargetCompletionDate.AddDays(Math.Round((ts).TotalDays)).TimeOfDay;
                    var hours           = ts.Hours;// Math.Round((weeks)*24);
                    var inCompleteHours = string.Format("{0} hours, {1} weeks, {2} days", hours, weeks, days);
                    var taskdept        = new TaskDepartmentViewModel
                    {
                        departmentname     = department.departmentname,
                        InCompleteHours    = inCompleteHours,
                        VisibleOnDashboard = department.VisibleOnDashboard ?? false,
                        Color = department.Color
                    };
                    taskdata.Add(taskdept);
                }
                else
                {
                    var taskdept = new TaskDepartmentViewModel
                    {
                        departmentname     = department.departmentname,
                        VisibleOnDashboard = department.VisibleOnDashboard ?? false
                    };

                    taskdata.Add(taskdept);
                }
            }

            //var data = (from task in db.Tasks
            //            join dept in db.Departments on task.departmentId equals dept.departmentId
            //            select new TaskDepartmentViewModel
            //            {
            //                departmentname = dept.departmentname
            //            //BudgetedHours = g.Sum(s => s.BudgetedHours),
            //            //description = g.First().Department.description,
            //            //created_on = g.First().Department.created_on,
            //            //updated_on = g.First().Department.updated_on
            //        }).ToList();
            ViewBag.data = taskdata;
            return(RedirectToAction("dashboard"));
        }
Beispiel #6
0
        public ActionResult AddTask()
        {
            var jobList = ijobBusiness.ddlGetAllJobs();

            ViewBag.jobList = new SelectList(jobList, "jobId", "job_name");

            var departmentList = idepartmentBusiness.GetAll();

            ViewBag.departmentList = new SelectList(departmentList, "departmentId", "departmentname");

            var usersList = iuserBusiness.GetAllUser();

            ViewBag.usersList = new SelectList(usersList, "userId", "username");
            TaskModel task = new TaskModel();

            return(PartialView("_AddTask", task));
        }
 public ActionResult Add()
 {
     ViewBag.DepartmentLst = _departmentBusiness.GetAll(true);
     return(View());
 }
        public ActionResult DepartmentList()
        {
            var data = idepartmentBusiness.GetAll();

            return(PartialView("_DepartmentList", data));
        }
Beispiel #9
0
 // GET: Departments
 public ActionResult Index()
 {
     return(View(_departmentBusiness.GetAll()));
 }