コード例 #1
0
        public ActionResult Create(DA.Models.Customer customer)
        {
           
            var request = new DA.Models.Request {
                RequestType = RequestConfigHelper.GetRequestType(RequestTypeConstants.NEW_AFFILIATION).Value,
                Status = RequestState.DRAFT.Value,
                CreatedBy ="User",
                CreatedDate=DateTime.Now,
                RequestDescription="New Affilation",
                NewAffiliation = new DA.Models.NewAffiliation {
                    Customer = customer
                }

            };
            //unitOfWork.BusinessRepository.Add(business);
            unitOfWork.RequestRepository.Add(request);
            unitOfWork.Complete();
            
            return RedirectToAction("Draft", "RequestUIFlow", new { Id = request.Id });
        }
コード例 #2
0
        // GET: Requests
        public ActionResult Index()
        {
            List<Models.RequestViewModel> list = new List<Models.RequestViewModel>();
            int requestType = RequestConfigHelper.GetRequestType("NEW_AFFILIATION").Value;
            unitOfWork.RequestRepository.Find(x => x.RequestType.Equals(requestType), x => x.NewAffiliation).ToList().ForEach(x => list.Add(new Models.RequestViewModel
            {
                Id = x.Id,
                RequestDescription = x.RequestDescription,
                CreatedBy = x.CreatedBy,
                CreatedDate = x.CreatedDate,
                //Status = x.Status==1 || x.Status == 11 || x.Status == 12 || x.Status == 25 ?  RequestConfigHelper.GetStatusDisplayName(x.Status): "FOR " + RequestConfigHelper.GetStatusDisplayName(x.Status),
                Status = RequestConfigHelper.GetStatusDisplayName(x.Status),
                View = RequestConfigHelper.GetStatusConfig(x.Status).view,
                RequestType = RequestConfigHelper.GetRequestTypeDisplayName(x.RequestType)


            }));


            return View(list);
        }