示例#1
0
        public Newtonsoft.Json.Linq.JObject GetFormulariumById(Newtonsoft.Json.Linq.JObject request)
        {
            Formularium formularium = Formularium.GetFormularium(request.Value<int>("id"));
            Newtonsoft.Json.JsonSerializer ser = new JsonSerializer();
            Newtonsoft.Json.Linq.JObject json = Newtonsoft.Json.Linq.JObject.FromObject(formularium, ser);

            return json;
        }
示例#2
0
 public Session(Newtonsoft.Json.Linq.JToken token, Spakll.CodeMash.Data.Technology technology)
 {
     this.Abstract = token.Value<string>("Abstract");
     this.Description = this.Abstract;
     this.Difficulty = token.Value<string>("Difficulty");
     this.EventType = token.Value<string>("EventType");
     this.SessionLookupId = token.Value<string>("SessionLookupId");
     this.SpeakerName = token.Value<string>("SpeakerName");
     this.SpeakerURI = token.Value<string>("SpeakerURI");
     this.Start = token.Value<DateTime?>("Start");
     this.Subtitle = this.SpeakerName;
     this.Technology = technology;
     this.Title = token.Value<string>("Title");
     this.UniqueId = this.URI = token.Value<string>("URI");
 }
示例#3
0
        public override void OnPut(string key, Newtonsoft.Json.Linq.JObject document, Newtonsoft.Json.Linq.JObject metadata, Raven.Http.TransactionInformation transactionInformation)
        {
            if (AuditContext.IsInAuditContext)
                return;

            using (AuditContext.Enter())
            {
                if (metadata.Value<string>("Raven-Entity-Name") == "People")
                {
                    if (metadata["CreatedByPersonId"] == null)
                    {
                        metadata["CreatedByPersonId"] = CurrentOperationContext.Headers.Value["CurrentUserPersonId"];
                        metadata["CreatedDate"] = new DateTime(2011,02,19,15,00,00);
                    }
                    else
                    {
                        metadata["LastUpdatedPersonId"] = CurrentOperationContext.Headers.Value["CurrentUserPersonId"];
						metadata["LastUpdatedDate"] = new DateTime(2011, 02, 19, 15, 00, 00);
                    }
                }
            }
        }
示例#4
0
        public ActionResult GetProductList(Newtonsoft.Json.Linq.JObject paging)
        {
            int start = Int32.Parse(paging.Value<string>("start"));
            int limit = Int32.Parse(paging.Value<string>("limit"));
            string filter = paging.Value<string>("filter");

            ProductInfoList list = ProductInfoList.GetProductInfoList(start, limit);
            // temporary limit, have to inmplement a paging mechanism.
            return this.Direct(new { totalCount = list.TotalCount, records = list });
        }