// The following exist only for debugging purposes or old versions. // Feel free to ignore unless you know you're debugging with them. // GET api/values/name public IEnumerable <object> Get(string value, string showAll) { switch (showAll) { case "galwantsdata": return(LogDataForGal.GetLogDataForGal(value)); case "0": return(new QueryHandler().GetPersons( value, false, false)); case "1": return(new QueryHandler().GetPersons( value, true, false)); case "reportoddity": return(BugReporter.ReportBug(value)); } return(new object[] { }); }
// POST api/values public void Post([FromBody] Request request) { switch (request.Type) { case PersonalFieldAdder.WHAT_I_DO: case PersonalFieldAdder.ADD_MOBILE: case PersonalFieldAdder.ADD_WORK_NUMBER: case PersonalFieldAdder.ADD_OTHER_NUMBER: case PersonalFieldAdder.SEX: PersonalFieldAdder.AddPersonalField( request.MisparIshi, request.Data, request.Type); return; case "log": Logger.Log(request.Logs); return; case "deletetag": TagAdder.DeleteTagForPerson(request.MisparIshi, request.Data); return; case "reportoddity": // It's an oddity. We don't write bugs. BugReporter.ReportBug(request.Data); return; case "addadmin": AdminAdder.AddAdmin(request.MisparIshi, request.IsSuperAdmin); return; case "deleteadmin": AdminAdder.DeleteAdmin(request.MisparIshi); return; case "admindeletetag": AdminTagDeleter.DeleteTag(request.Data); return; } }
private void btnSubmit_Click(object sender, EventArgs e) { if (txt.Text.Length < 5) { MessageBox.Show("Enter more details about your problem.", "Can't submit", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } BugReporter r = new BugReporter(); btnSubmit.Enabled = false; bool result = r.ReportBug(string.Format("v.{0}\n{1}\n\n{2}", Security.Version.Full, txt.Text, mUI.CollectData()), txtEmail.Text); if (!result) { MessageBox.Show("An error occured; try submitting content manually to http://typpo.us/submit.php", "Not submitted", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { this.Close(); } btnSubmit.Enabled = true; }