Exemplo n.º 1
0
 private void ConfirmDeleteCallback(ConfirmState confirmState)
 {
     if (confirmState == ConfirmState.YES)
     {
         homePage.Goals.Remove(goal);
         homePage.Update();
     }
 }
Exemplo n.º 2
0
 private void ConfirmDeleteCallback(ConfirmState confirmState)
 {
     if (confirmState == ConfirmState.YES)
     {
         goalControl.Goal.Projects.Remove(project);
         goalControl.Update();
     }
 }
Exemplo n.º 3
0
 private void ConfirmDeleteHandler(ConfirmState confirmState)
 {
     if (confirmState == ConfirmState.YES)
     {
         CalendarDayControl.CalendarPage.Project.Taskgroups.Remove(Taskgroup);
         this.CalendarDayControl.CalendarPage.Update();
     }
 }
Exemplo n.º 4
0
 public ResetViewModel GetResetView(string returnUrl, ConfirmState state)
 {
     return(new ResetViewModel
     {
         ReturnUrl = returnUrl,
         Email = state.Token,
         Complexity = _options.Password.ComplexityText
     });
 }
Exemplo n.º 5
0
 public ConfirmViewModel GetConfirmView(string returnUrl, ConfirmState state)
 {
     return(new ConfirmViewModel
     {
         ReturnUrl = returnUrl,
         Email = state?.Token,
         Action = state?.Action,
         AllowedDomains = _options.Registration.AllowedDomains,
         CertificateIssuers = _options.Authentication.CertificateIssuers
     });
 }
Exemplo n.º 6
0
 public RegisterViewModel GetRegisterView(string returnUrl, ConfirmState state)
 {
     return(new RegisterViewModel
     {
         ReturnUrl = returnUrl,
         Email = state?.Token,
         Complexity = _options.Password.ComplexityText,
         AllowedDomains = _options.Registration.AllowedDomains,
         AllowRegistration = _options.Registration.AllowManual,
         CertificateIssuers = _options.Authentication.CertificateIssuers
     });
 }
 public void CreateNewEventAttempt()
 {
     if (currentEvent == null)
     {
         CreateNewEvent();
     }
     else
     {
         ConfirmState confirmState = StateMachine.FindState("ConfirmState") as ConfirmState;
         confirmState.Initialize("Stop current event?", "You can only have one active event at a time. Would you like to stop work on your current event?", new UnityAction(OnOkToCancelEvent), new UnityAction(OnCancelToCancelEvent));
         StateMachine.PushState(confirmState);
     }
 }
Exemplo n.º 8
0
 public void SetState(GameObject button)
 {
     if (button.GetComponent <ExitButton>().type == ExitButton.ButtonType.Menu)
     {
         state = ConfirmState.Menu;
     }
     if (button.GetComponent <ExitButton>().type == ExitButton.ButtonType.Quit)
     {
         state = ConfirmState.Quit;
     }
     if (button.GetComponent <ExitButton>().type == ExitButton.ButtonType.Stats)
     {
         state = ConfirmState.Stats;
     }
 }
Exemplo n.º 9
0
 public IEnumerator RunPrompt(System.Action <bool> result)
 {
     running = true;
     state   = ConfirmState.UNCONFIRM;
     while (state == ConfirmState.UNCONFIRM)
     {
         yield return(null);
     }
     if (state == ConfirmState.YES)
     {
         result(true);
     }
     else
     {
         result(false);
     }
     running = false;
 }
Exemplo n.º 10
0
    void Start()
    {
        // Create States
        chooseBGState  = new ChooseBGState(gameStateController, timeToGoBackToMainMenu);
        takePhotoState = new TakePhotoState(gameStateController, timeToGoBackToMainMenu);
        confirmState   = new ConfirmState(gameStateController, timeToGoBackToMainMenu);
        resultState    = new ResultState(gameStateController, timeToGoBackToMainMenu);


        // Controllers
        webcamTool.Init();
        photoTool.Init();
        photoAnimController.Init();
        uiController.Init();

        ResetGame();

        // Set the first gameState
        GoToState(Extension.GameState.ChooseBGState);

        isGameReady = true;
    }
Exemplo n.º 11
0
        /// <summary>
        /// 更新状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public Result <int> UpdateMaterialState(long id, ConfirmState state)
        {
            Result <int> result = new Result <int>();

            try
            {
                var model = DataOperateBusiness <Epm_Material> .Get().GetModel(id);

                model.State = (int)state;
                var rows = DataOperateBusiness <Epm_Material> .Get().Update(model);

                result.Data = rows;
                result.Flag = EResultFlag.Success;
                WriteLog(BusinessType.Equipment.GetText(), SystemRight.Modify.GetText(), "更新状态: " + rows);

                //处理待办
                var tempApp = DataOperateBusiness <Epm_Approver> .Get().GetList(t => t.BusinessId == model.Id && t.IsApprover == false).FirstOrDefault();

                if (tempApp != null)
                {
                    ComplateApprover(tempApp.Id);
                }

                if (state == ConfirmState.Discarded)
                {
                    #region 生成待办
                    var project = DataOperateBusiness <Epm_Project> .Get().GetModel(model.ProjectId.Value);

                    List <Epm_Approver> list = new List <Epm_Approver>();
                    Epm_Approver        app  = new Epm_Approver();
                    app.Title            = model.CreateUserName + "提报的工器具机械验收单,已废弃";
                    app.Content          = model.CreateUserName + "提报的工器具机械验收单,已废弃";
                    app.SendUserId       = CurrentUserID.ToLongReq();
                    app.SendUserName     = CurrentUserName;
                    app.SendTime         = DateTime.Now;
                    app.LinkURL          = string.Empty;
                    app.BusinessTypeNo   = BusinessType.Equipment.ToString();
                    app.Action           = SystemRight.Invalid.ToString();
                    app.BusinessTypeName = BusinessType.Equipment.GetText();
                    app.BusinessState    = (int)(ConfirmState.Discarded);
                    app.BusinessId       = model.Id;
                    app.ApproverId       = project.ContactUserId;
                    app.ApproverName     = project.ContactUserName;
                    app.ProjectId        = model.ProjectId;
                    app.ProjectName      = project.Name;
                    list.Add(app);
                    AddApproverBatch(list);
                    WriteLog(BusinessType.Equipment.GetText(), SystemRight.Invalid.GetText(), "废弃工器具机械验收生成待办: " + model.Id);
                    #endregion

                    #region 消息
                    Epm_Massage modelMsg = new Epm_Massage();
                    modelMsg.ReadTime     = null;
                    modelMsg.RecId        = model.CreateUserId;
                    modelMsg.RecName      = model.CreateUserName;
                    modelMsg.RecTime      = DateTime.Now;
                    modelMsg.SendId       = CurrentUserID.ToLongReq();
                    modelMsg.SendName     = CurrentUserName;
                    modelMsg.SendTime     = DateTime.Now;
                    modelMsg.Title        = model.CreateUserName + "提报的工器具机械验收单已被" + CurrentUserName + "废弃,请处理";
                    modelMsg.Content      = model.CreateUserName + "提报的工器具机械验收单已被" + CurrentUserName + "废弃,请处理";
                    modelMsg.Type         = 2;
                    modelMsg.IsRead       = false;
                    modelMsg.BussinessId  = model.Id;
                    modelMsg.BussinesType = BusinessType.Equipment.ToString();
                    modelMsg.ProjectId    = model.ProjectId.Value;
                    modelMsg.ProjectName  = model.ProjectName;
                    modelMsg = base.SetCurrentUser(modelMsg);
                    modelMsg = base.SetCreateUser(modelMsg);
                    DataOperateBusiness <Epm_Massage> .Get().Add(modelMsg);

                    #endregion
                }
                else if (state == ConfirmState.Confirm)
                {
                    #region 生成待办
                    List <Epm_Approver> list = new List <Epm_Approver>();
                    Epm_Approver        app  = new Epm_Approver();
                    app.Title            = model.CreateUserName + "提报的工器具机械验收单,审核通过";
                    app.Content          = model.CreateUserName + "提报的工器具机械验收单,审核通过";
                    app.SendUserId       = model.CreateUserId;
                    app.SendUserName     = model.CreateUserName;
                    app.SendTime         = model.CreateTime;
                    app.LinkURL          = string.Empty;
                    app.BusinessTypeNo   = BusinessType.Equipment.ToString();
                    app.Action           = SystemRight.Check.ToString();
                    app.BusinessTypeName = BusinessType.Equipment.GetText();
                    app.BusinessState    = (int)(ConfirmState.Confirm);
                    app.BusinessId       = model.Id;
                    app.ApproverId       = model.CreateUserId;
                    app.ApproverName     = model.CreateUserName;
                    app.ProjectId        = model.ProjectId;
                    app.ProjectName      = model.ProjectName;
                    list.Add(app);
                    AddApproverBatch(list);
                    WriteLog(BusinessType.Equipment.GetText(), SystemRight.Check.GetText(), "驳回合同生成待办: " + model.Id);
                    #endregion

                    #region 消息
                    var waitSend = GetWaitSendMessageList(model.ProjectId.Value);
                    foreach (var send in waitSend)
                    {
                        Epm_Massage modelMsg = new Epm_Massage();
                        modelMsg.ReadTime     = null;
                        modelMsg.RecId        = send.Key;
                        modelMsg.RecName      = send.Value;
                        modelMsg.RecTime      = DateTime.Now;
                        modelMsg.SendId       = CurrentUserID.ToLongReq();
                        modelMsg.SendName     = CurrentUserName;
                        modelMsg.SendTime     = DateTime.Now;
                        modelMsg.Title        = model.CreateUserName + "提报的工器具机械验收单," + CurrentUserName + "已审核通过";
                        modelMsg.Content      = model.CreateUserName + "提报的工器具机械验收单," + CurrentUserName + "已审核通过";
                        modelMsg.Type         = 2;
                        modelMsg.IsRead       = false;
                        modelMsg.BussinessId  = model.Id;
                        modelMsg.BussinesType = BusinessType.Equipment.ToString();
                        modelMsg.ProjectId    = model.ProjectId.Value;
                        modelMsg.ProjectName  = model.ProjectName;
                        modelMsg = base.SetCurrentUser(modelMsg);
                        modelMsg = base.SetCreateUser(modelMsg);
                        DataOperateBusiness <Epm_Massage> .Get().Add(modelMsg);
                    }
                    #endregion
                }
                else if (state == ConfirmState.ConfirmFailure)
                {
                    #region 生成待办
                    List <Epm_Approver> list = new List <Epm_Approver>();
                    Epm_Approver        app  = new Epm_Approver();
                    app.Title            = model.CreateUserName + "提报的工器具机械验收单已被驳回,请处理";
                    app.Content          = model.CreateUserName + "提报的工器具机械验收单已被驳回,请处理";
                    app.SendUserId       = model.CreateUserId;
                    app.SendUserName     = model.CreateUserName;
                    app.SendTime         = model.CreateTime;
                    app.LinkURL          = string.Empty;
                    app.BusinessTypeNo   = BusinessType.Equipment.ToString();
                    app.Action           = SystemRight.UnCheck.ToString();
                    app.BusinessTypeName = BusinessType.Equipment.GetText();
                    app.BusinessState    = (int)(ConfirmState.ConfirmFailure);
                    app.BusinessId       = model.Id;
                    app.ApproverId       = model.CreateUserId;
                    app.ApproverName     = model.CreateUserName;
                    app.ProjectId        = model.ProjectId;
                    app.ProjectName      = model.ProjectName;
                    list.Add(app);
                    AddApproverBatch(list);
                    WriteLog(BusinessType.Equipment.GetText(), SystemRight.UnCheck.GetText(), "驳回合同生成待办: " + model.Id);
                    #endregion

                    #region 消息
                    Epm_Massage modelMsg = new Epm_Massage();
                    modelMsg.ReadTime     = null;
                    modelMsg.RecId        = model.CreateUserId;
                    modelMsg.RecName      = model.CreateUserName;
                    modelMsg.RecTime      = DateTime.Now;
                    modelMsg.SendId       = CurrentUserID.ToLongReq();
                    modelMsg.SendName     = CurrentUserName;
                    modelMsg.SendTime     = DateTime.Now;
                    modelMsg.Title        = model.CreateUserName + "提报的工器具机械验收单已被" + CurrentUserName + "驳回,请处理";
                    modelMsg.Content      = model.CreateUserName + "提报的工器具机械验收单已被" + CurrentUserName + "驳回,请处理";
                    modelMsg.Type         = 2;
                    modelMsg.IsRead       = false;
                    modelMsg.BussinessId  = model.Id;
                    modelMsg.BussinesType = BusinessType.Equipment.ToString();
                    modelMsg.ProjectId    = model.ProjectId.Value;
                    modelMsg.ProjectName  = model.ProjectName;
                    modelMsg = base.SetCurrentUser(modelMsg);
                    modelMsg = base.SetCreateUser(modelMsg);
                    DataOperateBusiness <Epm_Massage> .Get().Add(modelMsg);

                    #endregion

                    #region 发送短信
                    //WriteSMS(model.CreateUserId, 0, MessageStep.MaterialReject, null);
                    #endregion
                }
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "UpdateMaterialState");
            }
            return(result);
        }
Exemplo n.º 12
0
 protected void OnButtonClicked(object sender, EventArgs e)
 {
     if (currState == ConfirmState.CONFIRMING) {
         RemoveTimeout ();
         ConfirmClick (sender, e);
     } else {
         currState = ConfirmState.CONFIRMING;
         confirmTimeoutHandle = GLib.Timeout.Add (CONFIRM_TIMEOUT, this.ButtonRevert);
         image.Pixbuf = pixbufConfirming;
     }
 }
Exemplo n.º 13
0
 private bool ButtonRevert()
 {
     currState = ConfirmState.NORMAL;
     confirmTimeoutHandle = 0;
     image.Pixbuf = pixbufNormal;
     return false;
 }
Exemplo n.º 14
0
 public void No()
 {
     state = ConfirmState.NO;
 }
Exemplo n.º 15
0
 public void Yes()
 {
     state = ConfirmState.YES;
 }
Exemplo n.º 16
0
    //呼叫確認視窗
    public void BTN_ShowConfirmWindow(string stateStr)
    {
        ConfirmState state       = (ConfirmState)Enum.Parse(typeof(ConfirmState), stateStr);
        bool         processPass = true; //進程許可開關

        confirmState = state;            //儲存目前確認視窗狀態

        switch (state)                   //展示確認內容
        {
        case ConfirmState.清除排行榜:
            otherUI.confirmText.text = "是否清除所有玩家排行榜紀錄?";
            processPass = settingSystem.settingItems[0].activeSelf ? true : false;
            break;

        case ConfirmState.重製等級:
            if (GameControler.instance.level > 0)     //等級在0以上時才可重製
            {
                otherUI.confirmText.text = "重製會造成等級下降10級,並換成相應的金幣。\n確定重製嗎?";
                processPass = StaticScript.pause ? false : true;
            }
            else                                                                                //等級為0時無法重製
            {
                AudioManager.instance.PlaySound(AudioManager.instance.soundClips.sound_cancel); //播放音效
                otherUI.canNotResetEffect.Play("Disable Shake", 0, 0);                          //播放特效
                processPass = false;
            }
            break;

        case ConfirmState.返回主選單:
            otherUI.confirmText.text = "確定要存檔後返回主選單嗎?";
            processPass = StaticScript.pause ? false : true;
            break;

        case ConfirmState.調整分辨率:
            otherUI.confirmText.text = "是否要更改解析度?";
            processPass = settingSystem.settingItems[2].activeSelf ? true : false;
            break;

        case ConfirmState.啟用全螢幕:
            otherUI.confirmText.text = "是否要使用全螢幕模式?";
            processPass = settingSystem.settingItems[2].activeSelf ? true : false;
            break;

        case ConfirmState.取消全螢幕:
            otherUI.confirmText.text = "是否要使用視窗模式?";
            processPass = settingSystem.settingItems[2].activeSelf ? true : false;
            break;

        case ConfirmState.啟用垂直同步:
            otherUI.confirmText.text = "是否啟用垂直同步?";
            processPass = settingSystem.settingItems[2].activeSelf ? true : false;
            break;

        case ConfirmState.關閉垂直同步:
            otherUI.confirmText.text = "是否關閉垂直同步?";
            processPass = settingSystem.settingItems[2].activeSelf ? true : false;
            break;
        }
        if (processPass)
        {
            StaticScript.pause = true;             //暫停遊戲
            otherUI.blackBack.SetActive(true);     //展開黑背景
            otherUI.confirmWindow.SetActive(true); //展開確認視窗
        }
    }
Exemplo n.º 17
0
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    //自定義方法
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    //呼叫確認視窗
    public void CW_ShowWindow(string stateStr)
    {
        ConfirmState state = (ConfirmState)Enum.Parse(typeof(ConfirmState), stateStr);

        confirmState = state;     //儲存目前確認視窗狀態
        bool processPass = false; //進程許可開關

        if (!StaticScript.pause)
        {
            switch (state) //展示確認內容
            {
            case ConfirmState.開新遊戲:
                if (PlayerPrefs.GetInt("UNIV_saveGame", 0) == 0) //若沒有紀錄的遊戲則直接開始
                {
                    StaticScript.pause = true;                   //暫停遊戲
                    confirmWindows.blackBack.SetActive(true);    //展開黑背景
                    inputName.text = "";
                    inputNamePanel.SetActive(true);              //開啟輸入名稱面板
                }
                else                                             //若有紀錄的遊戲,詢問是否開新局
                {
                    confirmWindows.confirmText.text = "開始遊戲會導致紀錄喪失\n確定要開始新遊戲 ? ";
                    processPass = true;
                }
                break;

            case ConfirmState.繼續遊戲:
                if (PlayerPrefs.GetInt("UNIV_saveGame", 0) == 0)     //若沒有紀錄的遊戲,顯示是否要開新遊戲
                {
                    confirmWindows.confirmText.text = "無可用記錄\n是否要開新遊戲 ? ";
                    processPass = true;
                }
                else
                {
                    loadingObjects.loadingScreen.SetActive(true);     //開啟讀取畫面
                    StartCoroutine(Loading(false));
                }
                break;

            case ConfirmState.離開遊戲:
                confirmWindows.confirmText.text = "確定要離開遊戲嗎 ?";
                processPass = true;
                break;
            }
        }
        else if (StaticScript.pause && (int)state >= 3)
        {
            switch (state)
            {
            case ConfirmState.調整分辨率:
                confirmWindows.confirmText.text = "是否要更改解析度?";
                processPass = settingObjects.settingItems[1].activeSelf ? true : false;
                break;

            case ConfirmState.啟用全螢幕:
                confirmWindows.confirmText.text = "是否要使用全螢幕模式?";
                processPass = settingObjects.settingItems[1].activeSelf ? true : false;
                break;

            case ConfirmState.取消全螢幕:
                confirmWindows.confirmText.text = "是否要使用視窗模式?";
                processPass = settingObjects.settingItems[1].activeSelf ? true : false;
                break;

            case ConfirmState.啟用垂直同步:
                confirmWindows.confirmText.text = "是否啟用垂直同步?";
                processPass = settingObjects.settingItems[1].activeSelf ? true : false;
                break;

            case ConfirmState.關閉垂直同步:
                confirmWindows.confirmText.text = "是否關閉垂直同步?";
                processPass = settingObjects.settingItems[1].activeSelf ? true : false;
                break;
            }
        }

        if (processPass)
        {
            StaticScript.pause = true;                    //暫停遊戲
            confirmWindows.blackBack.SetActive(true);     //展開黑背景
            confirmWindows.confirmWindow.SetActive(true); //展開確認視窗
        }
    }