Beispiel #1
0
        // GET: RFQ
        public ActionResult Index(string rfp_key)
        {
            var request = _rfpFacade.Find(rfp_key);

            if (request.Success)
            {
                ViewData["Product"] = _searchFacade.FindRfpProduct(request.Result.rfp_prd_key.ToString());
                return(View(request.Result));
            }
            else
            {
                ViewData["Product"] = new ProductOrganizationViewModel();
                return(View(new RfpRequest()));
            }
        }
Beispiel #2
0
        public ActionResult IndividualResult(string prdkey = null)
        {
            ViewData["prdkey"] = prdkey;

            var response = new AppResponseModel <ProductOrganizationViewModel>();

            if (string.IsNullOrEmpty(prdkey))
            {
                response.IsSuccess = false;
                response.Message   = Messages.NoRecord;
                return(View(response));
            }

            try
            {
                var RfpProduct = _searchFacade.FindRfpProduct(prdkey);

                if (RfpProduct != null)
                {
                    if (SessionHelper.CurrentUser != null && (SessionHelper.CurrentUser.User.org_key.ToString() != RfpProduct.org_key.ToString()))
                    {
                        _miscFacade.ViewPage(new CoPageView
                        {
                            pv_key           = Guid.NewGuid(),
                            pv_rfp_key       = null,
                            pv_prd_key       = RfpProduct.prd_key,
                            pv_source_ct_key = SessionHelper.CurrentUser.User.ct_key,
                            pv_add_user      = SessionHelper.CurrentUser.User.ct_key.ToString(),
                            pv_view_datetime = DateTime.Now
                        });
                    }

                    response.IsSuccess = true;
                    response.Data      = RfpProduct;
                    response.Message   = Messages.Found;
                    return(View(response));
                }
                else
                {
                    response.IsSuccess = true;
                    response.Message   = Messages.NoRecord;
                    return(View(response));
                }
            }
            catch (Exception ex)
            {
                response.DeveloperMessage = ex.Message;
                response.Message          = Messages.ServerError;
                return(View(response));
            }
        }