Giter Club home page Giter Club logo

windows-tutorials-customer-database's Introduction

page_type languages products statusNotificationTargets description
sample
csharp
dotnet
windows
windows-uwp
This project is the starting point for a tutorial that creates a simple app for managing a list of customers.

Customer Database tutorial

This project is the starting point for a tutorial that creates a simple app for managing a list of customers. In doing so, it introduces a selection of basic concepts for enterprise apps in UWP. You'll learn how to:

  • Implement Create, Read, Update, and Delete operations against a local SQL database.
  • Add a data grid, to display and edit customer data in your UI.
  • Arrange UI elements together in a basic form layout.

Start the tutorial here.

This starting point is a single-page app with minimal UI and functionality, based on a simplified version of the Customer Orders Database sample app.

Run the sample

To run this sample, ensure you have the latest version of Visual Studio and the Windows 10 SDK. Once you've cloned/downloaded this repo, you can edit the project by opening CustomerDatabaseTutorial.sln with Visual Studio.

You can also check out the end-point-for-reference branch to see the completed code for this tutorial.

Code of Interest

If you run your app immediately after opening it, you'll see a few buttons at the top of a blank screen. Though it's not visible to you, the app already includes a local SQLite database provisioned with a few test customers. From here, you'll start by implementing a UI control to display those customers, and then move on to adding in operations against the database. Before you begin, here's where you'll be working.

Views

CustomerListPage.xaml is the app's View, which defines the UI for the single page in this tutorial. Any time you need to add or change a visual element in the UI, you'll do it in this file. This tutorial will walk you through adding these elements:

  • A RadDataGrid for displaying and editing your customers.
  • A StackPanel to set the initial values for a new customer.

ViewModels

ViewModels\CustomerListPageViewModel.cs is where the fundamental logic of the app is located. Every user action taken in the view will be passed into this file for processing. In this tutorial, you'll add some new code, and implement the following methods:

  • CreateNewCustomerAsync, which initializes a new CustomerViewModel object.
  • DeleteNewCustomerAsync, which removes a new customer before it's displayed in the UI.
  • DeleteAndUpdateAsync, which handles the delete button's logic.
  • GetCustomerListAsync, which retrieves a list of customers from the database.
  • SaveInitialChangesAsync, which adds a new customer's information to the database.
  • UpdateCustomersAsync, which refreshes the UI to reflect any customers added or deleted.

CustomerViewModel is a wrapper for a customer's information, which tracks whether or not it's been recently modified. You won't need to add anything to this class, but some of the code you'll add elsewhere will reference it.

For more information on how the sample is constructed, check out the app structure overview.

windows-tutorials-customer-database's People

Contributors

drewbatgit avatar karlerickson avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar quinnradich avatar supernova-eng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-tutorials-customer-database's Issues

Compile Error

This doesn't compile:

Error Framework resource extraction failed. Could not find a part of the path 'C:\Work\windows-tutorials-customer-database-master\windows-tutorials-customer-database-master\CustomerDatabaseTutorial.App\obj\x64\Debug\Microsoft.Extensions.DependencyInjection.Abstractions\en-US\Microsoft.Extensions.DependencyInjection.Abstractions.Resources.resw'. CustomerDatabaseTutorial.App

I'm using Visual Studio 2019. Target Version is 1903 build 18362. min Version is 1809 bld 17763

I tried updating all nuget packages and switching between x64 and x86 with no effect

I've also tried downloading the missing file from github and dropping it in correct location but it is deleted by the build.

microsoft.net.uwpcoreruntimesdk long file path

Using VS 2017 i cant seem build your source. I get the following error:

C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.uwpcoreruntimesdk\2.2.3\tools\CoreRuntime\Microsoft.Net.CoreRuntime.targets(195,9): error : Framework resource extraction failed. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters

That is only 145 lines characters

Then App does not compile

Error:
Framework resource extraction failed. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. CustomerDatabaseTutorial.App

I am using VScode 2017.

Could someone help me?

Thank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.