Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            float        salary       = SQLiteDataAccess.person.GetSalary(dateTimePicker1.Value);
            List <float> salariesList = new List <float>();

            if (SQLiteDataAccess.person.Subordinates != null)
            {
                for (int index = 0; index < SQLiteDataAccess.person.Subordinates.Length / 2; index++)
                {
                    int id = int.Parse(SQLiteDataAccess.person.Subordinates[index, 0]);
                    SQLiteDataAccess.MakeSecondWorker(id);
                    salariesList.Add(SQLiteDataAccess.secondPerson.GetSalary(dateTimePicker1.Value));
                }
                SQLiteDataAccess.person.SalaryList = salariesList;
            }
            label2.Text            = salary + " руб.";
            listBox1.SelectedIndex = -1;
            label4.Text            = "";

            float salarySum    = 0.00f;
            int   entriesCount = SQLiteDataAccess.GetEntriesCount();

            for (int index = 0; index < entriesCount; index++)
            {
                SQLiteDataAccess.MakeSecondWorker(index + 1);
                salarySum += SQLiteDataAccess.secondPerson.GetSalary(dateTimePicker1.Value);
            }
            label5.Text     = salarySum + " руб.";
            button1.Visible = false;
        }
Пример #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            label2.Text = SQLiteDataAccess.person.Salary + " руб.";

            float salarySum    = 0.00f;
            int   entriesCount = SQLiteDataAccess.GetEntriesCount();

            for (int index = 0; index < entriesCount; index++)
            {
                SQLiteDataAccess.MakeSecondWorker(index + 1);
                salarySum += SQLiteDataAccess.secondPerson.Salary;
            }
            label5.Text = salarySum + " руб.";
            if (SQLiteDataAccess.person is Manager || SQLiteDataAccess.person is Salesman)
            {
                string[,] subordinates = SQLiteDataAccess.person.Subordinates;
                for (int index = 0; index < subordinates.Length; index++)
                {
                    listBox1.Items.Add(subordinates[index, 1]);
                }
            }
        }