private void save(object sender, System.EventArgs e) { if (c_id.Text == "") { msg.Text = "Please enter course id"; return; } if (name.Text == "") { msg.Text = "Please enter class name"; return; } if (num.Text == "") { msg.Text = "Please enter class strength"; return; } if (storage.Contains(name.Text)) { msg.Text = "Class name already exists. Try another name"; return; } Batch batch = new Batch(c_id.Text, name.Text, Convert.ToInt16(num.Text)); storage[name.Text] = batch; App.batch_name_list.Add(name.Text); if (storage.Contains(App.batch_list_code)) { storage[App.batch_list_code] = App.batch_name_list; } else { storage.Add(App.batch_list_code, App.batch_name_list); } NavigationService.GoBack(); }
public stats() { InitializeComponent(); batch = (Batch)storage[App.batch_name]; student_list = (List<Student>)storage[App.batch_name+"student"]; //for (int i = 1; i < student_list.Count; i++) //{ // for (int j = 0; j < student_list[i].attended.Count; j++) // { // if (student_list[i].attended[j] == true) // def_disp.Text += Convert.ToString(i) + " "; // } // def_disp.Text += "\n"; //} init(); }
public void init() { cur_num = 1; roll_box.Text = Convert.ToString(cur_num); batch = (Batch)storage[App.batch_name]; temp_attnd_record = new bool[batch.num_students + 1]; for (int i = 0; i < batch.num_students; i++) { temp_attnd_record[i] = false; } temp_absnt = new List<int>(); temp_prsnt = new List<int>(); }