예제 #1
0
        public ActionResult Print(int ClaimID)
        {
            ClaimInternalPrint printView = new ClaimInternalPrint();

            List<Comment> comments = new List<Comment>();
            List<FileHeader> filesH = new List<FileHeader>();
            List<ClaimDetail> items = new List<ClaimDetail>();

            #region Fetch Claim data and set Viewstate
            vw_Claim_Master_User_Loc vw = new ClaimService().GetClaimByIdForPrint(ClaimID,
                ref comments, ref filesH, ref items, !_Session.IsOnlyCustomer);
            //Set data in View
            ViewData["comments"] = comments;
            ViewData["filesH"] = filesH;
            ViewData["items"] = items;

            printView.view = vw;
            printView.comments = comments;
            printView.filesH = filesH;
            printView.items = items;
            #endregion

            //Log Activity
            new ActivityLogService(ActivityLogService.Activity.ClaimPrint).
                Add(new ActivityHistory() { ClaimID = ClaimID, ClaimText = vw.ClaimNo.ToString() });

            #region Return view based on user type

            if (_Session.IsOnlyCustomer) return View("PrintCustomer", printView); //return View("NoAccess");
            else if (_Session.IsOnlyVendor) return View("PrintVendor", printView);
            else if (_Session.IsInternal) return View("PrintInternal", printView); // View(vw);
            else return View(vw);

            #endregion
        }
예제 #2
0
        public ActionResult Archived(int ClaimID)
        {
            ClaimInternalPrint printView = new ClaimInternalPrint();

            List<Comment> comments = new List<Comment>();
            List<FileHeader> filesH = new List<FileHeader>();
            List<ClaimDetail> items = new List<ClaimDetail>();

            #region Fetch Claim data and set Viewstate
            vw_Claim_Master_User_Loc vw = new ClaimService().GetClaimByIdForPrint(ClaimID,
                ref comments, ref filesH, ref items, !_Session.IsOnlyCustomer);

            vw.ClaimGUID = System.Guid.NewGuid().ToString();

            //Set data in View
            ViewData["comments"] = comments;
            ViewData["filesH"] = filesH;
            ViewData["items"] = items;

            printView.view = vw;
            printView.comments = comments;
            printView.filesH = filesH;
            printView.items = items;
            #endregion

            if (vw.ID == Defaults.Integer && vw.StatusID == Defaults.Integer && vw.AssignedTo == Defaults.Integer)
            { ViewData["Message"] = "Claim not found"; return View("DataNotFound"); /* deleted claim accessed from Log*/}

            //Reset the Session Claim object
            //Claim claimObj = ClaimService.GetClaimObjFromVW(vw);

            if (vw == null || vw.ID < 1)//Empty so invalid ClaimID - go to Home
                return RedirectToAction("List", "Dashboard");

            return View(printView);
        }