Inheritance: MonoBehaviour
Example #1
0
    // Use this for initialization
    void Start()
    {
        alert = GameObject.Find("Alert System").GetComponent<AlertManager>();

        playerObject = GameObject.FindGameObjectWithTag("Player");
        canvasTransform = transform.parent.GetComponent<RectTransform>();
        doorButtonTransform = GetComponent<RectTransform>();
        currentDoor = null;
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        alertSystem = GameObject.Find("Alert System").GetComponent<AlertManager>();

        hitPosition = transform.position + new Vector3(0,0,20);

        lRenderer = GetComponent<LineRenderer>();
        lRenderer.SetPosition(0, transform.position);
        lRenderer.SetPosition(1, hitPosition);
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        pathObject 		= transform.Find("Sensor Path");
        pathStartObject = pathObject.Find("Path Start");
        pathEndObject 	= pathObject.Find("Path End");

        nextPointObject = pathEndObject;
        pathObject.transform.parent = null;

        alertSystem = GameObject.Find("Alert System").GetComponent<AlertManager>();
        pController = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
    }
Example #4
0
    void Start()
    {
        sensing 		= 		GetComponent<GuardSensing> ();
        behaviour 		= 		GetComponent<GuardBehaviour> ();
        alerted 		= 		false;
        alertSystem 	= 		GameObject.Find ("Alert System").GetComponent<AlertManager>();
        pHealth 		= 		GameObject.Find ("Health Manager").GetComponent<HealthManager> ();

        // Set default state: patrol or sentry (stationary)
        if (patrolling)
        {
            behaviour.guardState = GuardBehaviour.GuardState.Patrol;
        } else {
            behaviour.guardState = GuardBehaviour.GuardState.Sentry;
        }
    }
Example #5
0
    void Start()
    {
        backgroundRing 					= 		GameObject.Find ("AlertCountdownIcon").GetComponent<Image> ();
        alertManager 					= 		GameObject.Find ("Alert System").GetComponent<AlertManager> ();

        // get the foreground ring icon, from the first child object
        countDownIcon 					= 		transform.GetChild (0).GetComponent<Image> ();
        countDownIcon.enabled 			= 		false;

        // get the countdown text, from the second child object
        timerText 						= 		transform.GetChild (1).GetComponent<Text> ();
        countdown 						= 		"00.0";
        timerText.text 					= 		countdown;

        // set the transparent white colour for the text and background ring
        transpWhite 					= 		Color.white;
        transpWhite.a 					= 		0.5f;
        backgroundRing.color 			= 		transpWhite;
    }
Example #6
0
 public string GetAlerts()
 {
     using (var manager = new AlertManager(null))
         return(manager.GetAlerts(User.Identity.UserId, DateTime.Now.Date)
                .Select(al => new { al.AlertId, al.Description }).SerializeToJson());
 }
Example #7
0
    // Use this for initialization
    void Start()
    {
        alert 			 = GameObject.Find ("Alert System").GetComponent<AlertManager>();
        eventSystem		 = GameObject.Find ("EventSystem").GetComponent<EventSystem> ();
        pHealth 		 = GameObject.Find ("Health Manager").GetComponent<HealthManager>();
        timeScale 		 = GameObject.Find("Time Manager").GetComponent<TimeScaler>();
        pManager		 = GameObject.Find ("Pause Manager").GetComponent<PauseManager> ();
        playerAnimator 	 = GetComponent<Animator>();
        bodyParts 		 = GetComponent<PlayerBodyparts> ().bodyparts;
        agent 			 = GetComponent<NavMeshAgent>();

        customDeltaTime  = Time.deltaTime;

        SetupMouseCursor();

        foreach (GameObject part in bodyParts)part.GetComponent<Renderer>().material.color = Color.green;
        agent.SetDestination(transform.position);
        playerAnimator.updateMode = AnimatorUpdateMode.UnscaledTime;
        Invoke("ToggleCanMove", 0.1f);
    }
Example #8
0
    private void ShowJsonParseError()
    {
        string errorCode = AlertManager.GetErrorCode(WWWResponse.LocalErrorStatus.LOCAL_ERROR_JSONPARSE);

        this.Open(errorCode, string.Empty, string.Empty, false, new Action <int>(this.BackToTop), null);
    }
 public string GetAlerts()
 {
     using (var manager = new AlertManager(null))
         return manager.GetAlerts(User.Identity.UserId, DateTime.Now.Date)
             .Select(al => new {al.AlertId, al.Description}).SerializeToJson();
 }
Example #10
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //
        // Replaced user control DateTimeInterval for DateTime using the new feature hour
        //
        if (ucEndDate.DateTime != null)
        {
            if (ucBeginDate.DateTime.Value > ucEndDate.DateTime.Value)
            {
                ShowError(Resources.Exception.StartTimeIsBiggerThanEndTime);
                return;
            }
        }

        _taskManager = new TaskManager(this);
        Task task = OriginalTask.Duplicate();

        task.Name = txtName.Text;

        if (Page.ViewState["ServiceOrderId"] != null)
        {
            task.SubjectId = Convert.ToInt32(Page.ViewState["ServiceOrderId"]);
            task.PageName  = "serviceorder.aspx";
            ServiceOrder os = new ServicesManager(this).GetServiceOrder(task.SubjectId.Value);
            task.Name = "OS" + os.ServiceOrderNumber + " - " + task.Name;
        }

        task.TaskStatusId  = Convert.ToInt32(cboTaskStatus.SelectedValue);
        task.Priority      = Convert.ToInt32(rtnRanking.CurrentRating);
        task.Cost          = ucCurrFieldCost.CurrencyValue;
        task.Deadline      = ucDeadLineDate.DateTime;
        task.CreatorUserId = User.Identity.UserId;

        if (!String.IsNullOrEmpty(cboAlertMinutesBefore.SelectedValue))
        {
            task.AlertMinutesBefore = Convert.ToInt32(cboAlertMinutesBefore.SelectedValue);
        }

        if (CanChange)
        {
            task.Description = txtDescription.Value.Replace("$0", "<br/>");
        }

        if (!String.IsNullOrEmpty(cboParentTasks.SelectedValue))
        {
            task.ParentTaskId = Convert.ToInt32(cboParentTasks.SelectedValue);
        }

        task.FinishDate = ucEndDate.DateTime;

        if (ucBeginDate.DateTime > DateTime.MinValue.Sql2005MinValue())
        {
            task.StartDate = ucBeginDate.DateTime;
        }


        var alertManager = new AlertManager(this);


        if (Page.ViewState["TaskId"] != null)
        {
            _taskManager.SaveTask(OriginalTask, task, Users);

            if (alertManager.GetAlerts(task.TaskId, "task.aspx") != null)
            {
                alertManager.DeleteAlerts(task.TaskId, "task.aspx");
            }
        }
        else
        {
            _taskManager.SaveTask(task, task, Users);
        }


        if (!String.IsNullOrEmpty(Request["app"]))
        {
            CreateAlerts(task);
        }


        if (((WebControl)sender).ID == "btnSave")
        {
            if (task.PageName == "serviceorder.aspx")
            {
                Response.Redirect("Appointments.aspx?ServiceOrderId=" + Request["ServiceOrderId"]);
            }
            else if (!String.IsNullOrEmpty(Request["app"]))
            {
                Response.Redirect("Appointments.aspx");
            }
            else
            {
                Response.Redirect("Tasks.aspx");
            }
        }
        else
        {
            var appointment = Request["app"];
            Response.Redirect("Task.aspx?app=" + appointment);
        }
    }
Example #11
0
        /// <summary>
        /// Updates the displayed alerts based on current state of Alerts, performing
        /// a diff to ensure we only change what's changed (this avoids active tooltips disappearing any
        /// time state changes)
        /// </summary>
        private void UpdateAlertsControls()
        {
            if (!CurrentlyControlled || _ui == null)
            {
                return;
            }

            // remove any controls with keys no longer present
            var toRemove = new List <AlertKey>();

            foreach (var existingKey in _alertControls.Keys)
            {
                if (!IsShowingAlert(existingKey))
                {
                    toRemove.Add(existingKey);
                }
            }

            foreach (var alertKeyToRemove in toRemove)
            {
                // remove and dispose the control
                _alertControls.Remove(alertKeyToRemove, out var control);
                control?.Dispose();
            }

            // now we know that alertControls contains alerts that should still exist but
            // may need to updated,
            // also there may be some new alerts we need to show.
            // further, we need to ensure they are ordered w.r.t their configured order
            foreach (var alertStatus in EnumerateAlertStates())
            {
                if (!AlertManager.TryDecode(alertStatus.AlertEncoded, out var newAlert))
                {
                    Logger.ErrorS("alert", "Unable to decode alert {0}", alertStatus.AlertEncoded);
                    continue;
                }

                if (_alertControls.TryGetValue(newAlert.AlertKey, out var existingAlertControl) &&
                    existingAlertControl.Alert.AlertType == newAlert.AlertType)
                {
                    // id is the same, simply update the existing control severity
                    existingAlertControl.SetSeverity(alertStatus.Severity);
                }
                else
                {
                    existingAlertControl?.Dispose();

                    // this is a new alert + alert key or just a different alert with the same
                    // key, create the control and add it in the appropriate order
                    var newAlertControl = CreateAlertControl(newAlert, alertStatus);
                    if (_alertOrder != null)
                    {
                        var added = false;
                        foreach (var alertControl in _ui.Grid.Children)
                        {
                            if (_alertOrder.Compare(newAlert, ((AlertControl)alertControl).Alert) < 0)
                            {
                                var idx = alertControl.GetPositionInParent();
                                _ui.Grid.Children.Add(newAlertControl);
                                newAlertControl.SetPositionInParent(idx);
                                added = true;
                                break;
                            }
                        }

                        if (!added)
                        {
                            _ui.Grid.Children.Add(newAlertControl);
                        }
                    }
                    else
                    {
                        _ui.Grid.Children.Add(newAlertControl);
                    }

                    _alertControls[newAlert.AlertKey] = newAlertControl;
                }
            }
        }
 protected void OnCloseUpdateBirthdayErr()
 {
     AlertManager.ShowAlertDialog(null, "C-SH03");
     this.UIUnLock();
 }
Example #13
0
 public static bool ShowNoWarningIconAlertDialog(Action <int> action, string title, string message, AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close)
 {
     return(AlertManager.ShowDialog <CMD_Alert>(action, title, message, "CMD_Alert", actionType, false, false));
 }
Example #14
0
 public static bool ShowMaintenanceDialog(Action <int> action, string message)
 {
     return(AlertManager.ShowDialog <CMD_maintenance>(action, string.Empty, message, "CMD_maintenance", AlertManager.ButtonActionType.Close, true, false));
 }
Example #15
0
        public async Task AddAlertAsync(string exchange, string ticker, double price, [Remainder] string comment = "")
        {
            string response = await AlertManager.AddAlertCommand(exchange, ticker, price, comment);

            await ReplyAsync(response);
        }
Example #16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="config"></param>
 public AlertsController(IHttpContextAccessor accessor, DataContext dc, AlertManager am)
     : base(accessor, dc)
 {
     AlertManager = am;
 }
 public void SetAlert(string cssClass, string messaggio)
 {
     AlertManager.ShowAlert(pnlAlert, lblAlert, cssClass, messaggio);
 }
Example #18
0
        public async Task MainAsync(string[] args)
        {
            // Parse command line arguements
            Config config = Config.readConfigFile(args[0]);

            string discordToken = config.DiscordBotToken;
            ulong  serverId     = ulong.Parse(config.DiscordServerId);
            ulong  channelId    = ulong.Parse(config.DiscordChannelId);

            // Initialize discord client
            DiscordSocketClient client = new DiscordSocketClient();

            client.Log += Log;

            CommandService cs = new CommandService();
            CommandHandler ch = new CommandHandler(client, cs);
            await ch.InstallCommandsAsync();

            // Login and start the bot
            await client.LoginAsync(TokenType.Bot, discordToken);

            await client.StartAsync();

            // Wait some time to properly start and get the channel for the bot to message to
            await Task.Delay(5000);

            alertNotificationsChannel = client.GetGuild(serverId).GetTextChannel(channelId);
            Console.WriteLine("Discord alerts channel set.");

            AlertManager alertManager;

            if (config.DatabaseCredentialsSet)
            {
                alertManager = new AlertManager(config.DatabaseServerUrl, config.DatabasePort, config.DatabaseName, config.DatabaseTable, config.DatabaseUser, config.DatabasePassword);
                Console.WriteLine("Database connection made and all stored alerts grabbed.");
            }
            else
            {
                alertManager = new AlertManager();
                Console.WriteLine("No database connection, alerts will be stored in memory only.");
            }

            // Check all alerts constantly to see if they have been triggered
            while (true)
            {
                var alerts        = alertManager.getAllAlerts();
                var checkedAlerts = new List <Alert>();

                foreach (var alert in alerts.ToArray())
                {
                    if (checkedAlerts.Contains(alert))
                    {
                        continue;
                    }

                    var    sameMarketAlerts = alertManager.getSameMarketAlerts(alert);
                    double price            = await alertManager.getAlertPriceAsync(alert);

                    foreach (var _alert in sameMarketAlerts)
                    {
                        bool triggered = await alertManager.CheckAlertAsync(alert, price);

                        if (triggered)
                        {
                            string discordMessage = $"ALERT TRIGGERED - {alert.ToString()}. Current price: {((decimal)(alert.CurrentPrice)).ToString()}";
                            await alertNotificationsChannel.SendMessageAsync(discordMessage);

                            alertManager.removeAlert(alert);
                        }
                        checkedAlerts.Add(_alert);
                    }
                }
                await Task.Delay(2000);
            }
        }
 protected void OnCloseGetProfileErr(int i)
 {
     AlertManager.ShowAlertDialog(null, "C-US01");
 }
Example #20
0
    // OnInspector GUI
    public override void OnInspectorGUI()
    {
        // Call base class method
        base.DrawDefaultInspector();

        // Custom form for Player Preferences
        AlertManager alertManager = (AlertManager)target;

        GUILayout.Space(20f);
        GUILayout.Label("Summon Notification", EditorStyles.boldLabel);
        GUILayout.Space(10f);

        GUILayout.BeginHorizontal();
        GUILayout.Label("Alert Prefab", GUILayout.Width(labelWidth));
        prefab = (GameObject)EditorGUILayout.ObjectField(prefab, typeof(GameObject), true, GUILayout.Width(labelWidth));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Title", GUILayout.Width(labelWidth));
        title = GUILayout.TextField(title);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Description", GUILayout.Width(labelWidth));
        description = GUILayout.TextField(description);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Image", GUILayout.Width(labelWidth));
        sprite = (Sprite)EditorGUILayout.ObjectField(sprite, typeof(Sprite), true, GUILayout.Width(labelWidth));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Image Tint", GUILayout.Width(labelWidth));
        imageTint = EditorGUILayout.ColorField(imageTint, GUILayout.Width(labelWidth));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Auto Dismiss", GUILayout.Width(labelWidth));
        doesAutoDismiss = EditorGUILayout.Toggle(doesAutoDismiss, GUILayout.Width(labelWidth));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Auto Dismiss Time", GUILayout.Width(labelWidth));
        autoDismissTime = EditorGUILayout.Slider(autoDismissTime, 1f, 60f, GUILayout.Width(labelWidth));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Auto Dismiss Time", GUILayout.Width(labelWidth));
        sound = (AudioClip)EditorGUILayout.ObjectField(sound, typeof(AudioClip), true, GUILayout.Width(labelWidth));
        GUILayout.EndHorizontal();

        GUILayout.Space(10f);

        if (GUILayout.Button("Summon"))
        {
            alertManager.SummonNotification(prefab, title, description, sprite, imageTint, doesAutoDismiss, autoDismissTime, null, sound);
        }
        if (GUILayout.Button("Summon Raw Prefab"))
        {
            alertManager.SummonNotification(prefab);
        }
    }
Example #21
0
 public static bool ShowModalMessage(Action <int> action, string title, string message, AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close, bool useErrorCode = false)
 {
     return(AlertManager.ShowDialog <CMD_ModalMessage>(action, title, message, "CMD_ModalMessage", actionType, true, useErrorCode));
 }
Example #22
0
 private void AlertRemovedEvent_Handler(AlertModel alert)
 {
     AlertManager.RemoveAlerts(alert);
 }
Example #23
0
    private static bool ShowDialog <CMD_Type>(Action <int> action, string title, string message, string dialogName = "", AlertManager.ButtonActionType actionType = AlertManager.ButtonActionType.Close, bool isWarningIcon = true, bool useErrorCode = false) where CMD_Type : CMD
    {
        Action <int> action2 = delegate(int i)
        {
            if (action != null)
            {
                action(i);
            }
        };

        if (AlertManager.alertOpenedAction != null)
        {
            AlertManager.alertOpenedAction();
        }
        if (!useErrorCode)
        {
            AlertManager.lastErrorCode = "unknown:" + AlertManager.lastErrorCode;
        }
        PlayerPrefs.SetString("LastErrorInfo", ServerDateTime.Now + ":" + AlertManager.lastErrorCode);
        CMD_Type cmd_Type = GUIMain.ShowCommonDialog(action2, dialogName, null) as CMD_Type;

        if (cmd_Type != null)
        {
            string text = typeof(CMD_Type).ToString();
            if (text != null)
            {
                if (!(text == "CMD_Alert"))
                {
                    if (!(text == "CMD_maintenance"))
                    {
                        if (text == "CMD_ModalMessage")
                        {
                            CMD_ModalMessage cmd_ModalMessage = cmd_Type as CMD_ModalMessage;
                            cmd_ModalMessage.Title = title;
                            cmd_ModalMessage.Info  = message;
                            AlertManager.ExecuteOnCreateAlert(true, null);
                        }
                    }
                    else
                    {
                        CMD_maintenance cmd_maintenance = cmd_Type as CMD_maintenance;
                        cmd_maintenance.Info = message;
                    }
                }
                else
                {
                    CMD_Alert cmd_Alert = cmd_Type as CMD_Alert;
                    cmd_Alert.Title     = title;
                    cmd_Alert.Info      = message;
                    cmd_Alert.IsWarning = isWarningIcon;
                    switch (actionType)
                    {
                    case AlertManager.ButtonActionType.Close:
                        cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.CLOSE);
                        break;

                    case AlertManager.ButtonActionType.Retry:
                        cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.RETRY);
                        break;

                    case AlertManager.ButtonActionType.TitleAndRetry:
                        cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.TITLE_AND_RETRY);
                        break;

                    case AlertManager.ButtonActionType.Title:
                        cmd_Alert.SetDisplayButton(CMD_Alert.DisplayButton.TITLE);
                        break;
                    }
                    AlertManager.ExecuteOnCreateAlert(true, cmd_Alert);
                }
            }
            return(true);
        }
        if (action != null)
        {
            action(0);
        }
        UnityEngine.Debug.Log("Create Failed CMD : " + title + ", " + message);
        return(false);
    }
        public async Task RemoveAlertAsync(int id)
        {
            string response = await AlertManager.RemoveAlertCommand(id);

            await ReplyAsync(response);
        }
Example #25
0
    // Use this for initialization
    void Start()
    {
        alert = GameObject.Find("Alert System").GetComponent<AlertManager>();

        roomX = 0;
        roomZ = 0;

        dButton = GameObject.Find("Door Button").GetComponent<DoorButton>();

        playerObject = GameObject.FindGameObjectWithTag("Player");
        level = GameObject.Find("Level").GetComponent<Level>();

        nextRoomInformation = GameObject.Find("NextRoomInfo").GetComponent<NextRoomInfo>();

        currentRoom = transform.parent.parent.parent.GetComponent<Room>();
        if(currentRoom){
            roomX = currentRoom.xIndex;
            roomZ = currentRoom.zIndex;
        }

        leftDoor 	= transform.Find("LeftDoor");
        rightDoor 	= transform.Find("RightDoor");

        closedScale = leftDoor.localScale;
        openScale = new Vector3(leftDoor.localScale.x * 0.1f, leftDoor.localScale.y, leftDoor.localScale.z);;
        targetScale = closedScale;

        leftDoorClosedPosition 	= leftDoor.transform.position;
        leftDoorOpenPosition 	= leftDoor.transform.position + (-transform.right * 0.3f);
        targetLeftDoorPosition 	= leftDoorClosedPosition;

        rightDoorClosedPosition 	= rightDoor.transform.position;
        rightDoorOpenPosition 		= rightDoor.transform.position + (transform.right * 0.3f);
        targetRightDoorPosition		= rightDoorClosedPosition;

        canvasObject = GameObject.Find("Canvas");
        sFade = GameObject.Find("Screen Fade").GetComponent<ScreenFade>();
    }
Example #26
0
 public void Delete(int alertId)
 {
     using (var manager = new AlertManager(null))
         manager.DeleteAlert(alertId);
 }
        /// <summary>
        /// This method update one CustomerCall.
        /// </summary>
        /// <param name=entity>original_entity</param>
        /// <param name=entity>entity</param>
        public void UpdateCustomerCall(CustomerCall original_entity, CustomerCall entity)
        {
            if (original_entity.CustomerCallStatusId == CustomerCallStatus.Closed)
                entity.ClosedDate = DateTime.Now;

            if (!original_entity.TechnicalEmployeeId.HasValue && entity.TechnicalEmployeeId.HasValue &&
                original_entity.UserId.HasValue)
            {
                var manager = new AlertManager(this);
                Employee employee = new HumanResourcesManager(this).GetEmployee(entity.CompanyId,
                                                                                (int)entity.TechnicalEmployeeId);

                manager.InsertAlert(entity.UserId.Value,
                                    "Olá " + original_entity.User.Profile.FirstName + ", prazer!<br /> Meu nome é " +
                                    employee.Profile.AbreviatedName +
                                    " e sou o responsável pelo seu chamado, que está em análise!");
            }

            SetCustomerCallPriority(entity);
            original_entity.CopyPropertiesFrom(entity);
            original_entity.ModifiedDate = DateTime.Now;
            DbContext.SubmitChanges();
        }
Example #28
0
 public void Delete(int alertId)
 {
     using (var manager = new AlertManager(null))
         manager.DeleteAlert(alertId);
 }
Example #29
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //
        // Replaced user control DateTimeInterval for DateTime using the new feature hour
        //
        if (ucEndDate.DateTime != null)
            if (ucBeginDate.DateTime.Value > ucEndDate.DateTime.Value)
            {
                ShowError(Resources.Exception.StartTimeIsBiggerThanEndTime);
                return;
            }

        _taskManager = new TaskManager(this);
        Task task = OriginalTask.Duplicate();
        task.Name = txtName.Text;

        if (Page.ViewState["ServiceOrderId"] != null)
        {
            task.SubjectId = Convert.ToInt32(Page.ViewState["ServiceOrderId"]);
            task.PageName = "serviceorder.aspx";
            ServiceOrder os = new ServicesManager(this).GetServiceOrder(task.SubjectId.Value);
            task.Name = "OS" + os.ServiceOrderNumber + " - " + task.Name;
        }

        task.TaskStatusId = Convert.ToInt32(cboTaskStatus.SelectedValue);
        task.Priority = Convert.ToInt32(rtnRanking.CurrentRating);
        task.Cost = ucCurrFieldCost.CurrencyValue;
        task.Deadline = ucDeadLineDate.DateTime;
        task.CreatorUserId = User.Identity.UserId;

        if (!String.IsNullOrEmpty(cboAlertMinutesBefore.SelectedValue))
            task.AlertMinutesBefore = Convert.ToInt32(cboAlertMinutesBefore.SelectedValue);

        if (CanChange)
            task.Description = txtDescription.Value.Replace("$0", "<br/>");

        if (!String.IsNullOrEmpty(cboParentTasks.SelectedValue))
            task.ParentTaskId = Convert.ToInt32(cboParentTasks.SelectedValue);

        task.FinishDate = ucEndDate.DateTime;

        if (ucBeginDate.DateTime > DateTime.MinValue.Sql2005MinValue())
            task.StartDate = ucBeginDate.DateTime;


        var alertManager = new AlertManager(this);


        if (Page.ViewState["TaskId"] != null)
        {
            _taskManager.SaveTask(OriginalTask, task, Users);

            if (alertManager.GetAlerts(task.TaskId, "task.aspx") != null)
                alertManager.DeleteAlerts(task.TaskId, "task.aspx");

        }
        else
            _taskManager.SaveTask(task, task, Users);


        if (!String.IsNullOrEmpty(Request["app"]))
            CreateAlerts(task);


        if (((WebControl)sender).ID == "btnSave")
        {
            if (task.PageName == "serviceorder.aspx")
                Response.Redirect("Appointments.aspx?ServiceOrderId=" + Request["ServiceOrderId"]);
            else if (!String.IsNullOrEmpty(Request["app"]))
                Response.Redirect("Appointments.aspx");
            else
                Response.Redirect("Tasks.aspx");
        }
        else
        {
            var appointment = Request["app"];
            Response.Redirect("Task.aspx?app=" + appointment);
        }

    }
Example #30
0
 private void Awake()
 {
     instance = this;
 }
Example #31
0
    void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            if (this != _instance)
                Destroy(this.gameObject);
        }
        mCanvasRect = GetComponent<RectTransform>();

        prefab.CreatePool();
    }
Example #32
0
 public static bool ShowAlertDialog(Action <int> action, string errorCode)
 {
     AlertManager.lastErrorCode = errorCode;
     if (errorCode == "LOCAL_ERROR_TIMEOUT")
     {
         string @string = StringMaster.GetString("AlertNetworkErrorTitle");
         string string2 = StringMaster.GetString("AlertNetworkErrorTimeOut");
         return(AlertManager.ShowAlertDialog(action, @string, string2, AlertManager.ButtonActionType.Retry, true));
     }
     if (errorCode == "LOCAL_ERROR_WWW")
     {
         string string3 = StringMaster.GetString("AlertDataErrorTitle");
         string string4 = StringMaster.GetString("AlertDataErrorInfo");
         return(AlertManager.ShowAlertDialog(action, string3, string4, AlertManager.ButtonActionType.Retry, true));
     }
     if (errorCode == "LOCAL_ERROR_JSONPARSE")
     {
         string string5 = StringMaster.GetString("SaveFailedTitle");
         string string6 = StringMaster.GetString("AlertJsonErrorInfo");
         return(AlertManager.ShowAlertDialog(action, string5, string6, AlertManager.ButtonActionType.Title, true));
     }
     if (errorCode == "LOCAL_ERROR_ASSET_DATA")
     {
         string string7 = StringMaster.GetString("AlertNetworkErrorTitle");
         string string8 = StringMaster.GetString("AlertNetworkErrorRetry");
         return(AlertManager.ShowAlertDialog(action, string7, string8, AlertManager.ButtonActionType.Retry, true));
     }
     if (errorCode == "LOCAL_ERROR_SAVE_DATA_IO")
     {
         string string9  = StringMaster.GetString("SaveFailedTitle");
         string string10 = StringMaster.GetString("SaveFailed-02");
         return(AlertManager.ShowAlertDialog(action, string9, string10, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "LOCAL_ERROR_SAVE_DATA_OTHER")
     {
         string string11 = StringMaster.GetString("SaveFailedTitle");
         string string12 = StringMaster.GetString("SaveFailed-01");
         return(AlertManager.ShowAlertDialog(action, string11, string12, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "LOCAL_ERROR_SAVE_DATA_SECURITY")
     {
         string string13 = StringMaster.GetString("SaveFailedTitle");
         string string14 = StringMaster.GetString("SaveFailed-03");
         return(AlertManager.ShowAlertDialog(action, string13, string14, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "E-AL09")
     {
         string string15 = StringMaster.GetString("TakeOver-12");
         string string16 = StringMaster.GetString("TakeOver-13");
         return(AlertManager.ShowAlertDialog(action, string15, string16, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "E-AL10")
     {
         string string17 = StringMaster.GetString("TakeOver-12");
         string string18 = StringMaster.GetString("TakeOver-13");
         return(AlertManager.ShowAlertDialog(action, string17, string18, AlertManager.ButtonActionType.Close, true));
     }
     if (!string.IsNullOrEmpty(AlertManager.GetNeptuneErrorString(errorCode)))
     {
         return(AlertManager.ShowAlertDialog(action, AlertManager.GetNeptuneErrorTitle(errorCode), AlertManager.GetNeptuneErrorString(errorCode), AlertManager.ButtonActionType.Close, true));
     }
     GameWebAPI.RespDataMA_MessageM.MessageM alert = AlertMaster.GetAlert(errorCode);
     if (alert == null)
     {
         alert = AlertMaster.GetAlert("E-GP01");
     }
     if (alert == null)
     {
         return(AlertManager.ErrorCallback(action, errorCode));
     }
     AlertManager.ButtonActionType actionType = (AlertManager.ButtonActionType) int.Parse(alert.actionType);
     AlertManager.DialogType       dialogType = (AlertManager.DialogType) int.Parse(alert.actionValue);
     if (dialogType == AlertManager.DialogType.Alert)
     {
         return(AlertManager.ShowAlertDialog(action, alert.messageTitle, alert.messageText, actionType, true));
     }
     if (dialogType != AlertManager.DialogType.Modal)
     {
         return(AlertManager.ShowAlertDialog(action, alert.messageTitle, alert.messageText, actionType, true));
     }
     return(AlertManager.ShowModalMessage(action, alert.messageTitle, alert.messageText, actionType, true));
 }
 public void HideAlert()
 {
     AlertManager.HideAlert(pnlAlert);
 }
        /// <summary>
        /// this method closes a customerCall
        /// </summary>
        /// <param name="entity"></param>
        public void CloseCustomerCall(Int32 customerCallId)
        {
            CustomerCall entity = GetCustomerCall(customerCallId);
            entity.CustomerCallStatusId = CustomerCallStatus.Closed;
            entity.ClosedDate = DateTime.Now.Date;
            DbContext.SubmitChanges();

            //
            // Send a message to customer alerting that your call was closed
            //
            if (entity.UserId.HasValue)
            {
                string message = "";
                switch (entity.CustomerCallTypeId)
                {
                    case CustomerCallType.ACCOLADE:
                        message = "Toda a equipe da Vivina, agradece seu elogio, fica muito satisfeita ao saber que existem pessoas sendo beneficiadas pelo sistema!";
                        break;
                    case CustomerCallType.COMPLAINT:
                        message = "Obrigado por ter reclamado dos nossos serviços, somente assim podemos aprender, corrigir e saber o que fazer para não errar mais.<br /><br />Muito Obrigado!";
                        break;
                    case CustomerCallType.ERROR:
                        message = String.Format("<center>O erro que deu em {0} no dia {1} foi corrigido! Conosco essas joaninhas não tem vez!" +
                                                "<br /><br />" +
                                                "<a href='javascript:;' onclick=\"top.$.LightBoxObject.show('CRM/CustomerCall.aspx?lightbox[iframe]=true&ModalPopUp=1&ReadOnly=true&CustomerCallId={2}');\">" +
                                                "   Clique aqui para ver o chamado gerado!" +
                                                "</a>" +
                                                "</center>",
                                                entity.Sector,
                                                entity.OpenedDate.ToShortDateString(),
                                                entity.CustomerCallId.ToString());
                        break;
                    case CustomerCallType.SUGESTION:
                        message = "Obrigado pela sugestão, nós iremos cuidar para que sua idéia seja levada em consideração na próxima versão!";
                        break;
                    case CustomerCallType.SUPPORT:
                        message = "Toda a equipe da Vivina fica muito satisfeita ao saber que existem pessoas sendo beneficiadas pelo sistema!";
                        break;
                }

                var manager = new AlertManager(this);
                manager.InsertAlert(entity.UserId.Value, message);
            }
        }
Example #35
0
 public BaseController()
 {
     alertManager = AlertManager.Instance;
 }
Example #36
0
    private void OnClickedInfo()
    {
        bool flag = false;

        if (CMD_ChatTop.instance != null)
        {
            flag = CMD_ChatTop.instance.isRecruitListLock;
        }
        else if (null != this.parentDialog)
        {
            flag = this.parentDialog.isRecruitListLock;
        }
        if (!flag)
        {
            if (!this.isOpenedQuest)
            {
                AlertManager.ShowModalMessage(delegate(int modal)
                {
                }, StringMaster.GetString("Recruit-04"), StringMaster.GetString("Recruit-05"), AlertManager.ButtonActionType.Close, false);
                return;
            }
            if (!Singleton <UserDataMng> .Instance.IsOverUnitLimit(ClassSingleton <MonsterUserDataMng> .Instance.GetMonsterNum() + ConstValue.ENABLE_SPACE_TOEXEC_DUNGEON))
            {
                if (!Singleton <UserDataMng> .Instance.IsOverChipLimit(ConstValue.ENABLE_SPACE_TOEXEC_DUNGEON))
                {
                    MultiTools.DispLoading(true, RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON);
                    GameWebAPI.RespDataWD_GetDungeonInfo respDataWD_GetDungeonInfo = new GameWebAPI.RespDataWD_GetDungeonInfo();
                    respDataWD_GetDungeonInfo = ClassSingleton <QuestData> .Instance.GetDngeonInfoByWorldAreaId(this.data.worldAreaId);

                    if (respDataWD_GetDungeonInfo != null)
                    {
                        foreach (GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo worldDungeonInfo2 in respDataWD_GetDungeonInfo.worldDungeonInfo)
                        {
                            foreach (GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons dungeons2 in worldDungeonInfo2.dungeons)
                            {
                                if (dungeons2.worldDungeonId == int.Parse(this.data.worldDungeonId))
                                {
                                    ClassSingleton <PartyBossIconsAccessor> .Instance.StageEnemies = dungeons2.encountEnemies;
                                }
                            }
                        }
                        ClassSingleton <QuestData> .Instance.SelectDungeon = ClassSingleton <QuestData> .Instance.GetWorldDungeonMaster(this.data.worldDungeonId);

                        DataMng.Instance().GetResultUtilData().SetLastDngReq(this.data.worldDungeonId, "-1", "-1");
                        GameWebAPI.MultiRoomJoin multiRoomJoin = new GameWebAPI.MultiRoomJoin();
                        multiRoomJoin.SetSendData = delegate(GameWebAPI.ReqData_MultiRoomJoin param)
                        {
                            param.roomId   = int.Parse(this.data.multiRoomId);
                            param.password = string.Empty;
                        };
                        multiRoomJoin.OnReceived = delegate(GameWebAPI.RespData_MultiRoomJoin response)
                        {
                            CMD_MultiRecruitPartyWait.roomJoinData = response;
                        };
                        GameWebAPI.MultiRoomJoin request = multiRoomJoin;
                        base.StartCoroutine(request.RunOneTime(delegate()
                        {
                            RestrictionInput.EndLoad();
                            CMD_MultiRecruitPartyWait.UserType    = CMD_MultiRecruitPartyWait.USER_TYPE.MEMBER;
                            CMD_MultiRecruitPartyWait.StageDataBk = this.data;
                            CMD_MultiRecruitPartyWait cmd_MultiRecruitPartyWait = GUIMain.ShowCommonDialog(null, "CMD_MultiRecruitPartyWait", null) as CMD_MultiRecruitPartyWait;
                            cmd_MultiRecruitPartyWait.SetParentDialog(this.parentDialog);
                        }, delegate(Exception noop)
                        {
                            RestrictionInput.EndLoad();
                            if (null != this.parentDialog)
                            {
                                this.parentDialog.AddExcludeRoomIdList(this.data.multiRoomId);
                                this.parentDialog.ReBuildMultiRecruitList();
                            }
                        }, null));
                    }
                    else
                    {
                        CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                        cmd_ModalMessage.Title = StringMaster.GetString("QuestEventTitle");
                        cmd_ModalMessage.Info  = StringMaster.GetString("QuestEventInfo2");
                    }
                }
                else
                {
                    CMD_UpperlimitChip cmd_UpperlimitChip = GUIMain.ShowCommonDialog(null, "CMD_UpperlimitChip", null) as CMD_UpperlimitChip;
                    cmd_UpperlimitChip.SetType(CMD_UpperlimitChip.MessageType.QUEST);
                }
            }
            else
            {
                CMD_UpperLimit cmd_UpperLimit = GUIMain.ShowCommonDialog(null, "CMD_Upperlimit", null) as CMD_UpperLimit;
                cmd_UpperLimit.SetType(CMD_UpperLimit.MessageType.QUEST);
            }
        }
    }
Example #37
0
 public ImageManager(AlertManager alertManager)
 {
     this.alertManager = alertManager;
 }
Example #38
0
    /// <summary>
    /// This method creates two alerts to specified appointment
    /// </summary>
    private void CreateAlerts(Task task)
    {
        var alertManager = new AlertManager(this);

        var alertBeforeOfAppointment = new Alert
        {
            PageName = "task.aspx",
            SubjectId = task.TaskId,
            ShowDate = task.StartDate.Value.AddDays(-1),
            UserId = User.Identity.UserId,
            Description = "Compromisso '" + task.Name + "' será amanhã dia " + task.StartDate + " !"
        };

        var alertInDayOfAppointment = new Alert
        {
            PageName = "task.aspx",
            SubjectId = task.TaskId,
            ShowDate = task.StartDate.Value,
            UserId = User.Identity.UserId,
            Description = "Compromisso '" + task.Name + "' é hoje dia " + task.StartDate + " !"
        };

        alertManager.InsertAlert(alertBeforeOfAppointment);
        alertManager.InsertAlert(alertInDayOfAppointment);
    }
Example #39
0
 public AdminAlertsService(AlertManager alertManager)
 {
     _alertManager = alertManager;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AlertManagerTests"/> class.
 /// </summary>
 public AlertManagerTests()
 {
     this.alertRepository = new Mock<IAlertRepository>();
     this.alertManager = new AlertManager(this.alertRepository.Object);
 }
Example #41
0
 // Start is called before the first frame update
 void Start()
 {
     prevTime     = GameTime.Instance.GameDate();
     alertManager = GameObject.FindObjectOfType <AlertManager>();
 }