Exemplo n.º 1
0
        public static PopupNotifier GeneratePopup(string content, string title = "", int delay = 5000)
        {
            title   = title.Trim();
            content = content.Trim();
            delay   = (delay > 0 ? delay : 5000);

            PopupNotifier popupSuccess = new PopupNotifier();

            popupSuccess.Delay = delay;

            popupSuccess.ShowGrip      = false;
            popupSuccess.HeaderHeight  = 1;
            popupSuccess.BodyColor     = System.Drawing.Color.FromArgb(35, 35, 35);
            popupSuccess.GradientPower = 0;


            popupSuccess.TitleText = (title.Length > 0 ? title : "shsh Patri0tS");

            popupSuccess.TitleColor   = System.Drawing.Color.White;
            popupSuccess.TitleFont    = new System.Drawing.Font("Arial", 16);
            popupSuccess.TitlePadding = new Padding(10, 10, 10, 5);


            popupSuccess.ContentText = content;

            popupSuccess.ContentColor   = System.Drawing.Color.LightGray;
            popupSuccess.ContentFont    = new System.Drawing.Font("Arial", 12);
            popupSuccess.ContentPadding = new Padding(10);

            return(popupSuccess);
        }
        private void btnlogin_Click(object sender, RoutedEventArgs e)
        {
            /*Administracion adm = new Administracion();
             * adm.Owner = this;
             * adm.ShowDialog();*/

            // MessageBox.Show("Bienvenido " + txtnombre.Text);
            usuarioBLL usrbll = new usuarioBLL();
            bool       check  = usrbll.getLogin(txtnombre.Text, txtclave.Password);

            if (check)
            {
                int    rut    = usrbll.Getrut(txtnombre.Text, txtclave.Password);
                string nombre = usrbll.Get_nombrecompleto(rut);

                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.add;
                popup.ContentText       = "Bienvenido" + nombre;
                popup.AnimationDuration = 500;
                popup.Delay             = 3500;
                popup.Popup();
                Administracion adm = new Administracion();
                adm.lb_nombreusuario.Content = nombre;
                Close();
                adm.ShowDialog();
            }
            else
            {
                lb1.Content = "Credenciales o Rol Incorrectos, Intente nuevamente";
            }
        }
Exemplo n.º 3
0
        private void InitializeNotifier()
        {
            Notifier = new PopupNotifier()
            {
                TitleText = "Twitch Streamers Tracking Center",
                TitlePadding = new Padding(95, 7, 0, 0),

                Delay = 5500, // milliseconds
                AnimationInterval = 10,
                AnimationDuration = 1000,

                ShowCloseButton = true,
                ShowOptionsButton = false,
                ShowGrip = true,
                Scroll = true,

                ContentFont = new Font("Tahoma", 15),
                TitleFont = new Font("Tahoma", 10),

                ContentPadding = new Padding(60, 10, 0, 0),
                ImagePadding = new Padding(0),

                TitleColor = Color.White,
                BorderColor = Color.CornflowerBlue,
                BodyColor = Color.CornflowerBlue,

                ContentColor = Color.DarkBlue,        // should be
                ContentHoverColor = Color.DarkBlue,   // the same

                HeaderColor = Color.DodgerBlue,
                ButtonHoverColor = Color.CadetBlue
            };
        }
Exemplo n.º 4
0
        //сравнить два текста, при изменени текста в поле ввода
        private void typingTextChanged(object sender, TextChangedEventArgs e)
        {
            string typingText = this.typingText.Text.Trim().Replace(" ", "|");
            string sampleText = this.exampleText.Text.Trim().Replace(" ", "|");

            if (!getCurrentLetter(typingText.Length, typingText, sampleText))
            {
                popUp             = new PopupNotifier();
                popUp.ContentText = "Неправильный ввод";
                popUp.Popup();
            }
            else
            {
                char nextLetterToShow = nextLetter(typingText, sampleText);

                if (nextLetterToShow.ToString() != "|")
                {
                    popUp             = new PopupNotifier();
                    popUp.ContentText = nextLetterToShow.ToString();
                    popUp.Popup();
                }
                else if (nextLetterToShow.ToString() == "|")
                {
                    this.typingText.Text = this.typingText.Text + "|";
                    popUp             = new PopupNotifier();
                    popUp.ContentText = "Нажмите пробел";
                    popUp.Popup();
                }
            }
        }
Exemplo n.º 5
0
        public bool Delete(string id)
        {
            PopupNotifier popup = new PopupNotifier();

            popup.TitleText = "Ошибка";
            popup.BodyColor = Color.LightGray;
            gr691_invert db = new gr691_invert();

            try
            {
                int num = Convert.ToInt32(id);
                var d_e = db.Equipment.Where(i => i.id == num).FirstOrDefault();
                if (d_e == null)
                {
                    popup.ContentText = "Вы не выбрали строку";
                    popup.Popup();
                    return(false);
                }
                else
                {
                    db.Equipment.Remove(d_e);
                    db.SaveChanges();
                }
            }
            catch
            {
                popup.ContentText = "ОШИБКА";
                popup.Popup();
                return(false);
            }
            return(true);
        }
Exemplo n.º 6
0
 public void AddEmployeeWithUsername()
 {
     try
     {
         Connection.Open();
         SqlDataAdapter Adapter = new SqlDataAdapter("INSERT INTO EmployeeInformation (Name, EmployeeID, EmploymentStatus) VALUES ('" + (_firstName + " " + _middleName + " " + _lastName) + "','" + _employeeID + "','" + _status + "')", Connection);
         Adapter.SelectCommand.ExecuteNonQuery();
         SqlDataAdapter Adapter1 = new SqlDataAdapter("INSERT INTO UserInformation (Username, EmployeeName, Status, EmpID) VALUES ('" + _userName + "','" + (_firstName + " " + _middleName + " " + _lastName) + "','" + _status + "','" + _employeeID + "')", Connection);
         Adapter1.SelectCommand.ExecuteNonQuery();
         SqlDataAdapter Adapter2 = new SqlDataAdapter("INSERT INTO LogInInfo (Username, Password) VALUES ('" + _userName + "','" + _confirmPassword + "')", Connection);
         Adapter2.SelectCommand.ExecuteNonQuery();
         PopupNotifier popup = new PopupNotifier();
         popup.Image           = Properties.Resources.Successfull;
         popup.TitleText       = "Data Saved";
         popup.ContentText     = "Data Sucessfully Saved";
         popup.ShowCloseButton = false;
         popup.Popup();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Save Employee", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Connection.Close();
     }
     finally
     {
         Connection.Close();
     }
 }
Exemplo n.º 7
0
        private void btnShow_Click(object sender, EventArgs e)
        {
            PopupNotifier popupNotifier1 = new PopupNotifier();

            popupNotifier1.TitleText         = txtTitle.Text;
            popupNotifier1.ContentText       = txtText.Text;
            popupNotifier1.ShowCloseButton   = chkClose.Checked;
            popupNotifier1.ShowOptionsButton = chkMenu.Checked;
            popupNotifier1.ShowGrip          = chkGrip.Checked;
            popupNotifier1.Delay             = int.Parse(txtDelay.Text);
            popupNotifier1.AnimationInterval = int.Parse(txtInterval.Text);
            popupNotifier1.AnimationDuration = int.Parse(txtAnimationDuration.Text);
            popupNotifier1.TitlePadding      = new Padding(int.Parse(txtPaddingTitle.Text));
            popupNotifier1.ContentPadding    = new Padding(int.Parse(txtPaddingContent.Text));
            popupNotifier1.ImagePadding      = new Padding(int.Parse(txtPaddingIcon.Text));
            popupNotifier1.Scroll            = chkScroll.Checked;
            popupNotifier1.IsRightToLeft     = chkIsRightToLeft.Checked;
            if (chkIcon.Checked)
            {
                popupNotifier1.Image = Resources._157_GetPermission_48x48_72;
            }
            else
            {
                popupNotifier1.Image = null;
            }

            popupNotifier1.Popup();
        }
Exemplo n.º 8
0
        public void AfficheMessageNotification(Color couleurFond, string titre, string message)
        {
            PopupNotifier notifier = new PopupNotifier()
            {
                AnimationDuration = 1000,
                AnimationInterval = 10,
                BorderColor       = Color.Transparent,
                BodyColor         = couleurFond,
                ButtonHoverColor  = Color.FromArgb(24, 57, 101),
                ContentColor      = Color.White,
                ContentFont       = new Font(new FontFamily("Century Gothic"), 12),
                ContentHoverColor = Color.Gainsboro,
                ContentPadding    = new Padding(5),
                ContentText       = message,
                Delay             = 3000,
                GradientPower     = 80,
                HeaderColor       = Color.White,
                HeaderHeight      = 10,
                Image             = Resources.system_report_52px,
                ImagePadding      = new Padding(5),
                ImageSize         = new Size(40, 40),
                IsRightToLeft     = false,
                Size         = new Size(400, 150),
                TitleColor   = Color.White,
                TitleFont    = new Font(new FontFamily("Century Gothic"), 14),
                TitlePadding = new Padding(5),
                TitleText    = titre
            };

            notifier.Popup();
        }
Exemplo n.º 9
0
        private void btningresar_Click_1(object sender, RoutedEventArgs e)
        {
            UsuarioBLL usrbll = new UsuarioBLL();
            bool       check  = usrbll.getLogin(txtnomb.Text, txtcontra.Password);

            if (check)
            {
                int    rut    = usrbll.Getrut(txtnomb.Text, txtcontra.Password);
                string nombre = usrbll.Get_nombrecompleto(rut);

                PopupNotifier popup = new PopupNotifier();
                popup.TitleText         = "Aviso";
                popup.Image             = Properties.Resources.add;
                popup.ContentText       = "Bienvenido/a" + nombre;
                popup.AnimationDuration = 500;
                popup.Delay             = 3500;
                popup.Popup();
                Window1 adm = new Window1();
                adm.Owner       = this;
                adm.lb1.Content = nombre;
                adm.ShowDialog();
                Close();
            }
            else
            {
                MessageBox.Show("Credenciales o Rol Incorrectos \n Intente nuevamente");
            }
        }
Exemplo n.º 10
0
        void mostrarMensaje(String mensaje)
        {
            PopupNotifier popup = new PopupNotifier();

            popup.ContentText = mensaje;
            popup.Popup();
        }
Exemplo n.º 11
0
        public void loadCriticalStocks()
        {
            try
            {
                String critcalVal = "";
                String count      = pos.countCritical();
                int    i          = 0;
                using (MySqlDataReader reader = pos.loadCriticalStocks())
                {
                    while (reader.Read())
                    {
                        i++;
                        critcalVal += i + "." + reader["description"].ToString() + Environment.NewLine;
                    }
                }

                PopupNotifier pop = new PopupNotifier();
                pop.Image       = Properties.Resources.ekis;
                pop.TitleText   = count + " CRITACAL ITEM(S)";
                pop.ContentText = critcalVal;
                pop.Popup();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 12
0
 public static void Ok(string Title, string Message, bool Autohide = false)
 {
     i = cek();
     Console.Out.WriteLine(i);
     if (i < 4 && i != 0)
     {
         CustomFont.Add("Helve", Properties.Resources.HelveticaNeueLight);
         soc[i] = new PopupNotifier()
         {
             TitleText         = Title,
             ContentText       = Message,
             ContentFont       = CustomFont.GetFont("Helve", 10, FontStyle.Regular),
             TitleFont         = CustomFont.GetFont("Helve", 12, FontStyle.Regular),
             AnimationInterval = 10,
             AutoHide          = Autohide,
             ShowOptionsButton = false,
             ShowGrip          = false,
             ObjectNumber      = i,
             BodyColor         = Color.FromArgb(2, 163, 56),
             HeaderColor       = Color.FromArgb(2, 163, 56),
             Image             = Properties.Resources.ok,
             LastPos           = (i > 0) ? soc[i - 1].LastPos : 0,
             ImageSize         = new Size(40, 40)
         };
         soc[i].Popup();
         initNotif();
     }
     else
     {
         AntriPesan("Ok", Title, Message);
     }
 }
Exemplo n.º 13
0
 public static void Info(string Title, string Message, bool Autohide = false)
 {
     i = cek();
     if (i < 4 && i != 0)
     {
         CustomFont.Add("Helve", Properties.Resources.HelveticaNeueLight);
         soc[i] = new PopupNotifier()
         {
             TitleText         = Title,
             ContentText       = Message,
             AnimationInterval = 10,
             AutoHide          = Autohide,
             ShowOptionsButton = false,
             ShowGrip          = false,
             ObjectNumber      = i,
             BodyColor         = Color.FromArgb(24, 131, 233),
             HeaderColor       = Color.FromArgb(24, 131, 233),
             Image             = Properties.Resources.info,
             LastPos           = (i > 0) ? soc[i - 1].LastPos : 0,
             ImageSize         = new Size(40, 40)
         };
         soc[i].Popup();
         initNotif();
     }
     else
     {
         AntriPesan("Info", Title, Message);
     }
 }
Exemplo n.º 14
0
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
            if (m.Msg == WM_DRAWCLIPBOARD)
            {
                SendMessage(_ClipboardViewerNext, m.Msg, m.WParam, m.LParam);
                if (Clipboard.ContainsText())
                {
                    String TransferTargetText = Clipboard.GetText();

                    string LanguageType = JObject.Parse(GetPaPagoLanguageType(TransferTargetText))["langCode"].ToString();

                    if (LanguageType != "ko")
                    {
                        String  SMTTransferText   = GetPapagoSMTTransferText(TransferTargetText, LanguageType);
                        JObject SMTTransferResult = JObject.Parse(SMTTransferText);
                        String  SMTResultText     = SMTTransferResult["message"]["result"]["translatedText"].ToString();

                        String  NMTTransferText   = GetPapagoNMTTransferText(TransferTargetText, LanguageType);
                        JObject NMTTransferResult = JObject.Parse(NMTTransferText);
                        String  NMTResultText     = NMTTransferResult["message"]["result"]["translatedText"].ToString();

                        PopupNotifier popup = new PopupNotifier();
                        popup.Image       = Properties.Resources.transfer_icon;
                        popup.TitleText   = "This Language is " + LanguageType;
                        popup.ContentText = "[SMT]Transfer:  " + SMTResultText + "\n\n" + "[NMT]Transfer:  " + NMTResultText;
                        popup.Popup();
                    }
                }
            }
            else
            {
                base.WndProc(ref m);
            }
        }
Exemplo n.º 15
0
        public IActionResult ChangePassword(string notificationType)
        {
            INotifier notifier = null;

            switch (notificationType)
            {
            case "email":
                notifier = new EmailNotifier();
                break;

            case "sms":
                notifier = new SMSNotifier();
                break;

            case "popup":
                notifier = new PopupNotifier();
                break;
            }

            UserManager mgr = new UserManager(notifier);

            mgr.ChangePassword("user1", "oldpwd", "newpwd");

            return(View("Success"));
        }
Exemplo n.º 16
0
 public PopupWindow()
 {
     popup = new PopupNotifier();
     popup.AnimationDuration = 1000;
     popup.AnimationInterval = 1;
     popup.BodyColor = System.Drawing.Color.FromArgb(0,0,0);
     popup.BorderColor = System.Drawing.Color.FromArgb(0,0,0);
     popup.ContentColor = System.Drawing.Color.FromArgb(255,255,255);
     popup.ContentFont = new System.Drawing.Font("Tahoma",8F);
     popup.ContentHoverColor = System.Drawing.Color.FromArgb(255,255,255);
     popup.ContentPadding = new Padding(0);
     popup.Delay = 15000;
     popup.GradientPower = 100;
     popup.HeaderHeight = 1;
     popup.Scroll = true;
     popup.ShowCloseButton = false;
     popup.ShowGrip = false;
     popup.ClickForm += new EventHandler(popup_ClickForm);
     popup.ShowOptionsButton = true;
     ToolStripMenuItem DisableWordMenu = new ToolStripMenuItem("Disable");
     DisableWordMenu.Click += delegate {
         if(MenuClick != null)
             MenuClick(this,null);
     };
     popup.OptionsMenu = new ContextMenuStrip();
     popup.OptionsMenu.Items.Add(DisableWordMenu);
 }
Exemplo n.º 17
0
 private void Student_Load(object sender, EventArgs e)
 {
     if (est)
     {
         popup             = new PopupNotifier();
         popup.Image       = Properties.Resources.уведомления;
         popup.ImageSize   = new Size(96, 96);
         popup.TitleText   = "Расписание изменено";
         popup.ContentText = "Ваше расписание изменено";
         popup.Popup();
         con.Open();
         SqlCommand command4 = new SqlCommand($" DELETE FROM Changed WHERE id_user = '******';", con);
         command4.ExecuteNonQuery();
         con.Close();
         //SqlDataReader reader1 = command1.ExecuteReader();
         //reader1.Read();
         //int id_user = Convert.ToInt32(reader1[0]);
         //reader1.Close();
     }
     try
     {
         this.raspisanieForTableAdapter.Fill(this.dataSet1.RaspisanieFor, new System.Nullable <int>(((int)(System.Convert.ChangeType(id_user, typeof(int))))));
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 18
0
 private void AccountClick(object sender, RoutedEventArgs e)
 {
     if (txtPassword1.Password == "" || txtPassword2.Password == "" || txtPassword3.Password == "")
     {
         label1.Content    = "You must fill in all the fields!";
         label1.Visibility = Visibility.Visible;
     }
     else if (txtPassword1.Password == txtPassword2.Password)
     {
         label1.Content    = "Your current password is equal to the new one!";
         label1.Visibility = Visibility.Visible;
     }
     else if (txtPassword2.Password == txtPassword3.Password)
     {
         label1.Content    = "New password doesn't match to its confirmation!";
         label1.Visibility = Visibility.Visible;
     }
     else
     {
         PopupNotifier popup = new PopupNotifier();
         popup.TitleText   = "";
         popup.ContentText = "Password updated successfuly!";
         popup.Popup();
         HomeWindow win = new HomeWindow();
         win.Show();
         this.Close();
     }
 }
Exemplo n.º 19
0
        public void bildirimYazdir(String Tur, String Metin)
        {
            PopupNotifier popup  = new PopupNotifier();
            Bitmap        Icon   = null;
            String        Baslik = "";

            switch (Tur)
            {
            case "Basarili":
                Baslik = "Yeni Abonelik Başarıyla Oluşturuldu";
                Icon   = Properties.Resources.uyari2;   //icon from resources

                break;

            case "Basarisiz":
                Baslik = "Abonelik Oluşturulamadı";
                Icon   = Properties.Resources.basari;   //icon from resources
                break;

            default:
                Baslik = "Bildirim";
                break;
            }

            popup.TitleText   = Baslik;
            popup.Image       = Icon;
            popup.TitleFont   = new System.Drawing.Font("Tahoma", 20F);
            popup.ContentFont = new System.Drawing.Font("Tahoma", 15F);
            popup.ContentText = Metin;
            popup.Popup();// show
        }
Exemplo n.º 20
0
        public static PopupNotifier CreatePopup(string title, string text)
        {
            // https://www.c-sharpcorner.com/article/working-with-popup-notification-in-windows-forms/
            // https://github.com/Tulpep/Notification-Popup-Window

            PopupNotifier popup = new PopupNotifier();

            //popup.Image = Properties.Resources.info;
            popup.AnimationDuration = 400;
            popup.Delay             = 5000;
            popup.TitleText         = title;
            popup.ContentText       = text;

            popup.Size = new Size(500, 200);

            // https://docs.microsoft.com/de-de/dotnet/api/system.drawing.font?view=dotnet-plat-ext-3.1
            popup.ContentFont = new Font(
                popup.ContentFont.Name,
                12f,
                popup.ContentFont.Style,
                GraphicsUnit.Pixel
                );
            popup.ContentPadding = new Padding(8);

            popup.TitleFont = new Font(
                popup.ContentFont.Name,
                16f,
                FontStyle.Bold,
                GraphicsUnit.Pixel
                );
            popup.TitlePadding = new Padding(4);

            popup.Click += Popup_Click;
            return(popup);
        }
        public void DeleteUser(string Username)
        {
            try
            {
                Connection.Open();
                SqlDataAdapter Adapter = new SqlDataAdapter("DELETE FROM LogInInfo WHERE Username IN(SELECT Username FROM UserInformation WHERE Username = '******')", Connection);
                Adapter.SelectCommand.ExecuteNonQuery();
                SqlDataAdapter Adapter1 = new SqlDataAdapter("DELETE FROM UserInformation WHERE UserID IN(SELECT UserID FROM UserInformation WHERE UserName = '******')", Connection);
                Adapter1.SelectCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "User Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Connection.Close();
            }
            finally
            {
                Connection.Close();
            }
            PopupNotifier popup = new PopupNotifier();

            popup.Image           = Properties.Resources.Successfull;
            popup.TitleText       = "Data Delted";
            popup.ContentText     = "Data Sucessfully Deleted";
            popup.ShowCloseButton = false;
            popup.Popup();
        }
        public PopupNotification(string title, string body)
        {
            PopupNotifier popup = new PopupNotifier();

            popup.TitleText   = title;
            popup.ContentText = body;

            popup.TitleFont   = new Font("Segoe UI", 20, FontStyle.Bold);
            popup.ContentFont = new Font("Segoe UI", 13, FontStyle.Bold);

            popup.ContentPadding = new Padding(20, 0, 20, 20);
            popup.TitlePadding   = new Padding(20, 20, 20, 20);

            popup.TitleColor        = ColorTranslator.FromHtml(Constants.AppPrimaryColour);
            popup.BodyColor         = ColorTranslator.FromHtml(Constants.MenuButtonSelected);
            popup.ContentColor      = ColorTranslator.FromHtml(Constants.AppSecondaryColour);
            popup.ContentHoverColor = ColorTranslator.FromHtml(Constants.AppSecondaryColour);
            popup.BorderColor       = Color.Black;
            popup.ButtonBorderColor = ColorTranslator.FromHtml(Constants.MenuButtonSelected);

            popup.ShowCloseButton = true;
            popup.Delay           = 5000;
            popup.Size            = new Size(450, 200);
            popup.Popup();
        }
Exemplo n.º 23
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            while (client.Connected)
            {
                try
                {
                    recieve = STR.ReadLine();
                    if (recieve == null)
                    {
                        e.Result = "RESTART";
                        return;
                    }
                    this.ChatScreentextBox.Invoke(new MethodInvoker(delegate()
                    {
                        if (this.WindowState == FormWindowState.Minimized)
                        {
                            popup             = new PopupNotifier();
                            popup.TitleText   = "Co tin nhan moi!";
                            popup.ContentText = recieve;
                            popup.Close      += Popup_Close;
                            popup.Popup();
                        }

                        ChatScreentextBox.AppendText("You:" + recieve + Environment.NewLine);
                    }));
                    recieve = "";
                }
                catch (Exception ex)
                {
                }
            }
        }
Exemplo n.º 24
0
        private void OnTimeEvent(object sender, ElapsedEventArgs e)
        {
            // Create notification object.
            var popupNotifier = new PopupNotifier();

            //var test = txtResult.Text;
            Invoke(new Action(() =>
            {
                s += 1;
                if (s == 60)
                {
                    s  = 0;
                    m += 1;
                }
                if (m == 60)
                {
                    m  = 0;
                    h += 1;
                }
                txtResult.Text = string.Format("{0}:{1}:{2}", h.ToString().PadLeft(2, '0'), m.ToString().PadLeft(2, '0'), s.ToString().PadLeft(2, '0'));
                //Compare txtResult.Text with expected time period  txtResult.Text %60 == 0
                if (txtResult.Text == "00:30:00")
                {
                    popupNotifier.TitleText     = "Study session complete!";
                    popupNotifier.ContentText   = $"Congratulation on studying for {m} minutes!";
                    popupNotifier.IsRightToLeft = false;
                    popupNotifier.Popup();
                }
            }));
        }
Exemplo n.º 25
0
 private void btn_create_type_Click(object sender, EventArgs e)
 {
     using (ExamManagementSystemEntities db = new ExamManagementSystemEntities())
     {
         if (db.QuestionTypes.Any(item => item.QuestionTypeName == tbx_newtype.Text))
         {
             MessageBox.Show("You can not add it to Database", "Same Question Type",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             db.QuestionTypes.Add(new QuestionType()
             {
                 QuestionTypeName = tbx_newtype.Text
             });
             var popupNotifier = new PopupNotifier();
             popupNotifier.TitleText     = "Exam Management System";
             popupNotifier.ContentText   = $"Question Type is added at {DateTime.Now} : Question Type is {tbx_newtype.Text}";
             popupNotifier.IsRightToLeft = false;
             popupNotifier.Popup();
             db.SaveChanges();
             var bindingsource = new BindingSource();
             bindingsource.DataSource      = db.QuestionTypes.ToList();
             dgw_question_types.DataSource = bindingsource;
             dgw_question_types.Columns["Questions"].Visible = false;
         }
     }
 }
Exemplo n.º 26
0
        public void NotifyCriticalItems()
        {
            string critical = "";

            connect.Open();
            command = new MySqlCommand("SELECT COUNT(*) FROM vwcriticalitems", connect);
            string count = command.ExecuteScalar().ToString();

            connect.Close();

            int i = 0;

            connect.Open();
            command    = new MySqlCommand("SELECT * FROM vwcriticalitems", connect);
            DataReader = command.ExecuteReader();
            while (DataReader.Read())
            {
                i++;
                critical += i + "." + DataReader["pdescription"].ToString() + Environment.NewLine;
            }
            DataReader.Close();
            connect.Close();

            PopupNotifier popup = new PopupNotifier();

            popup.Image       = Properties.Resources.icons8_warning_48;
            popup.TitleText   = count + " CRITICAL ITEM(S)";
            popup.ContentText = critical;
            popup.Popup();
        }
Exemplo n.º 27
0
        public Form1()
        {
            r        = new Random();
            nextWord = 1;
            player   = new SoundPlayer(Properties.Resources.messenger);
            popup    = new PopupNotifier();

            popup.Appear += (s, ev) =>
            {
                timer1.Enabled = false;
                if (conf.Sound)
                {
                    player.Play();
                }
            };
            popup.Disappear += (s, e) => timer1.Enabled = true;

            popup.ContentPadding = new Padding(10);
            popup.TitlePadding   = new Padding(10);
            popup.HeaderColor    = Color.Black;
            popup.Size           = new Size(350, 250);

            popup.HeaderHeight = 25;

            inif = new INIFile(AppConfig.PATH);
            InitializeComponent();
        }
Exemplo n.º 28
0
        public void PlayMusic(Music music)
        {
            InPlaying           = music;
            UIPlayingMusic.Text = InPlaying.Title;
            UIArtist.Text       = InPlaying.Author.Name;
            UIFormat.Text       = InPlaying.Format;
            UIForward.Enabled   = true;
            UIBackward.Enabled  = true;
            player.PlayMusic(InPlaying);
            try
            {
                UIMusicImage.BackgroundImage = Tags.GetMetaImage(player.player.URL);
            }
            catch
            {
                UIMusicImage.BackgroundImage = Properties.Resources.No_Cover_Image;
            }
            PopupNotifier notifier = new PopupNotifier()
            {
                TitleText    = "Playing",
                ContentText  = music.Name,
                Size         = new System.Drawing.Size(200, 40),
                HeaderHeight = 5,
            };

            notifier.Popup();
        }
Exemplo n.º 29
0
        /// <summary>
        /// Timer event settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void frmlogin_Load(object sender, EventArgs e)
        {
            try
            {
                textBox1.Text       = Convert.ToInt32(1).ToString();
                txtcounters.Visible = false;
                textBox2.Visible    = false;
                mtlogintime.Text    = DateTime.Now.ToLongTimeString();
                mtdate.Text         = DateTime.Today.ToShortDateString();
                timer2.Start();
                Timer MyTimer = new Timer();
                MyTimer.Interval = (5 * 60 * 1000); // 5 mins
                MyTimer.Tick    += new EventHandler(timer1_Tick);
                MyTimer.Start();
                PopupNotifier popup = new PopupNotifier();
                popup.Image       = Properties.Resources.Excel_2013;
                popup.TitleText   = "TWMS";
                popup.ContentText = "To Start select user role";
                popup.Popup();
            }
            catch (Exception ex)
            {
                writeErrorLog("Error in frmlogin_Load: " + ex.Message);
            }
        }
Exemplo n.º 30
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            MySqlConnection con  = Conexion.Obtener_Conexion();
            MySqlCommand    com  = new MySqlCommand("UPDATE `autos` SET `marca`='" + txtMar.Text + "',`modelo`='" + txtMod.Text + "',`color`='" + txtCol.Text + "',`mat`='" + txtMat.Text + "',`vin`='" + txtVIN.Text + "' WHERE id_auto = " + num_auto + "", con);
            int             resu = com.ExecuteNonQuery();

            con.Close();
            if (resu > 0)
            {
                PopupNotifier popup = new PopupNotifier();
                popupNotifier1.Image       = Properties.Resources.info;
                popupNotifier1.TitleText   = "Automotriz Castillo";
                popupNotifier1.ContentText = "Se guardaron los cambios";
                popupNotifier1.Popup();

                this.Close();
            }
            else
            {
                PopupNotifier popup = new PopupNotifier();
                popupNotifier1.Image       = Properties.Resources.info;
                popupNotifier1.TitleText   = "Automotriz Castillo";
                popupNotifier1.ContentText = "No se guardaron los cambios";
                popupNotifier1.Popup();
            }
        }
Exemplo n.º 31
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try {
                using (TaskService ts = new TaskService()) {
                    if (chkEnable.Checked)   // Autosaving is being enabled

                    {
                        TaskDefinition td = ts.NewTask(); // We do not need to lookup & delete previous task given how RegisterTaskDefinition() works below

                        td.RegistrationInfo.Description = "Automatically check for and download shsh blobs for all enabled profiles.";

                        td.Triggers.Add(new DailyTrigger {
                            DaysInterval = 1, StartBoundary = dtpStartTime.Value
                        });
                        td.Actions.Add(new ExecAction(taskExecPath, (chkCondesneNotifications.Checked ? "1" : "0"), Directory.GetCurrentDirectory()));

                        ts.RootFolder.RegisterTaskDefinition(taskName, td); // This will overwrite any previous task with the given name
                    }
                    else                                                    // Autosaving is being disabled

                    {
                        ts.RootFolder.DeleteTask(taskName);
                    }
                }


                PopupNotifier popup = PopupHelper.GeneratePopup("Autosave Settings were updated successfully.");
                popup.Popup();

                this.Close();
            } catch (Exception ex) {
                MessageBox.Show("Error: " + ex.Message + "\n\n" + ex.StackTrace);
            }
        }
Exemplo n.º 32
0
 private void btnEliminarpieza_Click(object sender, EventArgs e)
 {
     if (dgvInventario.SelectedRows.Count == 1)
     {
         string nom = (string)dgvInventario.CurrentRow.Cells[1].Value;
         if (MessageBox.Show("¿Seguro que desea eliminar la pieza :" + nom + "?", "System", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             int             id        = (int)dgvInventario.CurrentRow.Cells[0].Value;
             MySqlConnection con       = Conexion.Obtener_Conexion();
             MySqlCommand    com       = new MySqlCommand("Delete From inventario where id_pieza = " + id + "", con);
             int             Resultado = com.ExecuteNonQuery();
             if (Resultado > 0)
             {
                 PopupNotifier popup = new PopupNotifier();
                 popupNotifier1.Image       = Properties.Resources.info;
                 popupNotifier1.TitleText   = "Automotriz Castillo";
                 popupNotifier1.ContentText = "Se elimino la pieza";
                 popupNotifier1.Popup();
                 Refrescar_y_cargar_datagrid();
             }
             else
             {
                 MessageBox.Show("No se Elimino");
             }
             con.Close();
         }
     }
 }
Exemplo n.º 33
0
        public PopupControll()
        {
            popup = new PopupNotifier();
            popup.AnimationDuration = 1000;
            popup.AnimationInterval = 1;
            popup.BodyColor = System.Drawing.Color.FromArgb(0, 0, 0);
            popup.BorderColor = System.Drawing.Color.FromArgb(0, 0, 0);
            popup.ContentColor = System.Drawing.Color.FromArgb(255, 255, 255);
            popup.ContentFont = new System.Drawing.Font("Tahoma", 8F);
            popup.ContentHoverColor = System.Drawing.Color.FromArgb(255, 255, 255);
            popup.ContentPadding = new Padding(0);
            popup.Delay = 4000;
            popup.GradientPower = 100;
            popup.HeaderHeight = 1;
            popup.Scroll = true;
            popup.ShowCloseButton = false;
            popup.ShowGrip = false;

            popup.ClickForm += new EventHandler(popup_ClickForm);
        }