Esempio n. 1
0
        public static decimal Total()
        {
            var ed = new CompanyDataSetTableAdapters.EmployeeTableAdapter();
            ed.Fill(Ds.Employee);

            var total = Ds.Employee.Sum(e => e.Salary);
            return total;
        }
Esempio n. 2
0
        public static decimal Total()
        {
            var ed = new CompanyDataSetTableAdapters.EmployeeTableAdapter();

            ed.Fill(Ds.Employee);

            var total = Ds.Employee.Sum(e => e.Salary);

            return(total);
        }
Esempio n. 3
0
        public static void Cut()
        {
            var ed = new CompanyDataSetTableAdapters.EmployeeTableAdapter();
            ed.Fill(Ds.Employee);

            foreach (var emp in Ds.Employee)
            {
                emp.Salary /= 2;
            }

            ed.Update(Ds);
        }
Esempio n. 4
0
        public static void Cut()
        {
            var ed = new CompanyDataSetTableAdapters.EmployeeTableAdapter();

            ed.Fill(Ds.Employee);

            foreach (var emp in Ds.Employee)
            {
                emp.Salary /= 2;
            }

            ed.Update(Ds);
        }
Esempio n. 5
0
        public static decimal SubTotalForDept(Guid deptId)
        {
            var dda = new CompanyDataSetTableAdapters.DepartmentTableAdapter();
            dda.Fill(Ds.Department);

            var eda = new CompanyDataSetTableAdapters.EmployeeTableAdapter();
            eda.Fill(Ds.Employee);

            var root = Ds.Department.Where(d => d.department_id == deptId).Single();
            var total = GetSubDeptsTotal(root, root.GetEmployeeRows().Sum(er => er.Salary));

            return total;
        }
Esempio n. 6
0
        public static decimal SubTotalForDept(Guid deptId)
        {
            var dda = new CompanyDataSetTableAdapters.DepartmentTableAdapter();

            dda.Fill(Ds.Department);

            var eda = new CompanyDataSetTableAdapters.EmployeeTableAdapter();

            eda.Fill(Ds.Employee);

            var root  = Ds.Department.Where(d => d.department_id == deptId).Single();
            var total = GetSubDeptsTotal(root, root.GetEmployeeRows().Sum(er => er.Salary));

            return(total);
        }
Esempio n. 7
0
        public static void CutSubDept(Guid deptId)
        {
            var dda = new CompanyDataSetTableAdapters.DepartmentTableAdapter();
            dda.Fill(Ds.Department);

            var eda = new CompanyDataSetTableAdapters.EmployeeTableAdapter();
            eda.Fill(Ds.Employee);

            var root = Ds.Department.Where(d => d.department_id == deptId).Single();
            foreach (var employeeRow in root.GetEmployeeRows())
            {
                employeeRow.Salary /= 2;
            }

            CutSubDept(root);
            eda.Update(Ds);
        }
Esempio n. 8
0
        public static void CutSubDept(Guid deptId)
        {
            var dda = new CompanyDataSetTableAdapters.DepartmentTableAdapter();

            dda.Fill(Ds.Department);

            var eda = new CompanyDataSetTableAdapters.EmployeeTableAdapter();

            eda.Fill(Ds.Employee);

            var root = Ds.Department.Where(d => d.department_id == deptId).Single();

            foreach (var employeeRow in root.GetEmployeeRows())
            {
                employeeRow.Salary /= 2;
            }

            CutSubDept(root);
            eda.Update(Ds);
        }