European Windows 2012 Hosting BLOG

BLOG about Windows 2012 Hosting and SQL 2012 Hosting - Dedicated to European Windows Hosting Customer

European Ms. Visual Studio LightSwitch Hosting - France :: Tips How to Build App in LightSwitch Application

clock September 10, 2013 08:20 by author Administrator

LightSwitch is a Rapid Development environment that will allow technical and somewhat-technical people the ability to create light weight Line of Business applications. While many developers don’t think LightSwitch will be useful for creating apps, we think it can be very beneficial to use in the right circumstances.

Microsoft® Visual Studio® LightSwitch™ is a new streamlined development environment for designing data-centric business applications and helps you to build data-centric applications quickly, through visual means. LightSwitch business applications are multi-tiered, featuring a client application and a combination of LINQ, WCF RIA Services and the Entity Framework to implement the application services tier.

Benefits of using LightSwitch?
There are many benefits of using LightSwitch as shown in the below list

  • You can create an application with just few clicks and no code or coding only in the data models or substantial code within all parts of the application.
  • Based on permission, LightSwitch support distinct audiences end-users (View & Edit Data), administrative (maintain certain master data) and Super-users (granted access to most or all of the data and functionality).
  • Support built-in Business Types include like (Email, PhoneNumber, money,..etc), and partners can create new Business Types.
  • Enable Debug mode, and allows the screen to be edited interactively while the application is running.
  • Enable adding custom business rules to any field in the screen.
  • ou can create custom controls and embed sophisticated behaviors there.
  • LightSwitch produces desktop applications or pulls down and executed implicitly by navigating to a URL.
  • Enables you to deploy your LightSwitch on Cloud and Azure as simple as running a wizard.

Start building the App
Now let’s start building our application, I am going to list every thing in details starting from opening Visual studio 2012 until running the application. we will go throw the following steps.

Step 1 : Creating the Application

Creating new LightSwitch application is very simple, if you’re familiar with any old version of Visual Studio as follows:

Open VS 2012 –> New project –> Select LightSwitch from project Template list –> Select LightSwitch application (c#), and finally we will write the project name LighSwitchsubscriptionApp –> press Ok

Step 2 : Creating & Defining Data tables and relationships

The start point to LightSwitch application is creating Data Table and you can do this task through four ways:

  • Click the Create new table link in the start up project page “Start with data” which called [you project name] Designer
  • Go to Visual Studio menu bar Select Project –> Add table
  • Right click Project Name in solution explorer then select Add table
  • Connect to an exist data source published on (Database, Sharepoint, OData Services, WCF RIA Service) as mentioned in step 2 and 3, but select Add data source instead of Add Table option, and create Subscriber table as shown in below figure

The above picture, it contains Useremail field with Data type Email, this is one of the new features of LightSwitch , that you can create new field with new Business Types like (Email, Money, Phone, web address).

- In addition, you can add New filed of static choice list by selecting choicelist link from right side properties of any string field, for example, we will create choicelist for Gender(male, female).
- Usually any registration module needs dropdown list of country field, but using LightSwitch makes the difference for you, we are not going to create new control and write code to bind this control from database, we are going to create new table of countries and link it to our Subscriber table and link these two tables, by following the below steps:

  • Create new table called Country with one columns(contryDesc).
  • Then click Relationshin, button in the toolbar.
  • Finally build the relation between the subscriber and country tables as shown below.

Step 3 : Building Screens & Running the Application

Now, we are getting ready to Build the screens corresponding to Entities, simply you click the Screen button from the toolbar on the subscriber & Countries Table Design forms, this will open Add ‘New screen’ Dialog then select the highlighted option showing in figure below, and finally press Ok button.

- Repeat same process above for country entity.
- Finally, we can run the application by pressing f5 key, we will see screen as shown in figure below:

- Now, let’s go a head and review above screen as listed below:

Box 1 ,represent two tabs for all entity screens we have created .
Box 2 ,represent all actions available for this gridview Add, Delete, Edit, Search .
Box 3, represent the Dialog screen that opens when you select Add button.
Box 4, Showing Required fields marked as Bold.
Box 5, Showing Country list that I have entered in country entity.
Box 6, includes main actions for this screen ( Save , Refresh).

- There is another very important feature here, as you can see on right bottom of the screen link [Design Screen], this link allows you to edit the screen Design on the execution mode, if and only if, you have run the application in Debug mode.
- Eventually, we did not finish all features of LightSwitch, but we have other features that I will list them soon in other posts, I was just trying to show the power of using Lightswitch without writing any line of code.



European Visual Studio LightSwitch Hosting - Amsterdam :: Deploy LightSwitch Application as DotNetNuke Module

clock September 4, 2012 07:28 by author Scott

Visual Studio LightSwitch is a Microsoft tool used for building business applications. If you want your LightSwitch application to be deployed as a DotNetNuke then you can.

DotNetNuke is the leading Web Content Management Platform for Microsoft .NET, powering more than 700,000 web sites worldwide. Whether you need a content management system (CMS) for your personal web site or for a Fortune 500 company, DotNetNuke has a solution that fits your needs. For details of DotNetNuke, please visit this link:
http://www.dotnetnuke.com/

Before deploying yourLightSwitch applications inDotNetNuke you will need at least DotNetNuke 5 (using ASP.NET 4.0). Or you can use the newest DotNetNuke 6.


1. Open Visual Studio LightSwitch->Create new table.


2. Create a table such as Task.




3. Then, right click on Screen
à Add Screen.



4. Select list and details screen->Select screen data (Task)->Ok.




5. Click on write code
à Select Task_Created.



Code

using System;

 using System.Collections.Generic;using System.Linq;
 using System.Text;
 using Microsoft.LightSwitch;
 namespace LightSwitchApplication
 {
     public partial class Task
     {
         partial void Task_Created()
         {
             this.UserName = this.Application.User.Name;
         }
     }
 }


Description
: This code set the Username field to the "Application.User.Name".

6. Go to properties in the Solution Explorer.



7. Click on access control-> select Use Forms authentication




8. Click on application type-> select Host application services on IIS




9. Go to configuration manager in debug.




10. Select release mode in debug.




11. Go to build in menu bar->Publish your application (DotNetNuke).




12. Click on publish for publish your application.




13. Run your application (Press F5).

 



European Visual Studio LightSwitch Hosting - Amsterdam :: Communication Across Screens in Visual Studio LightSWitch 2011

clock March 6, 2012 05:31 by author Scott

As you probably know, Visual Studio LightSwitch is a tool provided by Microsoft to build business applications. In this article you will see how to communicate screens in a LightSwitch application.

You can say a screen is a template in which you display data. There are five types of data screens in the LightSwitch Application i.e. New Data Screen, Search Data Screen, Details Screen, Editable Grid Screen, List and Details Screen. If you want to communicate across screens in a LightSwitch application then you can do that.


When we establish a relationship among screens then the process is called communication among screens.


Step 1 : First of all open Visual Studio LightSwitch->Click on new project->Select LightSwitch->Select LightSwitch application->Write name (CommunicatioScreens)->Ok.




Step 2 : Click on create new table.




Step 3 : Create tables such as customer and order.




Step 4 : Now we will establish a relationship between these tables. To establish the relationship then click on relationship.




Step 5 : Now we establish a one to many relationship from the customer to the order as in the following image.




Step 6 : Now we will add a screen. Right click on screens->Add screen




Step 7 : Select new data screen->Select screen data (customer)->Ok.


In the same manner we we will add a new data screen for the order table.




Step 8 : In the same manner we will add a list and details screen for customer and order tables.




Step 9 : Click add data item->Select query->Select customer->Write name (CustomerChoice)->Ok.




Step 10 : Go to the properties of the customer in CreateNewOrder screen->Select choice (CustomerChoice).




Step 11 : Run the application (Press F5). Click on create new customer for adding a customer then save.




Step 12 : Click on create new order for adding an order.




Step 13 : If you want to see the details of a customer or order then you can. To do that you will click on customer list details and order list details. In this section you can change the customer for order like in the following image.


 



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in