예제 #1
0
        public ActionResult SearchPost(IntroductoryInformationSearchVM model, int page = 1)
        {
            // Iterate through form keys
            foreach (string Key in Request.Form.Keys)
            {
                // Test if Select button was clicked...
                if (Key.StartsWith("Search::SearchPost_"))
                {
                    // Retrieve ID for entity which was selected
                    Guid Value = Guid.Parse(Key.Substring(19));

                    // Store ID for Edit screen
                    sessionManager.IntroductoryInformationCode = Value.ToString();

                    // Call out to Edit screen
                    return(RedirectToAction("Edit", "IntroductoryInformation", new { code = Value }));
                }
            }

            // Return to the Screen
            return(View(model));
        }
예제 #2
0
        public ActionResult Search(int page = 1)
        {
            // Create service instance
            IUcbService sc = UcbService;

            // Create model
            IntroductoryInformationSearchVM model = new IntroductoryInformationSearchVM();

            try
            {
                IntroductoryInformationSearchVMDC response = sc.SearchIntroductoryInformation(CurrentUser, CurrentUser, appID, "", null, page, PageSize);

                // Close service communication
                ((ICommunicationObject)sc).Close();

                //Map response back to view model
                model.MatchList = Mapper.Map <IEnumerable <IntroductoryInformationSearchMatchDC>, List <IntroductoryInformationSearchMatchModel> >(response.MatchList);

                // Set paging values
                model.TotalRows  = response.RecordCount;
                model.PageSize   = sessionManager.PageSize;
                model.PageNumber = page;

                // Store the page number we were on
                sessionManager.IntroductoryInformationPageNumber = model.PageNumber;

                return(View(model));
            }
            catch (Exception e)
            {
                // Handle the exception
                string message = ExceptionManager.HandleException(e, (ICommunicationObject)sc);
                model.Message = message;

                return(View(model));
            }
        }