Skip to content

Instantly share code, notes, and snippets.

View yaplex's full-sized avatar

Alex Shapovalov yaplex

View GitHub Profile
function cityClick()
{
CityService.DoWork($get("txtName").value, onSuccess);
}
function onSuccess(data)
{
if (data)
alert(data);
}
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)
<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();" />
[OperationContract]
public string DoWork(string userName)
{
// Add your operation implementation here
return "Hello " + userName;
}
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...
}
$mycredentials = Get-Credential
$secpasswd = ConvertTo-SecureString "MyPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential (".\MYUser", $secpasswd)
$serviceName = "MyService"
if (Get-Service $serviceName -ErrorAction SilentlyContinue)
{
$serviceToRemove = Get-WmiObject -Class Win32_Service -Filter "name='$serviceName'"
$serviceToRemove.delete()
"service removed"
}
else
{
[TestFixture]
public class ProductBLTests
{
[Test]
public void GetProductsTest()
{
MockRepository mocks = new MockRepository();
ProductDAL dal = (ProductDAL)mocks.StrictMock(typeof(ProductDAL));
using (mocks.Record())
{
public class ProductBL
{
private readonly ProductDAL dal;
public ProductBL(ProductDAL dal)
{
this.dal = dal;
}
public List<Product> GetProducts()