Skip to content

Instantly share code, notes, and snippets.

View BryanWilhite's full-sized avatar
😐

Bryan Wilhite BryanWilhite

😐
View GitHub Profile
@BryanWilhite
BryanWilhite / ClientController.cs
Last active August 29, 2015 14:09
ASP.NET MVC: ActionResult LogOn(LoginModel model)
using System.Web.Mvc;
using System.Web.Security;
namespace Fox.Studio.SCLogic.Web.Controllers
{
using Fox.Studio.SCLogic.ModelContext;
using Fox.Web.Mvc.Models;
public class ClientController : Controller
{
@BryanWilhite
BryanWilhite / LoginModel.cs
Created November 12, 2014 23:06
ASP.NET MVC: LoginModel
using System.ComponentModel.DataAnnotations;
namespace Fox.Web.Mvc.Models
{
/// <summary>
/// Models the data for Client Login
/// </summary>
/// <remarks>
/// For more, see “How to create a login page using ASP.NET MVC 3 Razor”
/// [http://razorlogin.codeplex.com/]
@BryanWilhite
BryanWilhite / AccountMembershipProvider.cs
Created November 12, 2014 23:08
ASP.NET MVC: AccountMembershipProvider
using System.Web.Security;
namespace Fox.Web.Mvc.Infrastructure
{
using Fox.Web.Mvc.Models;
/// <summary>
/// Defines the contract that ASP.NET implements
/// to provide membership services using custom membership providers.
/// </summary>
@BryanWilhite
BryanWilhite / AccountRoleProvider.cs
Created November 12, 2014 23:09
ASP.NET MVC: AccountRoleProvider
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;
namespace Fox.Web.Mvc.Infrastructure
{
using Fox.Web.Mvc.Models;
@BryanWilhite
BryanWilhite / IAccountRepository.cs
Created November 12, 2014 23:14
ASP.NET MVC: IAccountRepository
using System.Web.Security;
namespace Fox.Web.Mvc.Models
{
/// <summary>
/// Defines the contract to support <see cref="AccountMembershipProvider"/>.
/// </summary>
public interface IAccountRepository
{
/// <summary>
@BryanWilhite
BryanWilhite / AjaxForJson.js
Created November 12, 2014 23:16
ASP.NET MVC3: $.ajax for JSON
$.ajax({
type: 'POST',
url: postUri,
data: JSON.stringify(data),
dataType: 'json',
contentType: 'application/json; charset=utf-8'
})
.then(function () {
$('#ReceiveAndVerifyEntries > tbody').children().remove();
});
@BryanWilhite
BryanWilhite / ApplicationInformation.cshtml
Created November 12, 2014 23:18
ASP.NET MVC Razor: ApplicationInformation
<div id="IndexFooter">
<span id="ApplicationInformation">
@string.Format("{0}, {1} Version: {2}, {3}", Model.AssemblyCompany, Model.AssemblyTitle, Model.AssemblyVersion,Model.AssemblyVersionDetail) </span>
<span><a href="@Url.Content("~/")" runat="server">Server Index</a></span>
</div>
@BryanWilhite
BryanWilhite / CREATE_TABLE.sql
Last active August 29, 2015 14:09
t-SQL: CREATE TABLE preamble
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[MyTable]')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1) --also: type = 'U'
BEGIN
DROP TABLE [dbo].[MyTable]
END
GO
@BryanWilhite
BryanWilhite / CREATE_Fragment_TABLE.sql
Created November 12, 2014 23:51
tSQL: CREATE TABLE with PRIMARY KEY
/*
-- Update:
IF EXISTS
(
SELECT * FROM sysobjects
WHERE
name = 'Fragment'
AND
type = 'U'
@BryanWilhite
BryanWilhite / SoapClientJsonOutput.php
Last active August 29, 2015 14:09
PHP: SoapClient Result Output As JSON
<?php
$client = new SoapClient($CFG->studioServicesCheckCodingSOAPWsdl);
$params = array(
'businessUnit' => $_REQUEST['businessUnit'],
'market' => $_REQUEST['market'],
'projectId' => $_REQUEST['projectId'],
'resourceType' => $_REQUEST['resourceType'],
'resourceCategory' => $_REQUEST['resourceCategory']
);