Пример #1
0
        public ActionResult Active(string UserID = null)
        {
            if (Functions.NoSession())
            {
                return(RedirectToAction("Login", "Authentication"));
            }

            if (UserID != null && !DB_Functions.CheckUserManager(UserID))
            {
                return(new HttpNotFoundResult());
            }
            var a = DB_Functions.ActiveList(UserID);

            ViewBag.helpMessage = "This page contains a list of the FRDs that have been created by you and then approved. \n" +
                                  "FRDs created by you and not approved yet can be found in the 'Pending Requests' page.\n";


            FrdsList viewModel = new FrdsList()
            {
                List      = a,
                PageTitle = "Active Requets"
            };

            if (viewModel.List.Count > 0)
            {
                return(View(viewModel));
            }
            else
            {
                NoFRD viewModel1 = new NoFRD()
                {
                    Heading            = "You currently have no active FRDS available",
                    PrimaryParagraph   = "To create and submit a new FRD, go to 'New Request' page",
                    SecondaryParagraph = "",
                    LastParagraph      = "",
                    ButtonText         = "GO TO NEW REQUEST",
                    ButtonLink         = "Request/New",
                    Page = NoFRD.menuitem.Active
                };

                return(View("noFRD", viewModel1));
            }
        }
Пример #2
0
        public ActionResult ReceivedM()
        {
            if (Functions.NoSession())
            {
                return(RedirectToAction("Login", "Authentication"));
            }
            if (!Functions.IsManager())
            {
                return(new HttpNotFoundResult());
            }

            FrdsList viewModel = new FrdsList {
                List = DB_Functions.ReceivedListAsManager()
            };

            ViewBag.helpMessage = "This page contains a list of the FRDs that you have received from other users. \n" +
                                  "The FRDs listed here are the ones you received because you are the manager of employees who submitted and FRD. \n" +
                                  "These FRDs are awaiting your approval or rejection in order to continue their process to the next phase";


            if (viewModel.List.Count > 0)
            {
                return(View(viewModel));
            }
            else
            {
                NoFRD viewModel1 = new NoFRD()
                {
                    Heading            = "There are currently no received FRDS available",
                    PrimaryParagraph   = "Received FRDs are listed here if you are a manager of an employee who submitted an FRD",
                    SecondaryParagraph = "",
                    LastParagraph      = "",
                    ButtonText         = "GO TO HOME PAGE",
                    ButtonLink         = "Home/Index",
                    Page = NoFRD.menuitem.ReceivedM
                };
                return(View("noFRD", viewModel1));
            }
        }
Пример #3
0
        public ActionResult ReceivedU(string UserID = null)
        {
            if (Functions.NoSession())
            {
                return(RedirectToAction("Login", "Authentication"));
            }
            if (UserID != null && !DB_Functions.CheckUserManager(UserID))
            {
                return(new HttpNotFoundResult());
            }
            FrdsList viewModel = new FrdsList
            {
                List = DB_Functions.ReceivedListAsUser(UserID)
            };


            ViewBag.helpMessage = "This page contains a list of the FRDs that you have received from other users. \n" +
                                  "The FRDs listed here are the ones you received because you were selected as a recepient of the FRD during its creation.";

            if (viewModel.List.Count > 0)
            {
                return(View(viewModel));
            }
            else
            {
                NoFRD viewModel1 = new NoFRD()
                {
                    Heading            = "There are currently no received FRDS available",
                    PrimaryParagraph   = "Received FRDs are listed here if you were selected as a recepient of the FRD during its creation by an employee",
                    SecondaryParagraph = "",
                    LastParagraph      = "",
                    ButtonText         = "GO TO HOME PAGE",
                    ButtonLink         = "Home/Index",
                    Page = NoFRD.menuitem.ReceivedU
                };
                return(View("noFRD", viewModel1));
            }
        }
Пример #4
0
        public ActionResult Pending()
        {
            if (Functions.NoSession())
            {
                return(RedirectToAction("Login", "Authentication"));
            }
            var a = DB_Functions.PendingList();

            ViewBag.helpMessage = "This page contains a list of the FRDs that have been created by you and have not been approved yet. \n" +
                                  "FRDs created by you and that have been approved can be found in the 'Active Requests' page.\n";


            FrdsList viewModel = new FrdsList()
            {
                List = a
            };

            if (viewModel.List.Count > 0)
            {
                return(View(viewModel));
            }
            else
            {
                NoFRD viewModel1 = new NoFRD()
                {
                    Heading            = "There are currently no pending FRDS available",
                    PrimaryParagraph   = "FRDs appear as pending if you submitted an FRD and you are waiting for a manager's approval",
                    SecondaryParagraph = "To create and submit a new FRD, go to 'New Request' page",
                    LastParagraph      = "",
                    ButtonText         = "GO TO NEW REQUEST",
                    ButtonLink         = "Request/New",
                    Page = NoFRD.menuitem.Pending
                };
                return(View("noFRD", viewModel1));
            }
        }
Пример #5
0
        public ActionResult Closed(string op = "all", string UserID = null)
        {
            string frdMessage = "";


            if (Functions.NoSession())
            {
                return(RedirectToAction("Login", "Authentication"));
            }
            List <ActiveClosedFRDItem> list;
            int op_int = 0;

            if (UserID == null)
            {
                switch (op)
                {
                case "all":
                    op_int = 0;
                    list   = DB_Functions.ClosedList(op_int);
                    break;

                case "me":
                    op_int = 1;
                    list   = DB_Functions.ClosedList(op_int);
                    break;

                case "other":
                    op_int = 2;
                    list   = DB_Functions.ClosedList(op_int);
                    break;

                default:
                    op_int = 0;
                    list   = DB_Functions.ClosedList(op_int);
                    break;
                }
            }
            else
            {
                if (!DB_Functions.CheckUserManager(UserID))
                {
                    return(new HttpNotFoundResult());
                }
                op_int = 1;
                list   = DB_Functions.ClosedList(op_int, UserID);
            }


            var viewModel = new FrdsList()
            {
                List      = list,
                PageTitle = "Closed Requests"
            };

            ViewBag.helpMessage = "This page contains a list of the FRDs that have been closed. \n" +
                                  "•All: All FRDs that have been closed and are related to you.\n•My FRDs: FRDs that you own and that have been closed. \n•Others' FRDs: FRDs that others own and that have been closed.";


            if (viewModel.List.Count > 0)
            {
                return(View(viewModel));
            }
            else
            {
                switch (op)
                {
                case "all":
                    frdMessage = "";

                    break;

                case "me":
                    frdMessage = "owned by you";

                    break;

                case "other":
                    frdMessage = "owned by others";
                    break;
                }


                NoFRD viewModel1 = new NoFRD()
                {
                    Heading            = "There are currently no Closed FRDS " + frdMessage,
                    PrimaryParagraph   = "FRDs " + frdMessage + " are listed here if they have been closed",
                    SecondaryParagraph = "Your active FRDs can be found in the 'Active Requests' page",
                    LastParagraph      = "",
                    ButtonText         = "GO TO ACTIVE REQUESTS",
                    ButtonLink         = "Request/Active",
                    Page = op_int == 0 ? NoFRD.menuitem.ClosedAll : op_int == 1 ? NoFRD.menuitem.ClosedMe : NoFRD.menuitem.ClosedOthers
                };
                return(View("noFRD", viewModel1));
            }
        }