예제 #1
0
        public void Alert(string namep, string prepby, string venue, string status, CustomNotif.enmtype enmtype)
        {
            CustomNotif cus = new CustomNotif();

            cus.shoWAlert(namep, prepby, venue, status, enmtype);
        }
예제 #2
0
        public void shoWAlert(string namep, string prepby, string venue, string status, enmtype type)
        {
            this.Opacity       = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

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

                if (cus == 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 enmtype.Pending:
                this.label1.Text = namep;
                this.label2.Text = prepby;
                this.label3.Text = venue;
                this.label5.Text = status;
                this.BackColor   = Color.Green;
                break;

            case enmtype.Accepted:
                this.label1.Text = namep;
                this.label2.Text = prepby;
                this.label3.Text = venue;
                this.label5.Text = status;
                this.BackColor   = Color.ForestGreen;
                break;

            case enmtype.Rejected:
                this.label1.Text = namep;
                this.label2.Text = prepby;
                this.label3.Text = venue;
                this.label5.Text = status;
                this.BackColor   = Color.IndianRed;
                break;

            case enmtype.Upcoming:
                this.label1.Text = namep;
                this.label2.Text = prepby;
                this.label3.Text = venue;
                this.label5.Text = status;
                this.BackColor   = Color.Red;
                break;

            case enmtype.Banned:
                this.label1.Text = namep;
                this.label2.Text = prepby;
                this.label3.Text = venue;
                this.label5.Text = status;
                this.BackColor   = Color.Blue;
                break;
            }
            this.Show();
            this.action          = enAc.start;
            this.timer1.Interval = 1;
            timer1.Start();
        }