public ActionResult Index(string id)
        {
            if (Request.IsAuthenticated)
            {
                AuthenticateUser();

                int idDecrypted = Security.DecryptId(Convert.ToString(id));

                ViewData["OPDEXPENSE_ID"] = idDecrypted;


                var opdExpenseService = _opdExpenseService.GetOpdExpensesAgainstId(Convert.ToInt32(idDecrypted));

                var opdExpense_Patient = _opdExpensePatientService.GetOpdExpensesPatientAgainstOpdExpenseId(Convert.ToInt32(idDecrypted));

                var objOpdExpensePatient = new OpdExpensePatientVM();

                ViewData["OPDTYPE"] = opdExpenseService.OpdType;
                //Add a Dummy Row.
                opdExpense_Patient.Insert(0, objOpdExpensePatient);

                return(View(opdExpense_Patient));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public ActionResult Index(string id)
        {
            if (Request.IsAuthenticated)
            {
                AuthenticateUser();

                int idDecrypted = Security.DecryptId(Convert.ToString(id));

                var opdExpenseService = _opdExpenseService.GetOpdExpensesAgainstId(idDecrypted);

                ViewData["OPDTYPE"]       = opdExpenseService.OpdType;
                ViewData["OPDEXPENSE_ID"] = idDecrypted;

                ImgTravelModel model = new ImgTravelModel {
                    FileAttach = null, ImgLst = new List <TravelExpenseVM>()
                };

                model.ImgLst = _travelExpenseService.GetTravelExpensesAgainstOpdExpenseId(idDecrypted);

                model.OPDExpenseID = idDecrypted;
                return(this.View(model));
            }
            else
            {
                return(RedirectToAction(UrlIndex, UrlHome));
            }
        }
        public static HospitalExpenseVM GetHospitalExpense(int Id, IOpdExpenseService _opdExpenseService, IOpdExpensePatientService _opdExpensePatientService, IOpdExpenseImageService _opdExpenseImageService)
        {
            OpdExpenseVM opdExpense = _opdExpenseService.GetOpdExpensesAgainstId(Id);


            var hospitalInformation = new HospitalExpenseVM()
            {
                OpdExpensePatients = _opdExpensePatientService.GetOpdExpensesPatientAgainstOpdExpenseId(Id),
                OpdExpenseImages   = _opdExpenseImageService.GetOpdExpensesImageAgainstOpdExpenseId(Id),

                ID = opdExpense.ID,
                ClaimantSufferedIllness        = opdExpense.ClaimantSufferedIllness,
                ClaimantSufferedIllnessDetails = opdExpense.ClaimantSufferedIllnessDetails,
                ClaimantSufferedIllnessDate    = opdExpense.ClaimantSufferedIllnessDate,
                DateIllnessNoticed             = opdExpense.DateIllnessNoticed,
                DateRecovery               = opdExpense.DateRecovery,
                Diagnosis                  = opdExpense.Diagnosis,
                DoctorName                 = opdExpense.DoctorName,
                DrugsPrescribedBool        = opdExpense.DrugsPrescribedBool,
                DrugsPrescribedDescription = opdExpense.DrugsPrescribedDescription,
                EmployeeDepartment         = opdExpense.EmployeeDepartment,
                EmployeeName               = opdExpense.EmployeeName,
                EmployeeEmailAddress       = opdExpense.EmployeeEmailAddress,

                HospitalName = opdExpense.HospitalName,

                FinanceApproval     = opdExpense.FinanceApproval,
                FinanceComment      = opdExpense.FinanceComment,
                FinanceApprovalDate = opdExpense.FinanceApprovalDate,
                FinanceEmailAddress = opdExpense.FinanceEmailAddress,
                FinanceName         = opdExpense.FinanceName,


                HrApproval     = opdExpense.HrApproval,
                HrComment      = opdExpense.HrComment,
                HrName         = opdExpense.HrName,
                HrApprovalDate = opdExpense.HrApprovalDate,
                HrEmailAddress = opdExpense.HrEmailAddress,


                ManagementApproval     = opdExpense.ManagementApproval,
                ManagementComment      = opdExpense.ManagementComment,
                ManagementName         = opdExpense.ManagementName,
                ManagementApprovalDate = opdExpense.ManagementApprovalDate,
                ManagementEmailAddress = opdExpense.ManagementEmailAddress,


                PeriodConfinementDateFrom = opdExpense.PeriodConfinementDateFrom,
                PeriodConfinementDateTo   = opdExpense.PeriodConfinementDateTo,
                Status                   = opdExpense.Status,
                OpdType                  = opdExpense.OpdType,
                TotalAmountClaimed       = opdExpense.TotalAmountClaimed,
                TotalAmountApproved      = opdExpense.TotalAmountApproved,
                ClaimYear                = opdExpense.ClaimYear,
                ClaimMonth               = opdExpense.ClaimMonth,
                CreatedDate              = opdExpense.CreatedDate,
                ModifiedDate             = opdExpense.ModifiedDate,
                PhysicalDocumentReceived = opdExpense.PhysicalDocumentReceived,
                PayRollMonth             = opdExpense.PayRollMonth,
                ExpenseNumber            = opdExpense.ExpenseNumber,
                OpdEncrypted             = opdExpense.OpdEncrypted,
                HospitalizationType      = opdExpense.HospitalizationType,
                MaternityType            = opdExpense.MaternityType
            };

            return(hospitalInformation);
        }