コード例 #1
0
ファイル: Events.aspx.cs プロジェクト: NiveditaB/star
 protected async void createEvent_Click(object sender, EventArgs e)
 {
     string d = dateOfEvent.Value;
     Institute i = JsonConvert.DeserializeObject<Institute>(Session["u"].ToString());
     string yyyy = d[0].ToString() + d[1].ToString() + d[2].ToString() + d[3].ToString();
     string mm = d[5].ToString() + d[6].ToString();
     string dd = d[8].ToString() + d[9].ToString();
     DateTime dw = new DateTime(Int32.Parse(yyyy),Int32.Parse(mm),Int32.Parse(dd));
     Event v = new Event { date = dw.ToString("dd-MMM-yy"), desc = detail.Value.Trim(), title = title.Value.Trim(),school=i.self };
     await h.PostAsync(url + "event/", new StringContent(JsonConvert.SerializeObject(v),System.Text.Encoding.UTF8,"application/json"));
 }
コード例 #2
0
ファイル: SchoolController.cs プロジェクト: NiveditaB/star
        public async Task<IHttpActionResult> createEvent(Event a)
        {
            g.Connect();
            NodeReference<Event> node = g.Create(a);
            string x = node.Id.ToString();
            a.self = x.ToString();
            g.Update<Event>(node, a);
            await h.PostAsync(uri + "node/" + x + "/labels", new StringContent("\"event\""));

            createRelationship(x, a.school, "event");
            createRelationship(a.school, x, "school_event");

            return Ok(a);
        }