Example #1
0
        private object InitialViewShowDocument(Guid id, ProcessView process, DocumentTable docuTable, ApplicationUser userTable, EmplTable emplTable)
        {
            var viewModel = new DocumentComposite();

            viewModel.ProcessView    = process;
            viewModel.DocumentTable  = docuTable;
            viewModel.docData        = _DocumentService.GetDocumentView(id);
            viewModel.fileId         = docuTable.FileId;
            viewModel.WFTrackerItems = _WorkflowTrackerService.GetPartialView(x => x.DocumentTableId == id);

            ViewBag.CreatedDate = _SystemService.ConvertDateTimeToLocal(userTable, docuTable.CreatedDate);
            if (emplTable != null)
            {
                ViewBag.Initiator      = emplTable.ApplicationUserId != null ? emplTable.FullName : docuTable.ApplicationUserCreatedId;
                ViewBag.TitleName      = emplTable.TitleTableId != null ? emplTable.TitleTable.TitleName : String.Empty;
                ViewBag.DepartmentName = emplTable.DepartmentTableId != null ? emplTable.DepartmentTable.DepartmentName : String.Empty;
                ViewBag.CompanyName    = emplTable.CompanyTableId != null ? emplTable.CompanyTable.AliasCompanyName : String.Empty;
            }
            else
            {
                ViewBag.Initiator      = String.Empty;
                ViewBag.TitleName      = String.Empty;
                ViewBag.DepartmentName = String.Empty;
                ViewBag.CompanyName    = String.Empty;
            }

            return(viewModel);
        }
Example #2
0
        public IEnumerable <CommentView> GetPartialView(Expression <Func <CommentTable, bool> > predicate)
        {
            var comments = GetPartial(predicate);
            List <CommentView> commentsView  = new List <CommentView>();
            string             localUserName = getCurrentUserName();
            ApplicationUser    user          = _AccountService.FirstOrDefault(x => x.UserName == localUserName);

            foreach (var comment in comments)
            {
                EmplView empl = _EmplService.FirstOrDefaultView(x => x.ApplicationUserId == comment.ApplicationUserCreatedId);
                commentsView.Add(new CommentView {
                    Id = comment.Id, Comment = comment.Comment, CreatedDate = _SystemService.ConvertDateTimeToLocal(user, comment.CreatedDate), EmplName = empl.FullName, TitleName = empl.TitleName
                });
            }

            return(commentsView);
        }