Exemplo n.º 1
0
        public void Get_AdjusterByAdjusterID()
        {
            var getAdjusterDetails = _adjusterImplBL.GetAdjusterByAdjusterID(1);

            Assert.IsTrue(getAdjusterDetails != null, "Unable to find");
        }
Exemplo n.º 2
0
        public ActionResult Index(int id)
        {
            if (id != int.Parse(GlobalConst.ConstantChar.Zero))
            {
                FileDetailViewModel FileDetailViewModel = new FileDetailViewModel();
                try
                {
                    FileDetailViewModel.FileDetail = Mapper.Map <FileDetail>(_fileBL.GetFileDetailByFileId(id));
                    if (FileDetailViewModel.FileDetail != null)
                    {
                        FileDetailViewModel.FileDetail.Departments = Mapper.Map <IEnumerable <Department> >(_department.GetDepartment());

                        FileDetailViewModel.FileDetail.States = Mapper.Map <IEnumerable <State> >(_stateBL.GetState());


                        //else{
                        //    FileDetailViewModel.FileDetail.Departments = Mapper.Map<IEnumerable<Department>>(_department.GetDepartment().Where(x => x.DepartmentId != 5));

                        //}


                        var getAllInvoices = _invoice.GetInvoiceRecordByFileId(FileDetailViewModel.FileDetail.FileID, GlobalConst.Records.Skip, GlobalConst.Records.Take);
                        if (FileDetailViewModel.FileDetail.IsLienAdjusterID)
                        {
                            FileDetailViewModel.FileDetail.AdjusterDetails = Mapper.Map <AdjusterSearch>(_adjusterBL.GetLienAdjusterByAdjusterID(FileDetailViewModel.FileDetail.AdjusterId));
                        }
                        else
                        {
                            FileDetailViewModel.FileDetail.AdjusterDetails = Mapper.Map <AdjusterSearch>(_adjusterBL.GetAdjusterByAdjusterID(FileDetailViewModel.FileDetail.AdjusterId));
                        }
                        InvoiceViewModel InvoiceViewModel = new LMGEDIApp.Domain.Models.InvoiceModel.InvoiceViewModel();
                        InvoiceViewModel.InvoiceDetails      = getAllInvoices.InvoiceDetails.Select(InvoiceResult => new Invoice().InjectFrom(InvoiceResult)).Cast <Invoice>().ToList();
                        InvoiceViewModel.InvoiceCount        = getAllInvoices.TotalCount;
                        FileDetailViewModel.InvoiceViewModel = InvoiceViewModel;
                        return(View(FileDetailViewModel));
                    }
                    else
                    {
                        return(View());
                    }
                }
                catch (Exception ex)
                {
                    _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace);
                    return(View());
                }
            }
            else
            {
                return(View());
            }
        }