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
var MachineInfo = React.createClass({ | |
getInitialState: function() { | |
return { | |
data: [] | |
}; | |
}, | |
componentDidMount: function() { | |
$.get(this.props.source, function(result) { |
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
public static MvcHtmlString BootStrapValidationSummary(this HtmlHelper helper) | |
{ | |
if (helper.ViewData.ModelState.Keys.Any(k => helper.ViewData.ModelState[k].Errors.Any())) | |
{ | |
return MvcHtmlString.Create("<div class='alert alert-danger'>" | |
+ "<button class='close' data-dismiss='alert' aria-hidden='true'>×</button>" | |
+ helper.ValidationSummary(false, "Please check the following:") | |
+ "</div>"); | |
} | |
return null; |
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
public class BaseClass | |
{ | |
public SessionConfiguration sessionConfiguration; | |
public static string Host = "http://localhost"; | |
public static string PhantomPath; | |
public static int Port = 53222; | |
public BaseClass() | |
{ | |
PhantomPath = ConfigurationManager.AppSettings[Environment.MachineName + "-BinPhysicalPath"]; |
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
[NHibernateActionFilter] | |
public class MemberController | |
private readonly IDbService db; | |
public MemberController(IDbService db) | |
{ | |
this.db = db; | |
} |
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
<div ng-app="App"> | |
<div ng-controller="AppCtrl"> | |
<products></products> | |
</div> | |
</div> |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Linq; | |
using System.Threading; | |
namespace Mvc.Cms.Helpers.Localization | |
{ | |
//http://blog.devdave.com/2011/01/localization-in-aspnet-mvc2-with-data.html |
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
public ContactListDto Filter(IQueryable<Contact> contactList, DataSourceRequest request) | |
{ | |
.. | |
if (request.Filters.Any()) | |
{ | |
//Single column | |
var filter = request.Filters[0] as FilterDescriptor; | |
if (filter != null) | |
{ |
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
//Calling code | |
[NHibernateActionFilter] | |
public JsonResult ListContact(long id, [DataSourceRequest] DataSourceRequest request) | |
{ | |
IQueryable<Contact> contactList; | |
if (id > 0) | |
contactList = session.Query<Contact>().Where(y => y.ContactEmailList.Any(x => x.EmailList.Id == id && y.Client.Id == UserHelper.Id)); | |
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
var db = Database.Open(); | |
IEnumerable<Login> logins = db.Logins.FindAllByEmailAndPassword(model.Email, model.Password).ToList<Login>(); | |
if (logins.Count() == 1) | |
{ | |
... | |
} |
NewerOlder