protected void Button1_Click(object sender, EventArgs e) { TRWebClient<Student> test = new TRWebClient<Student>("http", "trmanager", "localhost:8080", "student", "addbulk"); List<Student> x = test.getAll(); foreach (Student s in x) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('" + s.ToString() + "')", true); } }
protected void Page_Load(object sender, EventArgs e) { RepositoryUtility.initRU(); second_timer.Interval = 1000; TRWebClient<Form> test = new TRWebClient<Form>("http", "trmanager", "localhost:8080", "form", "addbulk"); allForms = test.getAll(); foreach (Form f in allForms) { DropDownList1.Items.Add(f.name); } RepositoryUtility.refreshData(); incident_Load(); }
public static bool initRU() { try { formRepository = new TRWebClient<Form>("http", "trmanager", "localhost:8080", "form", "addbulk"); incidentRepository = new TRWebClient<Incident>("http", "trmanager", "localhost:8080", "incident", "addbulk"); studentRepository = new TRWebClient<Student>("http", "trmanager", "localhost:8080", "student", "addbulk"); teacherRepository = new TRWebClient<Teacher>("http", "trmanager", "localhost:8080", "teacher", "addbulk"); refreshData(); } catch(Exception ee) { return false; } return true; }
protected void incident_Load() { TRWebClient<Incident> test = new TRWebClient<Incident>("http", "trmanager", "localhost:8080", "incident", "addbulk"); allIncident = test.getAll(); curIncident = new List<Incident>(); if (allIncident.Count == 0) return; foreach (Incident ii in allIncident) { if (ii.department == "" || String.IsNullOrEmpty(ii.department)) curIncident.Add(ii); } if (curIncident.Count == 0) curIncident.Add(new Incident(0, new Teacher("", "", ""), new Student(0, "", "", new Form("", new Teacher("", "", ""))), 0, "", "")); IncidentGV.DataSource = curIncident; IncidentGV.DataBind(); }
protected void addIncident(object sender, EventArgs e) { TRWebClient<Incident> test = new TRWebClient<Incident>("http", "trmanager", "localhost:8080", "incident", "addbulk"); test.add(new Incident(allIncident[1].getTeacher(), allIncident[1].getStudent(), 4, "2015-09-28 12:50:00", null ,"testIncident")); }