Пример #1
0
        public FormNotification(string messsage, NotificationType type)
        {
            InitializeComponent();
            btnGoruntule.Visible = false;
            btnEnglish.Visible   = false;
            btnMobil.Visible     = false;
            btnYazdir.Visible    = false;


            TopMost       = true;
            Opacity       = 0.0;
            StartPosition = FormStartPosition.Manual;
            string fname;

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

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

            switch (type)
            {
            case NotificationType.Success:
                pictureBox1.Image = Resources.success;
                BackColor         = Color.SeaGreen;
                break;

            case NotificationType.Error:
                pictureBox1.Image = Resources.error;
                BackColor         = Color.DarkRed;
                break;

            case NotificationType.Info:
                pictureBox1.Image = Resources.info;
                BackColor         = Color.RoyalBlue;
                break;

            case NotificationType.Warning:
                pictureBox1.Image = Resources.warning;
                BackColor         = Color.DarkOrange;
                break;
            }



            lblMsg.Text     = messsage;
            action          = NotificationAction.start;
            timer1.Interval = 1;
            timer1.Start();
        }
Пример #2
0
        private void ShowNotification(ResponseBarcode responseBarcode, bool isRetail = false)
        {
            FormNotification fn = new FormNotification(responseBarcode, isRetail);

            fn.TopLevel = true;
            fn.TopMost  = true;
            fn.ShowDialog();
        }
Пример #3
0
        public FormNotification(ResponseBarcode responseBarcode, bool isRetail = false)
        {
            InitializeComponent();

            btnGoruntule.Visible = true;
            btnYazdir.Visible    = true;

            if (isRetail)
            {
                btnEnglish.Visible = responseBarcode.Data.Supported_multi_lang || false;
                btnMobil.Visible   = responseBarcode.Data.Has_mobile_app || false;
            }


            selectedResponseBarcode = responseBarcode;

            TopMost       = true;
            Opacity       = 1;
            StartPosition = FormStartPosition.Manual;
            string fname;

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

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



            string messsage = string.Format("{0} reçetesi hazır", responseBarcode.Data.Patient_name);

            if (isRetail)
            {
                messsage = responseBarcode.Title;
            }

            pictureBox1.Image = Resources.success;
            BackColor         = Color.SeaGreen;
            lblMsg.Text       = messsage;
            action            = NotificationAction.start;
            timer1.Interval   = 1;
            timer1.Start();
        }