Exemplo n.º 1
0
        public async Task <ActionResult <PopupModel> > PostPopupModel(PopupModel popupModel)
        {
            _context.Popups.Add(popupModel);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPopupModel", new { id = popupModel.Id }, popupModel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutPopupModel(int id, PopupModel popupModel)
        {
            if (id != popupModel.Id)
            {
                return(BadRequest());
            }

            _context.Entry(popupModel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PopupModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 3
0
    //  TODO aherrera : second param: ePopupType?
    public void AddPopup(PopupModel.sPopupInfos popup_infos)
    {
        GameObject new_popup_go = Instantiate(PopupDefaultPrefab);
        PopupModel popup_model  = new_popup_go.GetComponent <PopupModel>();

        if (popup_model == null)
        {
            popup_model = new_popup_go.AddComponent <PopupModel>();
        }

        PopupView view = new_popup_go.GetComponent <PopupView>();

        if (view == null)
        {
            view = new_popup_go.gameObject.AddComponent <PopupView>();
        }

        //  TODO aherrera : IF you're gonna do enums and default popups, use popup_infos to setup the popup HERE
        //                      probably to the popup_model

        AddPopup(new_popup_go);

        popup_model.InitializePopup();
        //  view.Initialize?

        UpdatePopupInput();
    }
Exemplo n.º 4
0
        //各セーブデータをクリック時、確認ポップアップを出す
        private UnityAction showPopupLoad(string txt, int num)
        {
            UnityAction onClickOK = () =>
            {
                //ポップアップを閉じる
                MainState.Popup.Close();
                //Load処理
                //暫定
                MainState.SaveLoad.Load(num.ToString("00"));
                //スクロールを閉じる
                Ref.Canvas.CvSideBar.SetActive(false);
                //スタート画面からのロードの場合、START/LAODのメニューも消す
                Ref.Canvas.CvMenu.SetActive(false);
            };

            UnityAction onClickNG = () =>
            {
                // ポップアップを閉じる
                MainState.Popup.Close();
            };

            var popupModel = new PopupModel()
            {
                Text       = txt,
                OnClickOK  = onClickOK,
                OnClickNG  = onClickNG,
                IsQuestion = true
            };

            return(() =>
            {
                MainState.Popup.Vo = popupModel;
                MainState.Popup.Show();
            });
        }
        private void send_btn_Click(object sender, RoutedEventArgs e)
        {
            if (field_value.Text != "")
            {
                MainPushModel mainModel = new MainPushModel();
                switch (type)
                {
                case "popup":
                    PopupModel popup = new PopupModel();
                    popup.uri      = field_value.Text;
                    mainModel.data = popup;
                    break;

                case "twitter":
                case "instagram":
                case "soroush":
                case "ussd":
                    SingleValueObject obj = new SingleValueObject();
                    obj.type       = type;
                    obj.value      = field_value.Text;
                    mainModel.data = obj;
                    break;
                }

                util.PostRequest(JsonConvert.SerializeObject(mainModel), SendPushWindow.FireBaseKey, this);
            }
            else
            {
                MessageBox.Show("Please fill all of the fields", "Data Missed!");
            }
        }
Exemplo n.º 6
0
        public ActionResult Insert(PopupModel panner)
        {
            var model = panner.ToEntity();

            _popuprService.Insert(model);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 7
0
 public async void OnSelect(IEnumerable <Location> locations)
 {
     this.SelectedLocation = locations.FirstOrDefault();
     this.SelectedItems    = new List <Location> {
         SelectedLocation
     };
     await PopupModel.Open(SelectedLocation.Id);
 }
Exemplo n.º 8
0
        public void Dispose()
        {
            PopupModel?.Dispose();
            WorkspaceModel?.Dispose();
            AuthenticationModel?.Dispose();

            _modelDisposable.Dispose();
        }
Exemplo n.º 9
0
        public ActionResult Edit(PopupModel panner)
        {
            var model = panner.ToEntity();
            var popup = _popuprService.GetById(panner.Id);

            _popuprService.Edit(popup);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 10
0
        private void AddBonus(BonusModel bonus)
        {
            if (bonus == null)
            {
                return;
            }

            BonusesList.Add(bonus);
            PopupModel.ClosePopup();
        }
Exemplo n.º 11
0
        private void AddRakeBack(RakeBackModel rakeBack)
        {
            if (rakeBack == null)
            {
                return;
            }

            RakeBackList.Add(rakeBack);
            PopupModel.ClosePopup();
        }
Exemplo n.º 12
0
        internal PopupModel SetupJobWindow(string name, string title, string url, HttpSessionStateBase httpSession)
        {
            PopupModel popupModel = new PopupModel();

            popupModel.Name           = name;
            popupModel.Title          = title;
            popupModel.ContentUrl     = url;
            popupModel.Data           = null;
            httpSession["PopupModel"] = popupModel;
            return(popupModel);
        }
Exemplo n.º 13
0
        private void AddAlias(AliasCollectionItem alias)
        {
            if (alias == null)
            {
                return;
            }

            StorageModel.PlayerCollection.Add(alias);
            SaveChanges(alias);
            PopupModel.ClosePopup();
        }
Exemplo n.º 14
0
        /// <summary>
        /// Gets the popup list.
        /// </summary>
        public ActionResult Popup(string id = "")
        {
            var published = false;

            if (!String.IsNullOrEmpty(Request["tinymce"]))
            {
                published = Request["tinymce"] == "true";
            }
            string filter = Request["filter"];

            return(View("Popup", PopupModel.Get(id, published, filter)));
        }
Exemplo n.º 15
0
        private void EditBonus(object obj)
        {
            var viewModelInfo = new SettingsRakeBackViewModelInfo <BonusModel>
            {
                Model = (obj as BonusModel),
                Close = PopupModel.ClosePopup,
                Add   = AddBonus
            };

            var viewModel = new SettingsBonusesAddEditViewModel(viewModelInfo);

            PopupModel.OpenPopup(viewModel);
        }
Exemplo n.º 16
0
        private void EditRakeBack(object obj)
        {
            var viewModelInfo = new SettingsRakeBackViewModelInfo <RakeBackModel>
            {
                Model = (obj as RakeBackModel),
                Close = PopupModel.ClosePopup,
                Add   = AddRakeBack
            };

            var viewModel = new SettingsRakeBackAddEditViewModel(viewModelInfo);

            PopupModel.OpenPopup(viewModel);
        }
Exemplo n.º 17
0
        public async void popupCreate(ListPopupModel dataCollection)
        {
            var itemCollection = await _context.CurProjects.ToListAsync();

            foreach (var item in itemCollection)
            {
                PopupModel newItem = new PopupModel
                {
                    popupItem = item.Full_name,
                    itemId    = item.Uid
                };
                dataCollection.listPopupModel.Add(newItem);
            }
        }
Exemplo n.º 18
0
        private void EditAlias(object obj)
        {
            var viewModelInfo = new AliasViewModelInfo <AliasCollectionItem>()
            {
                Model = obj as AliasCollectionItem,
                Close = PopupModel.ClosePopup,
                Add   = AddAlias,
                Save  = SaveChanges
            };

            var viewModel = new AliasAddEditViewModel(viewModelInfo);

            PopupModel.OpenPopup(viewModel);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Gets the popup list.
        /// </summary>
        public ActionResult Popup(string id = "")
        {
            var published = false;

            if (!String.IsNullOrEmpty(Request["tinymce"]))
            {
                published = Request["tinymce"] == "true";
            }
            string filter = Request["filter"];

            // Disable caching for the popup
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            // Return view
            return(View("Popup", PopupModel.Get(id, published, filter)));
        }
Exemplo n.º 20
0
        //各セーブデータをクリック時、確認ポップアップを出す
        private UnityAction showPopupSave(string txt, int num)
        {
            //ポップアップのOKボタン押下時処理
            UnityAction onClickOK = () =>
            {
                //Save 暫定
                //ここのメソッドでnumを使うのが要点 そのため、Action<int>ではなくActionで済む
                MainState.SaveLoad.Save(num.ToString("00"));
                //ポップアップを閉じる
                MainState.Popup.Close();
                //ポップアップを再度開く 「セーブしました」
                var confirm = new PopupModel()
                {
                    IsQuestion = false,
                    Text       = "セーブしました。",
                    OnClickOK  = () =>
                    {
                        MainState.Popup.Close();
                    }
                };
                MainState.Popup.Vo = confirm;
                MainState.Popup.Show();
            };

            //ポップアップのNG押下時処理
            UnityAction onClickNG = () =>
            {
                // ポップアップを閉じる
                MainState.Popup.Close();
            };

            var popupModel = new PopupModel()
            {
                Text       = txt,
                OnClickOK  = onClickOK,
                OnClickNG  = onClickNG,
                IsQuestion = true
            };

            return(() =>
            {
                MainState.Popup.Vo = popupModel;
                MainState.Popup.Show();
            });
        }
Exemplo n.º 21
0
        /// <summary>
        /// Change Password Popup
        /// </summary>
        /// <returns></returns>        
        public ActionResult ChangePassword()
        {
            int[] regvia = { (int)RegisterVia.Android, (int)RegisterVia.Website, (int)RegisterVia.IPhone };
            if (!regvia.Contains(LOGGEDIN_USER.RegisterVia))
                return Json(new ActionOutput
                {
                    Message = "Password can not be changed for facebook user",
                    Status = ActionStatus.Error
                },
                    JsonRequestBehavior.AllowGet);
            ChangePasswordWebsiteModel model = new ChangePasswordWebsiteModel();
            PopupModel popup = new PopupModel();
            popup.Title = "Change Password";
            popup.Body = RenderRazorViewToString("_ChangePassword", model);

            string popupString = RenderRazorViewToString("_LayoutPopup", popup);
            return Json(new ActionOutput { Results = new List<string> { popupString }, Status = ActionStatus.Successfull }, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 22
0
        public async override Task InitializeAsync(object navigationData)
        {
            _isExiting = false;
            if (navigationData is PopupModel)
            {
                Popup = navigationData as PopupModel;

                // check animation
                if (string.IsNullOrEmpty(_popup.Animation))
                {
                    Animation = "check.json";
                }
                else
                {
                    Animation = _popup.Animation;
                }
                // celebration animation
                if (_popup.IsCelebration)
                {
                    Celebration = "celebration.json";
                }
                // okbutton control
                if (!string.IsNullOrEmpty(_popup.OKButtonLabel))
                {
                    IsOkVisible = true;
                }
                // processing control
                if (_popup.IsProcessFooterVisible)
                {
                    isProcessFooterVisible = true;
                }
                // screen delay
                if (_popup.Delay != 0)
                {
                    await Task.Delay(_popup.Delay);

                    // auto exit
                    await GoBack();
                }
            }
        }
Exemplo n.º 23
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var result = await _popupService.GetActivePopupByCustomerId(_workContext.CurrentCustomer.Id);

            if (result == null)
            {
                return(Content(""));
            }

            var model = new PopupModel();

            model.Id               = result.Id;
            model.Body             = result.Body;
            model.Name             = result.Name;
            model.PopupType        = (Core.Domain.Messages.PopupType)result.PopupTypeId;
            model.CustomerActionId = result.CustomerActionId;

            await _popupService.MovepopupToArchive(result.Id, _workContext.CurrentCustomer.Id);

            return(View(model));
        }
Exemplo n.º 24
0
        public static IDisposable BindPopup(
            this MainWindowModel model,
            IPopupController popupController)
        {
            model.PopupModel = PopupModel.Hidden();

            var trigger = (popupController as PopupController)?.Trigger;

            if (trigger != null)
            {
                return(trigger
                       .SubscribeOn(RxApp.TaskpoolScheduler)
                       .ObserveOn(RxApp.MainThreadScheduler)
                       .Accept(context =>
                {
                    model.PopupModel = context == null
                            ? PopupModel.Hidden()
                            : new PopupModel(context);
                }));
            }

            return(Disposable.Empty);
        }
Exemplo n.º 25
0
        public JsonResult Popup(PopupModel m)
        {
            if (ModelState.IsValid)
            {
                EditModel em = new EditModel();
                em.Content      = m.NewContent;
                em.FileUrl      = m.FileUrl;
                em.UploadedFile = m.UploadedFile;

                if (em.SaveAll(false))
                {
                    return new JsonResult()
                           {
                               Data = true
                           }
                }
                ;
            }
            return(new JsonResult()
            {
                Data = false
            });
        }
Exemplo n.º 26
0
        public ActionResult ShowJobWindow(string name, string title, string url)
        {
            PopupModel popupModel = SetupJobWindow(name, title, url, Session);

            return(View(popupModel));
        }
        public async Task <IActionResult> PrayerRequest(PrayerRequestViewModel requestModel)
        {
            requestModel.Title = "Submit a Prayer Request";
            SiteVerifyResult reCaptchaVerifyResult = null;

            if (requestModel == null)
            {
                ModelState.AddModelError("", "requestModel was Null");
            }
            else if (requestModel.ReCaptchaResponse == null)
            {
                ModelState.AddModelError("", "requestModel.ReCaptchaResponse was Null");
            }
            else
            {
                try
                {
                    reCaptchaVerifyResult = await _ReCaptchaService.VerifyReCaptchaAsync(requestModel.ReCaptchaResponse);
                }
                catch (Exception)
                {
                }
            }


            if (reCaptchaVerifyResult != null)
            {
                if (reCaptchaVerifyResult.ResultStatus != ReCaptcha.enums.ResultStatus.Ok || reCaptchaVerifyResult.IsVerified == false)
                {
                    var resultCd = reCaptchaVerifyResult.ResultStatus switch
                    {
                        ResultStatus.Ok => "Ok",
                        ResultStatus.BadRequest => "Bad Request",
                        ResultStatus.Conflict => "Conflict",
                        ResultStatus.Error => "Error",
                        ResultStatus.NotFound => "Not Found",
                        ResultStatus.Unauthorized => "Unauthorized",
                        _ => "Unknown"
                    };

                    ModelState.AddModelError(string.Empty, resultCd + " " + reCaptchaVerifyResult.ResultStatusMessages[0].Message);
                }
            }

            if (!ModelState.IsValid)
            {
                return(View(requestModel));
            }

            await _RequestsService.InsertAPrayerRequestAsync(requestModel.PrayerRequest);

            var msg = "Thank you for your prayer request.  Your request will be reviewed by a knight and included in our group prayer at our council meeting. ";

            msg += "If your request was marked urgent, your request may be forwarded to brother knights to include with their individual prayer intentions.";

            var postSavePopup = new PopupModel()
            {
                Title   = "Prayer Request Submitted",
                Body    = msg,
                Buttons = new PopupButtonModel[]
                {
                    new PopupButtonModel(Core.Enums.ButtonType.Close)
                }
            };

            var _popupJson = JsonSerializer.Serialize(postSavePopup);

            return(RedirectToAction("Index", new RouteValueDictionary(
                                        new { controller = "Home", action = "Index", popupJson = _popupJson })));
        }
    }
Exemplo n.º 28
0
 /// <summary>
 /// Gets the popup list.
 /// </summary>
 public ActionResult Popup(string id = "")
 {
     return(View("Popup", PopupModel.Get(id)));
 }
Exemplo n.º 29
0
        public ActionResult ForgotPassword()
        {
            ForgotPasswordModel model = new ForgotPasswordModel();
            PopupModel popup = new PopupModel();
            popup.Title = "Forgot Password";
            popup.Body = RenderRazorViewToString("_ForgotPassword", model);

            string popupString = RenderRazorViewToString("_LayoutPopup", popup);
            return Json(new ActionOutput { Results = new List<string> { popupString }, Status = ActionStatus.Successfull }, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 30
0
        public ActionResult ResetPasswordPopup(string Email)
        {
            ResetPasswordModelWebsite model = new ResetPasswordModelWebsite();
            model.UserEmail = Email;
            PopupModel popup = new PopupModel();
            popup.Title = "Reset Password";
            popup.Body = RenderRazorViewToString("_ResetPasswordPopup", model);

            string popupString = RenderRazorViewToString("_LayoutPopup", popup);
            return Json(new ActionOutput { Results = new List<string> { popupString }, Status = ActionStatus.Successfull }, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 31
0
 public ActionResult Popup(PopupModel model)
 {
     ViewBag.Message = model.Name;
     return(View("About"));
 }
Exemplo n.º 32
0
 public void Show(PopupModel popupModel)
 {
     ContextChanged?.Invoke(this, popupModel);
 }
Exemplo n.º 33
0
        private void SendLogs(object obj)
        {
            var viewModel = new SettingsSendLogViewModel();

            PopupModel.OpenPopup(viewModel);
        }