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
        }
        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);
        }
        public ActionResult Manage(int ClaimID, bool? printClaimAfterSave)
        {
            ViewData["oprSuccess"] = base.operationSuccess; //oprSuccess will be reset after this
            ViewData["printClaimAfterSave"] = (TempData["printClaimAfterSave"]??false);

            #region Add mode - add new and return it in editmode
            if (ClaimID <= Defaults.Integer)
            {// HT: CAREFUL: Add mode in which we need to add a new record
                // Also handles special case for customer to set default SP for him
                string spNameForCustomer = string.Empty;
                Claim NewClaim = new ClaimService().AddDefault(_SessionUsr.ID, _SessionUsr.OrgID, _Session.IsOnlyCustomer, ref spNameForCustomer);
                //Session.Claims[NewClaim.ClaimGUID] = NewClaim;
                //return RedirectToAction("Manage", new { ClaimID = NewClaim.ID, ClaimGUID = NewClaim.ClaimGUID });
                ClaimKOModel vmClaim = doAddEditPopulateKO(ClaimService.GetVWFromClaimObj(NewClaim, spNameForCustomer));
                return View(vmClaim);
            }
            #endregion

            #region Edit mode
            else
            {
                #region Get Claim view and check if its empty or archived - redirect

                vw_Claim_Master_User_Loc vw = new ClaimService().GetClaimById(ClaimID);

                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*/
                }
                // In case an archived entry is accessed
                if (vw.Archived)
                    return RedirectToAction("Archived", new { ClaimID = ClaimID });
                //Empty so invalid ClaimID - go to Home
                if (vw == new ClaimService().emptyView)
                    return RedirectToAction("List", "Dashboard");

                #endregion

                //Reset the Session Claim object
                Claim claimObj = ClaimService.GetClaimObjFromVW(vw);
                //_Session.Claim = claimObj;
                //_Session.Claims[claimObj.ClaimGUID] = claimObj;// Populate original obj

                ClaimKOModel vmClaim = doAddEditPopulateKO(vw);
                return View(vmClaim);
            }
            #endregion
        }