Example #1
0
 private void ShowNotification(string content, string folderPath, AlertTypeEnum alertTypeEnum = AlertTypeEnum.Success)
 {
     Invoke(new Action(() =>
     {
         Common.Alert(content, folderPath, alertTypeEnum);
     }));
 }
 public static void AddAlert(this Controller controller, AlertTypeEnum alertType, HtmlString title, HtmlString body, bool dismissable)
 {
     controller.AddAlert(new Alert()
     {
         Type = alertType, Title = title, Body = body, Dismissable = dismissable
     });
 }
Example #3
0
        //显示Ok提示框,只有Ok按钮,没有取消、关闭按钮
        //按钮点击后,窗口自动关闭
        public void ShowOkAlert(string tip, string cmd, ClickCallback okFun, string textOk)
        {
            if ("" == textOk)
            {
                textOk = LanguageManager.GetWord("ConfirmView.Ok");
            }

            alertType = AlertTypeEnum.Ok;
            ShowWindow(tip, cmd, okFun, textOk, null, "");
        }
Example #4
0
 public AlertItem(string ItemNo, string Description, AlertTypeEnum AlertType, AlertSeverityEnum Severity, bool ActionNeeded, Nullable <decimal> MacolaQOH, Nullable <decimal> AccessQOH)
 {
     m_sItemNo       = ItemNo;
     m_sDescription  = Description;
     m_iType         = AlertType;
     m_iSeverity     = Severity;
     m_bActionNeeded = ActionNeeded;
     m_dblMacolaQOH  = MacolaQOH;
     m_dblAccessQOH  = AccessQOH;
 }
Example #5
0
        public static void CreateAlert(this Controller controller, AlertTypeEnum alertType, List <string> messages, bool isInternalServerError = false, bool canCloseAlert = true)
        {
            var alertViewModel = new AlertViewModel
            {
                AlertType             = alertType,
                IsInternalServerError = isInternalServerError,
                Messages      = messages,
                CanCloseAlert = canCloseAlert
            };

            controller.TempData["alerts"] = alertViewModel;
        }
Example #6
0
        public bool SetAlert(string msg, string folderPath, AlertTypeEnum type)
        {
            FolderDownloadedPath = folderPath;
            this.Opacity = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 1; i < 10; i++)
            {
                fname = "alert" + i.ToString();
                FormAlert f = (FormAlert)Application.OpenForms[fname];

                if (f == null)
                {
                    this.Name = fname;
                    this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15;
                    this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i;
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }

            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;
            switch (type)
            {
                case AlertTypeEnum.Success:
                    this.GunaPictureBox1.Image = Resources.Checkmark_28px;
                    this.BackColor = Color.FromArgb(42, 171, 160);
                    break;
                case AlertTypeEnum.Warning:
                    this.GunaPictureBox1.Image = Resources.Warning_28px;
                    this.BackColor = Color.FromArgb(255, 179, 2);
                    break;
                case AlertTypeEnum.Error:
                    this.GunaPictureBox1.Image = Resources.Error_28px;
                    this.BackColor = Color.FromArgb(255, 121, 70);
                    break;
                case AlertTypeEnum.Info:
                    this.GunaPictureBox1.Image = Resources.Info_28px;
                    this.BackColor = Color.FromArgb(71, 169, 248);
                    break;
            }
            this.GunaLabel1.Text = msg;

            this.ShowInTaskbar = false;
            this.TopMost = true;
            this.Show();
            this.action = actionEnum.start;
            this.Timer1.Interval = 1;
            this.Timer1.Start();
            return true;
        }
Example #7
0
        public void ShowAlertMessage(string content, AlertTypeEnum alertType)
        {
            if (Alerts == null)
            {
                Alerts = new List <AlertModel>();
            }

            Alerts.Add(new AlertModel
            {
                AlertType = alertType,
                Content   = content
            });
        }
Example #8
0
        //显示二者选一窗口,没有关闭按钮
        public void ShowSelectOneAlert(string tip, string cmd, ClickCallback okFun, string txtOk,
                                       ClickCallback cancelFun, string txtCancel)
        {
            alertType = AlertTypeEnum.SelectOne;

            if ("" == txtOk)
            {
                txtOk = LanguageManager.GetWord("ConfirmView.Ok");
            }

            if ("" == txtCancel)
            {
                txtCancel = LanguageManager.GetWord("ConfirmView.Cancel");
            }

            ShowWindow(tip, cmd, okFun, txtOk, cancelFun, txtCancel);
        }
 public static void AddAlert(this Controller controller, AlertTypeEnum alertType, HtmlString title, HtmlString body)
 {
     controller.AddAlert(alertType, title, body, false);
 }
Example #10
0
 public static void CreateAlert(this Controller controller, AlertTypeEnum alertType, string message, bool isInternalServerError = false, bool canCloseAlert = true)
 {
     controller.CreateAlert(alertType, new List <string> {
         message
     }, isInternalServerError, canCloseAlert);
 }
 /// <summary>
 /// This method returns all created grade of the given type.
 /// </summary>
 /// <param name="gradeType">This is the type of the grade.</param>
 /// <returns>Grade List.</returns>
 public static List <Alert> GetAll(AlertTypeEnum alertType)
 {
     return(InMemoryDatabaseSingleton.DatabaseInstance.SelectMany <Alert>(
                x => x.AlertType == alertType).OrderByDescending(
                x => x.CreationDate).ToList());
 }
Example #12
0
        public static void Create_MedicalEventAlert(int medicalEventId, string description, AlertTypeEnum alertType, int referenceId)
        {

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                MedicalEventAlert wMedicalEventAlert = new MedicalEventAlert();

                wMedicalEventAlert.CreationDate = DateTime.Now;
                
                wMedicalEventAlert.Enabled = true;
                wMedicalEventAlert.ReferenceId = referenceId;
                wMedicalEventAlert.MedicalEventId = medicalEventId;
                wMedicalEventAlert.Description = description;
                wMedicalEventAlert.AlertType = (int)alertType;
                dc.MedicalEventAlerts.AddObject(wMedicalEventAlert);
                dc.SaveChanges();
            }
        }
Example #13
0
        public static void Create_MedicalEventAlert(int medicalEventId, string description, AlertTypeEnum alertType, int referenceId)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                MedicalEventAlert wMedicalEventAlert = new MedicalEventAlert();

                wMedicalEventAlert.CreationDate = DateTime.Now;

                wMedicalEventAlert.Enabled        = true;
                wMedicalEventAlert.ReferenceId    = referenceId;
                wMedicalEventAlert.MedicalEventId = medicalEventId;
                wMedicalEventAlert.Description    = description;
                wMedicalEventAlert.AlertType      = (int)alertType;
                dc.MedicalEventAlerts.AddObject(wMedicalEventAlert);
                dc.SaveChanges();
            }
        }
Example #14
0
 // 显示普通信息,按钮名字为确定,取消
 // 按钮点击后,窗口自动关闭
 public void ShowOkCancelAlert(string tip, string cmd, ClickCallback okFun)
 {
     alertType = AlertTypeEnum.Common;
     ShowWindow(tip, cmd, okFun, LanguageManager.GetWord("ConfirmView.Ok"),
                null, LanguageManager.GetWord("ConfirmView.Cancel"));
 }
Example #15
0
 //显示提示信息  入参 tips ok按钮回调事件 ok按钮文字 cancel回调事件 cancel按钮文字
 //按钮点击后,窗口自动关闭
 public void ShowCommonAlert(string tip, string cmd, ClickCallback okFun,
                             string textOk, ClickCallback cancelFun, string textCancel)
 {
     alertType = AlertTypeEnum.Common;
     ShowWindow(tip, cmd, okFun, textOk, cancelFun, textCancel);
 }
 public static void AddAlert(this Controller controller, AlertTypeEnum alertType, string title, HtmlString body, bool dismissable)
 {
     controller.AddAlert(alertType, new HtmlString(System.Net.WebUtility.HtmlEncode(title)), body, dismissable);
 }
 /// <summary>
 /// Gets the last created class from the application.
 /// </summary>
 /// <param name="gradeTypeEnum">This is the grade type enum.</param>
 /// <returns>The grade</returns>
 public static Alert Get(AlertTypeEnum alertTypeEnum)
 {
     return(InMemoryDatabaseSingleton.DatabaseInstance.SelectMany <Alert>(x => x.AlertType == alertTypeEnum &&
                                                                          x.IsCreated).OrderByDescending(x => x.CreationDate).First());
 }
Example #18
0
        public static bool Alert(string msg, string folderPath, AlertTypeEnum type)
        {
            FormAlert f = new FormAlert();

            return(f.SetAlert(msg, folderPath, type));
        }