This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package samples.android; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.ClientProtocolException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DefaultHttpClient client = new DefaultHttpClient(); | |
// http get request | |
HttpGet request = new HttpGet(EMPLOYEE_SERVICE_URI + evEmployeeId.getText()); | |
// set the hedear to get the data in JSON formate | |
request.setHeader("Accept", "application/json"); | |
request.setHeader("Content-type", "application/json"); | |
// get the response | |
HttpResponse response = client.execute(request); | |
HttpEntity entity = response.getEntity(); | |
// if entity contect lenght 0, means no employee exist in the system with these code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Solution 1 | |
public void BindDataToControl<T>(BaseDataBoundControl control, IEnumerable<T> dataSource) | |
{ | |
if (control == null) | |
throw new ArgumentNullException("control"); | |
control.DataSource = dataSource; | |
control.DataBind(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Remove html" stopProcessing="true"> | |
<match url="(.*).html$" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ContactPageViewModel : INotifyPropertyChanged | |
{ | |
private readonly IContactRepository _contactRepository; | |
private readonly IValidator _requiredFieldValidator; | |
private ObservableCollection<Category> _categories; | |
private string _email; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phone:PhoneApplicationPage | |
x:Class="DemoMvvm.WP.View.ContactPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" | |
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" | |
FontFamily="{StaticResource PhoneFontFamilyNormal}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Category : INotifyPropertyChanged | |
{ | |
private string _title; | |
public event PropertyChangedEventHandler PropertyChanged; | |
public int Id { get; set; } | |
public string Title | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using static System.Console; | |
namespace PlayingWithCSharp6 | |
{ | |
class Program | |
{ |