This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 ProductBL | |
| { | |
| private readonly ProductDAL dal; | |
| public ProductBL(ProductDAL dal) | |
| { | |
| this.dal = dal; | |
| } | |
| public List<Product> GetProducts() |