public override int UpdateDB(object o) { // custom update assignment cInstAssignViewRow d = (cInstAssignViewRow)o; if (d != null) { vlist.Reset(); vlist.Add("name", d.data[2]); // assignment name vlist.Add("type_num", d.data[3]); // assignment type vlist.Add("is_extra", d.data[4]); // is extra vlist.Add("max_points", d.data[5]); // max points vlist.Add("details", d.data[9]); // details string sql = string.Format("{0} WHERE assign_id={1}", vlist.SQL, d.data[0] ); return(Update("js_assign", sql)); } return(1); }
public void RowChanged(int row) { // instructor if (security_level == 1) { if (sub_state == 0) // section { current_section = section_view.GetRow(row); if (current_section != null) { main_form.sectionLink.Text = current_section.ToString(); } else { main_form.sectionLink.Text = ""; } } else if (sub_state == 2) // assignment { current_assign = inst_assign_view.GetRow(row); if (current_assign != null) { main_form.assignLink.Text = current_assign.ToString(); } else { main_form.assignLink.Text = ""; } } UpdateState(); } }
public cInstAssignViewRow GetRow(int row) { if (row < dlist.Count) { cInstAssignViewRow d = (cInstAssignViewRow)dlist[row]; return(d); } return(null); }
public void Logout() { CurrentYear = DateTime.Now.Year; CurrentSem = "Fall"; current_view = null; current_id = -1; current_login = null; current_section = null; current_assign = null; sub_state = 0; UpdateSecurityLevel(-1); }
public override int DeleteDB(object o) { cInstAssignViewRow d = (cInstAssignViewRow)o; if (d != null) { vlist.Reset(); vlist.Add("assign_id", d.data[0]); return(Delete("js_assign", vlist.SQL)); } return(1); }
// for row selection public int GetIndex(int id) { for (int i = 0; i < dlist.Count; i++) { cInstAssignViewRow d = (cInstAssignViewRow)dlist[i]; if (d != null) { if (id == d.ID) { return(i); } } } return(0); }
public override int InsertDB(object o) { // custom update assignment cInstAssignViewRow d = (cInstAssignViewRow)o; if (d != null) { vlist.Reset(); vlist.AddSeqNextValue("js_assign"); vlist.Add(Program.main.CurrentSection); vlist.Add(d.data[2]); vlist.Add(d.data[3]); vlist.Add(d.data[4]); vlist.Add(d.data[5]); vlist.Add(d.data[9]); return(Insert("js_assign", vlist.SQL)); } return(1); }
public void RowChanged(int row) { // instructor if (security_level == 1) { if (sub_state == 0) // section { current_section = section_view.GetRow(row); if(current_section != null) main_form.sectionLink.Text = current_section.ToString(); else main_form.sectionLink.Text = ""; } else if (sub_state == 2) // assignment { current_assign = inst_assign_view.GetRow(row); if (current_assign != null) main_form.assignLink.Text = current_assign.ToString(); else main_form.assignLink.Text = ""; } UpdateState(); } }
public void Logout() { CurrentYear = DateTime.Now.Year; CurrentSem = "Fall"; current_view = null; current_id = -1; current_login = null; current_section = null; current_assign = null; sub_state = 0; UpdateSecurityLevel(-1); }