protected async void updateInsti_Click(object sender, EventArgs e) { Institute ii = JsonConvert.DeserializeObject<Institute>(Session["u"].ToString()); Institute i = new Institute { contact = contact.Value.Trim(), email = email.Value.Trim(), location = location.Value.Trim(), name = name.Value.Trim(), pass = pass.Value.Trim(), self = ii.self }; var r = await h.PutAsync(url + "/insti", new StringContent(JsonConvert.SerializeObject(i), System.Text.Encoding.UTF8, "application/json")); if (r.IsSuccessStatusCode) Session["u"] = JsonConvert.SerializeObject(i); }
public IHttpActionResult UpdateSchool(Institute a) { a.pass = password(a.pass); g.Connect(); NodeReference<Institute> node = new NodeReference<Institute>(long.Parse(a.self), g); g.Update<Institute>(node, a); return Ok(); }
public async Task<IHttpActionResult> createSchoo(Institute a) { a.pass = password(a.pass); g.Connect(); NodeReference<Institute> node = g.Create(a); long x = node.Id; a.self = x.ToString(); g.Update<Institute>(node, a); await h.PostAsync(uri + "node/" + x + "/labels", new StringContent("\"institute\"")); return Ok(a); }