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
[TestFixture] | |
public class ProductBLTests | |
{ | |
[Test] | |
public void GetProductsTest() | |
{ | |
MockRepository mocks = new MockRepository(); | |
ProductDAL dal = (ProductDAL)mocks.StrictMock(typeof(ProductDAL)); | |
using (mocks.Record()) | |
{ |
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
$serviceName = "MyService" | |
if (Get-Service $serviceName -ErrorAction SilentlyContinue) | |
{ | |
$serviceToRemove = Get-WmiObject -Class Win32_Service -Filter "name='$serviceName'" | |
$serviceToRemove.delete() | |
"service removed" | |
} | |
else | |
{ |
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
$secpasswd = ConvertTo-SecureString "MyPassword" -AsPlainText -Force | |
$mycreds = New-Object System.Management.Automation.PSCredential (".\MYUser", $secpasswd) |
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
$mycredentials = Get-Credential |
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
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) { | |
System.Deployment.Application.ApplicationDeployment cd = | |
System.Deployment.Application.ApplicationDeployment.CurrentDeployment; | |
string publishVersion = cd.CurrentVersion; | |
// show publish version in title or About box... | |
} |
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
[OperationContract] | |
public string DoWork(string userName) | |
{ | |
// Add your operation implementation here | |
return "Hello " + userName; | |
} |
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
<input type="text" name="txtName" id="txtName" /> | |
<input type="button" value="jQuery call" onclick="cityClickJQuery();" /> | |
<input type="button" value="ASP.NET AJAX Call" onclick="cityClick();" /> |
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
function cityClickJQuery() | |
{ | |
$.ajax({ | |
type: "POST", | |
url: "http://localhost:65424/CityService.svc/DoWork", | |
data: '{"userName":"'+$get("txtName").value+'"}', | |
processData:false, | |
contentType: "application/json; charset=utf-8", | |
dataType: "json", | |
success: function(data) |
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
function cityClick() | |
{ | |
CityService.DoWork($get("txtName").value, onSuccess); | |
} | |
function onSuccess(data) | |
{ | |
if (data) | |
alert(data); | |
} |
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
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" | |
Inherits="WebApplication1._Default" %> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title></title> | |
<script src="jquery-1.3.2.js" type="text/javascript"></script> | |
<script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script> |