コード例 #1
0
        /* Domain Logic Functions*/
        public double AverageSalary()
        {
            TableData = _dataGateway.Find();
            double SalarySum = 0;

            foreach (DataRow row in this.TableData.Rows)
            {
                SalarySum += Double.Parse(row[4].ToString());
            }

            return(SalarySum / TableData.Rows.Count);
        }
コード例 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            CustomerTableModule CustomerModule = new CustomerTableModule(CustomerTableGateway.Find());

            lblAvgSalary.Text = CustomerModule.AverageSalary().ToString();
        }