Exemplo n.º 1
0
        public ActionResult AddNotification(int TaskID)
        {
            staticTaskid = TaskID;
            oasisTask Mytask = new oasisTask("Select");

            Session.Remove("taskID");


            Tasks t = new Tasks();


            List <Tasks> TasksValues = Mytask.GetTasks();


            foreach (var myt in TasksValues)
            {
                if (myt.id == TaskID)
                {
                    t = myt;
                }
            }
            Session["taskID"] = TaskID;


            return(View(t));
        }
Exemplo n.º 2
0
        public ActionResult ViewReport()
        {
            oasisTask    notifications = new oasisTask("Select");
            List <Tasks> pNotiList     = new List <Tasks>();

            pNotiList = notifications.GetTasks();

            //get emploees name
            List <Users> userManager = new List <Users>();
            UserAccounts AccountList = new UserAccounts("Select");

            userManager = AccountList.Login();

            List <EverageModel> obj = new List <EverageModel>();

            int totalTask = 1;

            int count = 0;

            foreach (var E in userManager)
            {
                EverageModel objdata = new EverageModel();

                int completedCount    = 0;
                int notcompletedCount = 0;

                for (int i = 0; i < pNotiList.Count(); i++)
                {
                    if (E.id == pNotiList[i].Fk_EmployeeID)
                    {
                        if (pNotiList[i].TaskStatus == "Completed")
                        {
                            completedCount += 1;
                        }
                        else
                        {
                            notcompletedCount += 1;
                        }
                    }


                    totalTask += 1;
                }

                if (completedCount != 0 && notcompletedCount != 0)
                {
                    objdata.CompletedTaskEv = Convert.ToDecimal(completedCount) / Convert.ToDecimal((completedCount + notcompletedCount)) * 100;
                    //decimal y = Convert.ToDecimal( notCompletedCount) / Convert.ToDecimal(totalTask) ;
                }
                objdata.EmployeeName = E.FullNames;
                obj.Add(objdata);
                count += 1;
            }

            Session["perfomance"] = obj;

            return(View());
        }
Exemplo n.º 3
0
        public ActionResult TaskAvarage()
        {
            //get oasisTask
            oasisTask    notifications = new oasisTask("Select");
            List <Tasks> pNotiList     = new List <Tasks>();

            pNotiList = notifications.GetTasks();

            //get emploees name
            List <Users> userManager = new List <Users>();
            UserAccounts AccountList = new UserAccounts("Select");

            userManager = AccountList.Login();

            List <EverageModel> obj = new List <EverageModel>();

            int totalTask = 0;

            for (int i = 0; i < pNotiList.Count(); i++)
            {
                totalTask += 1;
            }
            int count = 0;

            foreach (var E in userManager)
            {
                EverageModel objdata = new EverageModel();

                int completedCount    = 0;
                int notCompletedCount = 0;
                for (int i = 0; i < pNotiList.Count(); i++)
                {
                    if (E.id == pNotiList[i].Fk_EmployeeID)
                    {
                        if (pNotiList[i].TaskStatus == "Completed")
                        {
                            completedCount += 1;
                        }
                        else
                        {
                            notCompletedCount += 1;
                        }
                    }
                }
                if (completedCount != 0 && notCompletedCount != 0)
                {
                    objdata.CompletedTaskEv = Convert.ToDecimal(completedCount) / Convert.ToDecimal(totalTask) * (100);
                    //decimal y = Convert.ToDecimal( notCompletedCount) / Convert.ToDecimal(totalTask) ;
                    objdata.NotCompletedTaskEv = Convert.ToDecimal(notCompletedCount) / Convert.ToDecimal(totalTask) * (100);;
                }
                objdata.EmployeeName = E.FullNames;
                obj.Add(objdata);
                count += 1;
            }

            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult AddNotification(string Notification)
        {
            NotificationsDisplay notifications = new NotificationsDisplay();

            notifications.CreateAnotification("A mantainance task is completed new readings : " + Notification, "Manager");
            oasisTask updateTask = new oasisTask("Update");

            updateTask.Update(staticTaskid);
            return(RedirectToAction("HomeIndex", "Home"));
        }
Exemplo n.º 5
0
        public ActionResult OasisTask(string NewTask, string id)
        {
            oasisTask MynewTask = new oasisTask("Insert_no_model");

            MynewTask.NewTask(Convert.ToInt32(Session["userId"]), "oasisTask", NewTask);

            NotificationsDisplay notifications = new NotificationsDisplay();

            notifications.Delete(Convert.ToInt32(id));
            return(RedirectToAction("GetTask"));
        }
Exemplo n.º 6
0
        public ActionResult OpenTask()
        {
            oasisTask notifications = new oasisTask("Select");

            List <Tasks> pNotiList = new List <Tasks>();

            pNotiList = notifications.GetTasks();

            Session.Remove("taskDetail");

            return(Json(pNotiList, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        //Get All tasks

        public ActionResult GetTask()
        {
            oasisTask notifications = new oasisTask("Select");

            List <Tasks> pNotiList = new List <Tasks>();

            pNotiList = notifications.GetTasks();

            Session.Remove("taskDetail");

            return(View(pNotiList));
        }
Exemplo n.º 8
0
        public ActionResult Filltask(string Taksdetail)
        {
            oasisTask            MynewTask     = new oasisTask("Insert_no_model");
            NotificationsDisplay notifications = new NotificationsDisplay();

            MynewTask.NewTask(Convert.ToInt32(Session["userId"]), "assgined", Taksdetail);


            if (Session["userRole"].ToString() == "ProccessMaintananceEmployee")
            {
                notifications.CreateAnotification("A task with detail : " + Taksdetail + " has been established to fix checklist readings", "Manager");
            }
            else
            {
                notifications.CreateAnotification("A task with detail : " + Taksdetail + " is fulfilled", "Manager");
            }

            return(RedirectToAction("GetTask"));
        }
Exemplo n.º 9
0
        //task collaboration
        public ActionResult TaskColobaration()
        {
            oasisTask notifications = new oasisTask("Select");

            List <Tasks> pNotiList = new List <Tasks>();


            pNotiList = notifications.GetTasks();


            List <Users> userManager = new List <Users>();


            UserAccounts AccountList = new UserAccounts("Select");

            Session["userdetails"] = AccountList.Login();

            return(View(pNotiList));
        }
Exemplo n.º 10
0
        public void autoclose()
        {
            oasisTask notifications = new oasisTask("Select");

            List <Tasks> pNotiList = new List <Tasks>();

            pNotiList = notifications.GetTasks();


            Task <string> tasks = new Task <string>(getlocaltime);

            foreach (var t in pNotiList)
            {
                if (t.TaskStatus != "Completed")
                {
                    int day    = t.dateAssigned.Day - DateTime.Now.Day;
                    int month  = t.dateAssigned.Month - DateTime.Now.Month;
                    int year   = t.dateAssigned.Year - DateTime.Now.Year;
                    int minute = (t.dateAssigned.Minute) + DateTime.Now.Minute;
                    int hour   = t.dateAssigned.Hour - DateTime.Now.Hour;

                    int y = System.Math.Abs(year);
                    int m = System.Math.Abs(month);

                    int d = System.Math.Abs(day);
                    int h = System.Math.Abs(hour);

                    int mn = System.Math.Abs(minute);

                    if (mn > 60 && h >= 1 && m == 0 && y == 0 && day == 0)
                    {
                        oasisTask updateTask = new oasisTask();

                        updateTask.autoclose(t.id);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public ActionResult UpdateTask(int TaskID)
        {
            EditTaskID = TaskID;
            Session.Remove("EditaskID");

            if (Session["UserRole"].ToString() == "ProccessMaintananceEmployee")
            {
                return(RedirectToAction("AddNotification", new { TaskID = TaskID }));
            }
            if (Session["UserRole"].ToString() == "Packeger")
            {
                return(RedirectToAction("AddNotification", new { TaskID = TaskID }));
            }
            else
            {
                oasisTask updateTask = new oasisTask("Update");

                updateTask.Update(TaskID);



                return(RedirectToAction("GetTask"));
            }
        }
Exemplo n.º 12
0
        public ActionResult PeekData()
        {
            //get oasisTask
            oasisTask    notifications = new oasisTask("Select");
            List <Tasks> pNotiList     = new List <Tasks>();

            pNotiList = notifications.GetTasks();

            //get emploees name
            List <Users> userManager = new List <Users>();
            UserAccounts AccountList = new UserAccounts("Select");

            userManager = AccountList.Login();

            List <EverageModel> DailyPeek = new List <EverageModel>();

            int totalTask = 1;
            // int count = 0;
            int completedCount    = 0;
            int notCompletedCount = 0;

            if (pNotiList.Count() != 0)
            {
                DateTime     day     = pNotiList[0].dateAssigned;
                EverageModel objdata = new EverageModel();

                for (int i = 0; i < pNotiList.Count(); i++)
                {
                    if (day.DayOfYear == pNotiList[i].dateAssigned.DayOfYear)
                    {
                        if (pNotiList[i].TaskStatus == "Completed")
                        {
                            completedCount += 1;
                        }
                        else
                        {
                            notCompletedCount += 1;
                        }

                        totalTask += 1;
                    }
                    else
                    {
                        if (completedCount != 0 && notCompletedCount != 0)
                        {
                            day = pNotiList[i].dateAssigned;
                            objdata.CompletedTaskEv = Convert.ToDecimal(completedCount) / Convert.ToDecimal(completedCount + notCompletedCount) * 100;
                            //decimal y = Convert.ToDecimal( notCompletedCount) / Convert.ToDecimal(totalTask) ;
                            objdata.NotCompletedTaskEv = Convert.ToDecimal(notCompletedCount) / Convert.ToDecimal(completedCount + notCompletedCount) * 100;
                        }

                        objdata.PeekDate = pNotiList[i].dateAssigned;
                        DailyPeek.Add(objdata);

                        objdata = new EverageModel();
                    }
                }
            }



            return(Json(DailyPeek, JsonRequestBehavior.AllowGet));
        }