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
# The file that the script is written to | |
$file = "C:\scripts\ps\department.sql" | |
# declare variables and create path | |
$server = "localhost"; | |
$instance = "default"; | |
$database = "timesheet"; | |
$path = "sqlserver:\sql\$server\$instance\databases\$database\tables" ; | |
# filter down to a particular table |
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
# declare variables and create path | |
$server = "localhost"; | |
$instance = "default"; | |
$database = "timesheet"; | |
$path = "sqlserver:\sql\$server\$instance\databases\$database\tables" ; | |
# We still have a filter, kind of.. | |
$tables = "*"; | |
# The output directory for our scripts |
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
// GET: /Department/Edit/5 | |
public ActionResult Edit(int? id) | |
{ | |
if (id == null) | |
{ | |
return new HttpStatusCodeResult(HttpStatusCode.BadRequest); | |
} | |
Department department = _context.Departments.Find(id); | |
if (department == null) | |
{ |
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
// /File/Stream | |
public FileStreamResult Stream() | |
{ | |
var fileContent = new byte[] { Ascii.one, Ascii.Comma, Ascii.two, Ascii.Comma, Ascii.three }; | |
var stream = new MemoryStream(fileContent); | |
var fileStreamResult = new FileStreamResult(stream, mimeType); | |
fileStreamResult.FileDownloadName = "FileStreamExample.csv"; | |
return fileStreamResult; | |
} |
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 HttpStatusCodeResult Unavailable() | |
{ | |
var status = HttpStatusCode.ServiceUnavailable; | |
var statusCode = new HttpStatusCodeResult(status); | |
return statusCode; | |
} | |
public HttpStatusCodeResult Found() |
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 HttpNotFoundResult NotFound() | |
{ | |
var statusCode = new HttpNotFoundResult(); | |
return statusCode; | |
} | |
public HttpUnauthorizedResult Unauthorized() | |
{ | |
var statusCode = new HttpUnauthorizedResult(); |
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 ContentResult Content() | |
{ | |
var content = new ContentResult(); | |
content.Content = "<html><body bgcolor=\"red\"><p>This is my HTML content</body></html>"; | |
content.ContentType = "text/html"; | |
return content; | |
} |
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
@using (Html.BeginForm("Index", "Feedback")) | |
{ | |
@Html.AntiForgeryToken() | |
<!-- form controls --> | |
} |
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
[HttpPost] | |
[ValidateAntiForgeryToken] | |
public ActionResult Index(FeedbackModel model) | |
{ | |
// Controller code | |
} |
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 ($) { | |
$(document).ready(function () { | |
// JQuery code goes here | |
}); | |
})(jQuery); |