private void RejectMatch(jQueryEvent e) { jQueryObject button = jQuery.FromElement(e.CurrentTarget); string offerId = button.Siblings("input").GetValue(); jQueryObject parentRow = button.Parents(".offer"); parentRow.Attribute("disabled", "disabled").AddClass("ui-state-disabled"); jQuery.Post("/services/RejectOffer?signed_request=" + Utility.GetSignedRequest(), Json.Stringify(new JsonObject("id", offerId)), (AjaxRequestCallback <object>) delegate(object data, string textStatus, jQueryXmlHttpRequest <object> request) { parentRow.Hide(); Utility.ProcessResponse((Dictionary)data); }); }
private void CreateMatch(jQueryEvent e) { jQueryObject button = jQuery.FromElement(e.CurrentTarget); jQueryObject module = button.Parents(".module").First(); string date = module.Find(".datepicker").GetValue(); string time = module.Find(".time").GetValue(); string ampm = module.Find(".ampm").GetValue(); string comments = module.Find(".comments").GetValue(); string courtData = module.Find(".placesAutoValue").GetValue(); string datetime = date + " " + time + ampm; ArrayList ids = new ArrayList(); module.Find(".cities input").Each((ElementIterationCallback) delegate(int index, Element element) { ids.Add(((CheckBoxElement)element).Value); }); DoCreateMatch(this.Obj, datetime, ids, courtData, comments, 0, null); }
private void ParseFetchXml(FetchQuerySettings querySettings) { jQueryObject fetchElement = querySettings.FetchXml; // Get the entities and link entities - only support 1 level deep jQueryObject entityElement = fetchElement.Find("entity"); string logicalName = entityElement.GetAttribute("name"); EntityQuery rootEntity; // Get query from cache or create new if (!EntityLookup.ContainsKey(logicalName)) { rootEntity = new EntityQuery(); rootEntity.LogicalName = logicalName; rootEntity.Attributes = new Dictionary <string, AttributeQuery>(); EntityLookup[rootEntity.LogicalName] = rootEntity; } else { rootEntity = EntityLookup[logicalName]; } // Get Linked Entities(1 deep) jQueryObject linkEntities = entityElement.Find("link-entity"); linkEntities.Each(delegate(int index, Element element) { EntityQuery link = new EntityQuery(); link.Attributes = new Dictionary <string, AttributeQuery>(); link.AliasName = element.GetAttribute("alias").ToString(); link.LogicalName = element.GetAttribute("name").ToString(); link.Views = new Dictionary <string, FetchQuerySettings>(); if (!EntityLookup.ContainsKey(link.LogicalName)) { EntityLookup[link.LogicalName] = link; } else { string alias = link.AliasName; link = EntityLookup[link.LogicalName]; link.AliasName = alias; } if (!AliasEntityLookup.ContainsKey(link.AliasName)) { AliasEntityLookup[link.AliasName] = link; } }); querySettings.RootEntity = rootEntity; // Issue #35 - Add any lookup/picklist quick find fields that are not included in results attributes will cause a format execption // because we don't have the metadata - this means that 'name' is not appended to the attribute // Add the search string and adjust any lookup columns jQueryObject conditions = fetchElement.Find("filter[isquickfindfields='1']"); conditions.First().Children().Each(delegate(int index, Element element) { logicalName = element.GetAttribute("attribute").ToString(); jQueryObject e = jQuery.FromElement(element); jQueryObject p = e.Parents("link-entity"); if (!querySettings.RootEntity.Attributes.ContainsKey(logicalName)) { AttributeQuery attribute = new AttributeQuery(); attribute.LogicalName = logicalName; attribute.Columns = new List <Column>(); querySettings.RootEntity.Attributes[logicalName] = attribute; } }); }