Exemplo n.º 1
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.º 2
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.º 3
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));
        }