public ActionResult InvocationDetail(int?id) { try { using (var db = new StoreContext()) { InvocationItem invocationItem = db.InvocationItems.Find(id); return(View("InvocationDetail", invocationItem)); } } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Home", "SaveInvocation1"))); } }
public void Remove(Delegate handler, GenericEventHandler invoker) { var invocationItem = new InvocationItem(handler, invoker); // Do not alter the invocation list while enumerating it (_isDispatching) var invocationList = _isDispatching ? _pendingInvocationList ?? (_pendingInvocationList = new List <InvocationItem>(_invocationList)) : _invocationList; invocationList.Remove(invocationItem); // TODO: Removing handler in HTML not supported yet // var command = $"Uno.UI.WindowManager.current.unregisterEventOnView(\"{HtmlId}\", \"{eventName}\");"; // WebAssemblyRuntime.InvokeJS(command); // _isSubscribed = false; }
public ActionResult InvocationDetail(int?id) { using (var db = new StoreContext()) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InvocationItem invocationItem = db.InvocationItems.Find(id); if (invocationItem == null) { return(HttpNotFound()); } else { return(View("InvocationDetail", invocationItem)); } } }
public void Add(Delegate handler, GenericEventHandler invoker) { var invocationItem = new InvocationItem(handler, invoker); // Do not alter the invocation list while enumerating it (_isDispatching) var invocationList = _isDispatching ? _pendingInvocationList ?? (_pendingInvocationList = new List <InvocationItem>(_invocationList)) : _invocationList; if (invocationList.Contains(invocationItem)) { return; } invocationList.Add(invocationItem); if (_subscribeCommand != null && invocationList.Count == 1 && !_isSubscribed) { _subscribeCommand(); _isSubscribed = true; } }
public ActionResult Index(HomeIndexModel request) { bool isCapthcaValid = ValidateCaptcha(Request["g-recaptcha-response"]); if (!isCapthcaValid) { TempData["requestMessage"] = "Captcha ստուգումը խափանվեց"; return(View("Index", request)); } if (ModelState.IsValid) { using (var db = new StoreContext()) { switch (request.RequestTypeId) { case 1: InvocationItem item = db.InvocationItems.Find(request.RequestId); ViewBag.InvocationFile = 0; if (!String.IsNullOrEmpty(item.InvocationURL)) { ViewBag.InvocationFile = 1; } ViewBag.File1 = 0; ViewBag.File2 = 0; ViewBag.File3 = 0; ViewBag.File4 = 0; IQueryable <InvocationDocument> invocationDocuments = db.InvocationDocuments.Where(p => p.InvocationId == item.InvocationId); foreach (var invocationDocument in invocationDocuments) { switch (invocationDocument.DocumentTypeId) { case 1: ViewBag.File1 = 1; break; case 2: ViewBag.File2 = 1; break; case 3: ViewBag.File3 = 1; break; case 4: ViewBag.File4 = 1; break; default: break; } } return(View("InvocationDetail", item)); case 2: ReferralItem referralItem = db.ReferralItems.Find(request.RequestId); return(View("ReferralDetail", referralItem)); case 3: ReferralOrderItem referralOrderItem = db.ReferralOrderItems.Find(request.RequestId); return(View("ReferralOrderDetail", referralOrderItem)); default: return(View("Index", request)); } } } else { TempData["requestMessage"] = "Մոդելի սխալ"; return(View("Index", request)); } }