Exemple #1
0
        public void Save(Worker Worker)
        {
            int ID = GenerationID(@"BD.db");
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"BD.db", true))
            {
                file.WriteLine(ID + " " + Worker.Name + " " + Worker.Age + " " + Worker.Position + " " + Worker.Wage + " " + Worker.BranchID);

            }
        }
Exemple #2
0
        public void Save_Click(object sender, EventArgs e)
        {
            try
            {
                string NameWorker = textBox1.Text;
                int AgeWorker = Convert.ToInt16(textBox2.Text);
                Positions PositionWorker = (Positions)PositionList.SelectedIndex;
                double WageWorker = double.Parse(textBox4.Text);
                int BranchIDWorker = Convert.ToInt32(textBox5.Text);

                Worker Vasyan = new Worker(NameWorker, AgeWorker, PositionWorker, WageWorker, BranchIDWorker);

                SaveWorker.Save(Vasyan);
                this.Close();
            }

            catch(Exception)
            {
                var Error = new Error();
                Error.Show();
            }
        }