private void button1_Click(object sender, EventArgs e)
        {
            Potvrda potvrda = new Potvrda();

            if (potvrda.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Application.Exit();
            }
        }
예제 #2
0
        private void btnRmovePrevoznik_Click(object sender, EventArgs e)
        {
            Potvrda potvrda = new Potvrda();

            if (potvrda.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                LogIn.Prevoznici.Remove(lstPrevoznici.SelectedItem as Prevoznik);
                lstPrevoznici.Items.Clear();
                PrevozniciRefresh();

                LogIn.objekt = new Ser(LogIn.Prevoznici);
                System.Runtime.Serialization.IFormatter fmt = new
                                                              System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                FileStream strm = new FileStream("avtobuska.db", FileMode.Create,
                                                 FileAccess.Write, FileShare.None);
                fmt.Serialize(strm, LogIn.objekt);
                strm.Close();
            }

            VkupnoRefresh();
        }