コード例 #1
0
        private static SqlDataReader EmployeeRelatedReporting(TelephoneBillSystemChoices userChoice)
        {
            SqlDataReader queryResult = null;

            switch (userChoice)
            {
            case TelephoneBillSystemChoices.DisplayAllEmployees:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayAllEmployees();
                break;

            case TelephoneBillSystemChoices.DisplayEmployeeByID:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayEmployeeByID();
                break;

            case TelephoneBillSystemChoices.DisplayCustomersOfEmployee:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayEmployeesCustomers();
                break;

            case TelephoneBillSystemChoices.DisplayTransactionSummaryforEmployees:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayTransactionSummaryForEmployees();
                break;

            case TelephoneBillSystemChoices.CalculateEmployeeBonus:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayBonusForEmployee();
                break;
            }
            return(queryResult);
        }
        public static void UserDataModificationFunction(TelephoneBillSystemChoices userChoice)
        {
            try
            {
                switch (userChoice)
                {
                case TelephoneBillSystemChoices.AddCustomer:
                    UserInterfaceToDbAccessFunctions.AddCustomer();
                    break;

                case TelephoneBillSystemChoices.UpdateCustomer:
                    UserInterfaceToDbAccessFunctions.UpdateCustomer();
                    break;

                case TelephoneBillSystemChoices.GenerateCustomerBill:
                case TelephoneBillSystemChoices.RecordPayment:
                    UserInterfaceToDbAccessFunctions.RecordBillPayment();
                    break;
                }
            }
            catch (SqlException ex)
            {
                Console.WriteLine("Exception Occured" + ex.Message);
            }
        }
コード例 #3
0
        private static SqlDataReader CustomerRelatedReporting(TelephoneBillSystemChoices userChoice)
        {
            SqlDataReader queryResult = null;

            switch (userChoice)
            {
            case TelephoneBillSystemChoices.DisplayAllCustomers:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayAllCustomers();
                break;

            case TelephoneBillSystemChoices.DisplayCustomerByID:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayCustomerByID();
                break;

            case TelephoneBillSystemChoices.DisplayCustomerBillingHistory:
                queryResult = UserInterfaceToDbAccessFunctions.DisplayCustomerBillHistory();
                break;
            }
            return(queryResult);
        }