Skip to content

Instantly share code, notes, and snippets.

View PilotBob's full-sized avatar

Bob Archer PilotBob

View GitHub Profile
GLEntity
KeyGuid Guid
EntityID String
ConsolHeader
KeyGUID Guid
TableID string
function AutoCompleteGetIdValue(elem) {
var testValue = $(elem).val();
var id;
$(elem).data().autocomplete.widget().children(".ui-menu-item").each(function () {
var item = $(this).data("item.autocomplete")
if (item.value == testValue) {
alert(item.id);
id = item.id;
}
});
Regex1:
^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$
RegEx2:
^\+(?:[0-9] ?){6,14}[0-9]$
How do I combine them or say match this or that as a single regex?
class PhoneNumberModelBinder : DefaultModelBinder
{
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
return new PhoneNumber(bindingContext.ValueProvider.GetValue("PhoneNumber").AttemptedValue);
}
}
// Give this class:
public class AmsiMenuItem
{
public string MenuTitle { get; set; }
public string NavigationUri { get; set; }
public string IconPath { get; set; }
public string NodeProvider { get; set; }
public string NodeSource { get; set; }
@helper OrganizationLabel(string label) {
bool isSimple = Amsi.Model.eFinancials.Policies.GetPolicyByToken<string>("SimplifiedCompanySetup") == "Y";
string result;
isSimple = true;
if (!isSimple) {
result = label;
}
else
HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 24 Jul 2012 20:41:53 GMT
Content-Length: 2940
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
@PilotBob
PilotBob / gist:3249655
Created August 3, 2012 17:12
Join an EF query to an IEnumerable
void Main()
{
var states = new List<State>();
states.Add(new State { abrv = "AL", description = "Alaska" });
states.Add(new State { abrv = "TX", description = "Texas" });
states.Add(new State { abrv = "GA", description = "Georgia"});
AddressBooks.Where(ab => states.Any(s => ab.State == s.abrv)).Dump();
}
from j in Jobs
join j2 in
(from jas in JobAccessSecurities
where jas.UserKey == new Guid("bf5e9bb6-36b5-43b2-94a3-934bee108ade")
select jas) on j.ProjectManagerKey equals j2.EntityUserCodeValueKey
select j
How can I make this be a left outer join???