Exemplo n.º 1
0
 public static void AddTypetoCategory(string name, string incexp, string cat, int userID)
 {
     if (incexp == "Expense")
     {
         DBMethods.AddExpenseTypetoCategory(name, userID, cat);
     }
     else if (incexp == "Income")
     {
         DBMethods.AddIncomeTypetoCategory(name, userID, cat);
     }
     else
     {
         throw new ArgumentException("Invalid Type");
     }
 }
        private static void AddDefaultIncomeTypes(int userID)
        {
            if (DBMethods.GetAccountType(userID) == "Corporate")
            {
                DBMethods.AddIncomeTypetoCategory("İstanbul", userID, "Domestic Sales");
                DBMethods.AddIncomeTypetoCategory("İzmir", userID, "Domestic Sales");
                DBMethods.AddIncomeTypetoCategory("Ankara", userID, "Domestic Sales");

                DBMethods.AddIncomeTypetoCategory("New York", userID, "International Sales");
                DBMethods.AddIncomeTypetoCategory("Paris", userID, "International Sales");
                DBMethods.AddIncomeTypetoCategory("London", userID, "International Sales");
            }
            else
            {
                DBMethods.AddIncomeType("Salary", userID);
                DBMethods.AddIncomeType("Rent", userID);
                DBMethods.AddIncomeType("Dividents", userID);
            }
        }