예제 #1
0
        private void Presenter_OnObjectGetReturned(object sender, ObjectGetReturnedArgs<Store> e)
        {
            DisplayStatus();

            // If we're updating then ask the user for input
            if (e.Update)
            {
                Console.WriteLine($"Update (ID: {e.Entity.Id}) - {e.Entity.StoreName}");
                Console.WriteLine("NOTE: Leave blank if you don't want to update a field \n");
                Get_Name(null);

                // Tell the presenter to update
                Update?.Invoke(this, new UpdateInputArgs<Store>(e.Entity, e.IsLocal));
            }
            else
            {
                Console.WriteLine($"ID: {e.Entity.Id}\nName: {e.Entity.StoreName}\n");
            }
        }
        private void Presenter_OnObjectGetReturned(object sender, ObjectGetReturnedArgs<Product> e)
        {
            DisplayStatus();

            // If update is true then ask for input to update the object
            if (e.Update)
            {
                Console.WriteLine($"Updating (ID: {e.Entity.Id}) {e.Entity.Prod_Name}");
                Console.WriteLine("NOTE: Leave blank if you don't want to update a field \n");
                Get_Name(null);
                Get_Price(null);

                // Tell the presenter to update
                Update?.Invoke(this, new UpdateInputArgs<Product>(e.Entity, e.IsLocal));
            }
            else
            {
                Console.WriteLine($"ID: {e.Entity.Id}" +
                                  $"\nName: {e.Entity.Prod_Name}" +
                                  $"\nPrice: {e.Entity.Price}\n");
            }
        }
        private void Presenter_OnObjectGetReturned(object sender, ObjectGetReturnedArgs<Employee> e)
        {
            DisplayStatus();

            // If we're updating then we need to request user input
            if (e.Update)
            {
                Console.WriteLine($"Update (ID: {e.Entity.Id}) {e.Entity.FirstName}");
                Console.WriteLine("NOTE: Leave blank if you don't want to update a field \n");
                Get_Name(null);
                Get_StoreID(null);
                Update?.Invoke(this, new UpdateInputArgs<Employee>(e.Entity, e.IsLocal));
            }
            else
            {
                Console.WriteLine($"ID: {e.Entity.Id}" +
                                  $"\nName: {e.Entity.FirstName}" +
                                  $"\nStore ID: {e.Entity.StoreId}\n");
            }
        }
예제 #4
0
        private void Presenter_OnObjectGetReturned(object sender, ObjectGetReturnedArgs<Sale> e)
        {
            DisplayStatus();

            // If we need to update we ask the user to provide input
            if (e.Update)
            {
                Console.WriteLine($"Update (ID: {e.Entity.Id})");
                Console.WriteLine("NOTE: Leave blank if you don't want to update a field \n");
                Get_StoreID(null);
                Get_ProductID(null);
                Get_Timestamp(null);

                // Tell the presenter to update
                Update?.Invoke(this, new UpdateInputArgs<Sale>(e.Entity, e.IsLocal));
            }
            else
            {
                Console.WriteLine($"ID: {e.Entity.Id}\nStore ID: {e.Entity.StoreId}" +
                                  $"\nProduct ID: {e.Entity.ProductId}" +
                                  $"\nTimestamp: {e.Entity.SaleTime}\n");
            }
        }