Ejemplo n.º 1
0
        public ActionResult CustomerAttachmentList(AttachmentSearchFilter searchFilter)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("List CustomerAttachment").Add("CustomerId", searchFilter.CustomerId)
                        .ToInputLogString());

            try
            {
                if (ModelState.IsValid)
                {
                    _commonFacade   = new CommonFacade();
                    _customerFacade = new CustomerFacade();
                    DocumentViewModel docVM = new DocumentViewModel();
                    docVM.SearchFilter = searchFilter;

                    docVM.AttachmentList  = _customerFacade.GetAttachmentList(docVM.SearchFilter);
                    ViewBag.PageSize      = docVM.SearchFilter.PageSize;
                    ViewBag.PageSizeList  = _commonFacade.GetPageSizeList();
                    ViewBag.CurrentUserId = this.UserInfo.UserId; // for check btnEdit btnDelete

                    Logger.Info(_logMsg.Clear().SetPrefixMsg("CustomerAttachmentList").ToSuccessLogString());
                    return(PartialView("~/Views/Document/_CustomerAttachmentList.cshtml", docVM));
                }

                return(Json(new
                {
                    Valid = false,
                    Error = string.Empty,
                    Errors = GetModelValidationErrors()
                }));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("List CustomerAttachment").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
Ejemplo n.º 2
0
 public IEnumerable <AttachmentEntity> GetAttachmentList(AttachmentSearchFilter searchFilter)
 {
     _customerDataAccess = new CustomerDataAccess(_context);
     return(_customerDataAccess.GetAttachmentList(searchFilter));
 }