Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Searchs);

            myListTecnology = GetCustomersFromPreferences();

            progress = new ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetMessage("Contacting server. Please wait...");
            progress.SetCancelable(false);

            //Call control
            autocompleteTextView = FindViewById <AutoCompleteTextView>(Resource.Id.autoCompleteTextView);
            mRecyclerView        = FindViewById <RecyclerView>(Resource.Id.recyclerBook);
            btnSearch            = FindViewById <ImageView>(Resource.Id.btnSearch);

            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mAdapter = new BookAdapter(this, listBooks);
            mRecyclerView.SetAdapter(mAdapter);

            controllerSearch = new ControllerSearch(this);

            fillTechnologiesSpinner();

            setAdapterData();
        }
Exemplo n.º 2
0
        public static void InsertNewBill(Bill newBill)
        {
            if (newBill.ReturnMoney >= 0)
            {
                newBill.PayMoney = newBill.TotalMoney;
            }
            var k = Adapters.BillAdapter.InsertNewBill(newBill);

            if (k == 1)
            {
                var billid = Adapters.BillAdapter.GetLatestId();
                if (billid > 0)
                {
                    foreach (var item in newBill.BillItems)
                    {
                        Adapters.BillItemAdapter.InsertNewBillItem(billid, item);
                        var currentNumber = BookAdapter.GetNumber(item.Book.ID);
                        if (currentNumber != -1)
                        {
                            Adapters.BookAdapter.UpdateNumber(item.Book.ID, currentNumber - item.Number);
                        }
                    }
                }

                if (newBill.ReturnMoney < 0)
                {
                    Adapters.CustomerAdapter.UpdateDebt(newBill.Customer.ID, newBill.Customer.Debt + Math.Abs(newBill.ReturnMoney));
                }
            }
        }
Exemplo n.º 3
0
        public void Initalize()
        {
            var adapter = new BookAdapter();

            FiveDysfunctions = adapter.AddBook(new BookBuilder().FiveDysfunctions().Build());
            PhoenixProject   = adapter.AddBook(new BookBuilder().ThePhoenixProject().Build());

            adapter.SaveChanges();
        }
        public void AdapterAddBookTest()
        {
            var expected = new BookBuilder().FiveDysfunctions().Build();
            var adapter  = new BookAdapter();

            var response = adapter.AddBook(expected);

            Assert.IsNotNull(response);
            var comparison = Utilities.CompareObjects(expected, response);

            Assert.IsTrue(comparison.AreEqual, $"Expected [{expected}] Actual [{response}]");
        }
        public void ResetAndInitializeTestData()
        {
            ObjectMother.ObjectMother.ClearTestData();
            ObjectMother.ObjectMother.Instance.VerifyInitialization();

            var bookAdapter        = new BookAdapter();
            var customerAdapter    = new CustomerAdapter();
            var libraryCardAdapter = new LibraryCardAdapter();

            Assert.IsTrue(bookAdapter.Search(new Contracts.Books.SearchFilters(), null).PageData.Any(), "There are no test books");
            Assert.IsTrue(customerAdapter.Search(new Contracts.Customers.SearchFilters(), null).PageData.Any(), "There are no test customers");
            Assert.IsTrue(libraryCardAdapter.Search(new Contracts.LibraryCards.SearchFilters(), null).PageData.Any(), "There are no test library cards");
        }
Exemplo n.º 6
0
    private void Test()
    {
        AbsEquipment equipment = new CarEquipment();

        equipment.TurnOn();
        equipment.TurnOff();
        equipment = new TVEquipment();
        equipment.TurnOn();
        equipment.TurnOff();
        equipment = new BookAdapter(new Book());
        equipment.TurnOn();
        equipment.TurnOff();
    }
Exemplo n.º 7
0
 protected void setupAdapter()
 {
     adapter = new BookAdapter();
     recyclerView.SetAdapter(adapter);
 }
 internal BookContract()
 {
     _adapter          = new BookAdapter();
     _categoryContract = new CategoryContract();
 }
 internal BookContract(BookAdapter adapter, CategoryContract contract)
 {
     _adapter          = adapter;
     _categoryContract = contract;
 }