Beispiel #1
0
 /// <summary>
 /// @author: avillena
 /// @desc: draft page view
 /// @version : 1.0
 /// </summary>
 /// <returns></returns>
 public ActionResult DraftsView()
 {
     try
     {
         ViewBag.Menu       = customHelper.PrepareMenu(child: 13, parent: 0, usertype: Session["user_type"].ToString(), userId: Int32.Parse(Session["userId_local"].ToString()));
         ViewBag.Title      = "My Drafts";
         ViewBag.PageHeader = "My Drafts";
         return(View());
     }
     catch (Exception)
     {
         return(View(viewName: "~/Views/Account/login.cshtml"));
     }
 }
Beispiel #2
0
        // GET: ApproverType


        /// <summary>
        /// author: [email protected]
        /// description : Approver type maintenance view
        /// version : 1.0
        /// </summary>
        /// <returns>view</returns>
        public ActionResult ApproverType()
        {
            try
            {
                ViewBag.Menu        = custom_helper.PrepareMenu(17, 7, Session["user_type"].ToString(), Int32.Parse(Session["userId_local"].ToString()));
                ViewBag.Title       = "Approver Type";
                ViewBag.PageHeader  = "Approver Type";
                ViewBag.Breadcrumbs = "Maintenance / Approver Type";
                return(View());
            }
            catch (Exception)
            {
                return(View("~/Views/Account/login.cshtml"));
            }
        }
        // GET: AuditTrail


        /// <summary>
        /// author: [email protected]
        /// description : Audit trail page view
        /// version : 1.0
        /// </summary>
        /// <returns></returns>
        public ActionResult Audit()
        {
            try
            {
                ViewBag.Menu        = custom_helper.PrepareMenu(0, 16, Session["user_type"].ToString(), Int32.Parse(Session["userId_local"].ToString()));
                ViewBag.Title       = "Audit Trail";
                ViewBag.PageHeader  = "Audit Trail";
                ViewBag.Breadcrumbs = "Audit Trail";
                return(View());
            }
            catch (Exception)
            {
                return(View("~/Views/Account/login.cshtml"));
            }
        }
        } // End

        /// <summary>
        /// description: display the transaction page view
        /// by: [email protected]
        /// date: january 10 , 2017
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            try
            {
                ViewBag.Menu        = customHelper.PrepareMenu(child: 11, parent: 0, usertype: Session["user_type"].ToString(), userId: Int32.Parse(Session["userId_local"].ToString()));
                ViewBag.Title       = "Transaction Records";
                ViewBag.PageHeader  = "Transaction Records";
                ViewBag.Breadcrumbs = "Home / All Transactions";
                return(View());
            }
            catch (Exception)
            {
                return(View(viewName: "~/Views/Account/login.cshtml"));
            }
        }// End
Beispiel #5
0
        /// <summary>
        /// description: display 'my inbox' page
        /// by: [email protected]
        /// date: january 10 , 2017
        /// </summary>
        /// <returns></returns>
        public ActionResult InboxView()
        {
            try
            {
                ViewBag.Menu       = customHelper.PrepareMenu(child: 14, parent: 0, usertype: Session["user_type"].ToString(), userId: Int32.Parse(Session["userId_local"].ToString()));
                ViewBag.Title      = "My Inbox";
                ViewBag.PageHeader = "My Inbox";
                //ViewBag.Breadcrumbs = "Home / Gate Pass";

                string userdept = Session["department"].ToString();
                ViewBag.deptapprover = transModel.Getdeptapprover(userdept);
                return(View());
            }
            catch (Exception)
            {
                return(View(viewName: "~/Views/Account/login.cshtml"));
            }
        }
        /// <summary>
        /// desc: display 'create new gate' page
        /// by: avillena
        /// date: 01-10-17
        /// </summary>
        /// <returns></returns>
        public ActionResult GatePass()

        {
            try
            {
                string userLogin = Session.SessionID;

                ViewBag.Menu       = customHelper.PrepareMenu(child: 2, parent: 0, usertype: Session["user_type"].ToString(), userId: Int32.Parse(Session["userId_local"].ToString()));
                ViewBag.Title      = "Create New";
                ViewBag.PageHeader = "Create Gate Pass";
                ViewBag.path       = ConfigurationManager.AppSettings["local_upload_attachment"];
                DataTable dt = transModel.DeleteAllItem_Temptbl(userLogin);
                return(View());
            }
            catch (Exception e)
            {
                return(View(viewName: "~/Views/Account/login.cshtml"));
            }
        }
        public ActionResult Index()
        {
            ViewBag.Menu        = custom_helper.PrepareMenu(1, 0, Session["user_type"].ToString(), Int32.Parse(Session["userId_local"].ToString()));
            ViewBag.Title       = "Dashboard";
            ViewBag.PageHeader  = "Dashboard";
            ViewBag.Breadcrumbs = "Guard / Dashboard";

            string loginname = Session["cn"].ToString();

            string usercodeLogin   = Session["user_code"].ToString();
            int    isapproverCount = homemodel.GetifLoginApprover(usercodeLogin);

            ViewBag.loginuser = Session["department"].ToString();



            if (isapproverCount != 0)
            {
                ViewBag.loginuser = "******";
                ///get the count of pending for approval ni approver to department,IT,purchasing and accounting
                int fordepartmentpending = homemodel.GetCountForApprovalApproverDepartment(usercodeLogin);
                int forITpending         = homemodel.GetCountForApprovalApproverIT(usercodeLogin);
                int forpurchasingpending = homemodel.GetCountForApprovalApproverPurchasing(usercodeLogin);
                int foraccountingpending = homemodel.GetCountForApprovalApproverAccounting(usercodeLogin);
                ///end
                ///
                ///get the count of approved gate pass ni approver to department,IT,purchasing and accounting
                int fordepartmentapproved = homemodel.GetCountApprovedbydepartment(usercodeLogin);
                int forITapproved         = homemodel.GetCountApprovedbyIT(usercodeLogin);
                int forpurchasingapproved = homemodel.GetCountApprovedbypurchasing(usercodeLogin);
                int foraccountingapproved = homemodel.GetCountApprovedbyaccounting(usercodeLogin);
                ///end
                //////get the count of rejected gate pass ni approver to department,IT,purchasing and accounting
                int fordepartmentrejected = homemodel.GetCountRejecteddepartment(usercodeLogin);
                int forITrejected         = homemodel.GetCountRejectedIT(usercodeLogin);
                int forpurchasingrejected = homemodel.GetCountRejectedpurchasing(usercodeLogin);
                int foraccountingrejected = homemodel.GetCountRejectedaccounting(usercodeLogin);
                ///end
                ///
                ViewBag.totalcountpendingfoapproval = Convert.ToInt32(fordepartmentpending + forITpending + forpurchasingpending + foraccountingpending);
                ViewBag.ApprovedbyApprover          = Convert.ToInt32(fordepartmentapproved + forITapproved + forpurchasingapproved + foraccountingapproved);
                ViewBag.RejectedbyApprover          = Convert.ToInt32(fordepartmentrejected + forITrejected + forpurchasingrejected + foraccountingrejected);
                ViewBag.ApproverTransaction         = Convert.ToInt32(ViewBag.totalcountpendingfoapproval + ViewBag.ApprovedbyApprover + ViewBag.RejectedbyApprover);

                if (ViewBag.totalcountpendingfoapproval != 0)
                {
                    double percentagepending = (((double)ViewBag.totalcountpendingfoapproval / (double)ViewBag.ApproverTransaction) * percent);
                    ViewBag.totalcountpendingfoapprovalpercentage = Convert.ToInt32(percentagepending);
                }
                else
                {
                    ViewBag.totalcountpendingfoapprovalpercentage = 0;
                }

                if (ViewBag.ApprovedbyApprover != 0)
                {
                    double percentagapproved = (((double)ViewBag.ApprovedbyApprover / (double)ViewBag.ApproverTransaction) * percent);
                    ViewBag.ApprovedbyApproverpercentage = Convert.ToInt32(percentagapproved);
                }
                else
                {
                    ViewBag.ApprovedbyApproverpercentage = 0;
                }
                if (ViewBag.RejectedbyApprover != 0)
                {
                    double percentagapproved = (((double)ViewBag.RejectedbyApprover / (double)ViewBag.ApproverTransaction) * percent);
                    ViewBag.RejectedbyApproverpercentage = Convert.ToInt32(percentagapproved);
                }
                else
                {
                    ViewBag.RejectedbyApproverpercentage = 0;
                }
            }
            else if (ViewBag.loginuser == "Guard")
            {
                ViewBag.loginuser        = "******";
                ViewBag.ForApprovalGuard = Convert.ToInt32(homemodel.GetCountForApprovalGuard());
                ViewBag.ApprovedGuard    = Convert.ToInt32(homemodel.GetCountApprovedGuard());
                ViewBag.ReturnSlipGuard  = Convert.ToInt32(homemodel.GetCountReturnSlipGuard());
                ViewBag.RejectedGuard    = Convert.ToInt32(homemodel.GetCountRejectedGuard());
            }
            else
            {
                ViewBag.loginuser = "******";
                int addedby = Convert.ToInt32(Session["userId_local"]);
                ViewBag.Submitted     = Convert.ToInt32(homemodel.GetCountAllSubmitted(addedby));
                ViewBag.Approved      = Convert.ToInt32(homemodel.GetCountAllApproved(addedby));
                ViewBag.Rejected      = Convert.ToInt32(homemodel.GetCountAllRejected(addedby));
                ViewBag.Drafted       = Convert.ToInt32(homemodel.GetCountAllDrafted(addedby));
                ViewBag.TotalGatePass = Convert.ToInt32(homemodel.GetCountAllTotal(addedby));

                int noData = 0;
                if (ViewBag.TotalGatePass == 0)
                {
                    ViewBag.SubmittedPercentage = noData;
                    ViewBag.ApprovedPercentage  = noData;
                    ViewBag.RejectedPercentage  = noData;
                    ViewBag.DraftedPercentage   = noData;
                }
                else
                {
                    double percentagesubmitted = (((double)ViewBag.Submitted / (double)ViewBag.TotalGatePass) * percent);
                    double percentageapproved  = (((double)ViewBag.Approved / (double)ViewBag.TotalGatePass) * percent);
                    double percentagerejected  = (((double)ViewBag.Rejected / (double)ViewBag.TotalGatePass) * percent);
                    double percentagedrafted   = (((double)ViewBag.Drafted / (double)ViewBag.TotalGatePass) * percent);

                    ViewBag.SubmittedPercentage = Convert.ToInt32(percentagesubmitted);
                    ViewBag.ApprovedPercentage  = Convert.ToInt32(percentageapproved);
                    ViewBag.RejectedPercentage  = Convert.ToInt32(percentagerejected);
                    ViewBag.DraftedPercentage   = Convert.ToInt32(percentagedrafted);
                }
            }



            return(View());
        }
 /// <summary>
 /// author: [email protected]
 /// description : Admin Access Rights Maintenance View
 /// version : 1.0
 /// </summary>
 /// <returns></returns>
 public ActionResult ManageAccessRights()
 {
     try
     {
         ViewBag.Menu        = custom_helper.PrepareMenu(5, 4, Session["user_type"].ToString(), Int32.Parse(Session["userId_local"].ToString()));
         ViewBag.Title       = "Manage Access Rights";
         ViewBag.PageHeader  = "Manage Access Rights";
         ViewBag.Breadcrumbs = "Admin / Manage Access Rights";
         return(View());
     }
     catch (Exception)
     {
         return(View("~/Views/Account/login.cshtml"));
     }
 }