Exemple #1
0
        public ActionResult ProcessApproval(ApproveModel am)
        {
            List <Approval> vMApproval   = new List <Approval>();
            Int32           iReturnValue = 0;
            Int32           iNextValue   = 0;


            vMApproval = approvalRepository.GetApprovalListByStatus(am.ID, "P");

            foreach (Approval ap in vMApproval)
            {
                if (ap.Status.ToUpper().Equals("P"))
                {
                    if (am.Action.ToUpper().Equals("APPROVE"))
                    {
                        ap.Status = "A";
                    }
                    else
                    {
                        ap.Status       = "D";
                        ap.RejectReason = am.Reason;
                    }
                    string User = Session[SessionName.UserName.ToString()].ToString();

                    if (User.ToUpper().Equals("TTILLOTSON"))
                    {
                        User = "******";
                    }

                    ap.UpdatedUserName = User;

                    iReturnValue = approvalRepository.UpdateApprovalRoute(ap);

                    iNextValue = approvalRepository.InsertNextLevelForApproval(ap);
                }
            }
            return(View(iReturnValue));
        }