Ejemplo n.º 1
0
        public static DataTable getAll()
        {
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetData();
            adapter.Dispose();

            return(table);
        }
Ejemplo n.º 2
0
        public static int getCustomerId(string firstName, string lastName, string phone)
        {
            int       customerId = 4;
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetDataBy(lastName, firstName, phone);
            adapter.Dispose();

            customerId = (int)table.Select()[0].ItemArray[0];

            return(customerId);
        }
Ejemplo n.º 3
0
        public static bool hasCustomer(int customerId)
        {
            bool isCustomer;

            adapter = getNewAdapter();
            DataTable table = adapter.GetById(customerId);

            adapter.Dispose();

            isCustomer = table.Select().Length > 0;

            return(isCustomer);
        }
Ejemplo n.º 4
0
        public static bool hasCustomer(string firstName, string lastName, string phone)
        {
            bool      hasId;
            DataTable table;

            adapter = getNewAdapter();
            table   = adapter.GetDataBy(lastName, firstName, phone);
            adapter.Dispose();

            hasId = table.Select().Length > 0;

            return(hasId);
        }
Ejemplo n.º 5
0
 public static void setDeleted(bool deleted, int customerId)
 {
     adapter = getNewAdapter();
     adapter.UpdateDeleted(deleted, customerId);
     adapter.Dispose();
 }
Ejemplo n.º 6
0
 public static void incrementTimesRented(int customerId)
 {
     adapter = getNewAdapter();
     adapter.IncrementTimesRented(customerId);
     adapter.Dispose();
 }
Ejemplo n.º 7
0
 public static void add(string lName, string fName, string email, string address, string phone)
 {
     adapter = getNewAdapter();
     adapter.Insert(lName, fName, email, address, phone, false, 0);
     adapter.Dispose();
 }