// dummy copy constructor public VStudent(VStudent student) : base(student) { History = student.History; Current = student.Current; Next = student.Next; Conflicts = student.Conflicts; }
private void StudentGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (StudentGrid.SelectedItem != null && StudentGrid.SelectedIndex <= StudentGrid.Items.Count) { VStudent temp = new VStudent(StudentGrid.SelectedItem as EStudent); StackData.DataContext = temp; StackPassport.DataContext = temp.Pasport; Subjects.ItemsSource = temp.Ratings; StakREsidence.DataContext = temp.Residence; BitmapImage bit = new BitmapImage(); if (temp.Image != null) { bit.BeginInit(); bit.StreamSource = photo.MemoryStream(temp.Image); bit.EndInit(); ImageS.Stretch = Stretch.Fill; ImageS.Source = bit; } else { bit.UriSource = new Uri(@"C:\Users\Arikatamo\source\repos\StudentBlank\WindowStudent\no-image.png"); } //Добавлення фото в базу //(StudentGrid.SelectedItem as EStudent).Image = photo.ImageToByte(photo.BitmapImage2Bitmap(bit)); //student.Save(); } }
//A student may only enroll itself. // super kludgy, but it should do the job. public List <errorReturn> enrollCourse(ref courseinfo course, ref VStudent student) { VStudent dummy = new VStudent(this); List <errorReturn> errlist = base.enrollCourse(ref course, ref dummy); Next = dummy.Next; Conflicts = dummy.Conflicts; return(errlist); }
public errorReturn unenrollCourse(ref courseinfo course, ref VStudent student) { VStudent dummy = new VStudent(this); errorReturn eN = base.unenrollCourse(ref course, ref dummy); Next = dummy.Next; Conflicts = dummy.Conflicts; return(eN); }
public void LoadTelContactData(string userid, string usertypeid) { //try //{ TelContactsRepository dir = new TelContactsRepository(); Session["TelPersonContactData"] = dir.GetTelpersonContactList(userid.ToInt(), usertypeid.ToInt()); GridView1.DataSource = Session["TelPersonContactData"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", dir.TelContactCount().ToString().ToFarsiNumber(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["TelPersonContactData"] as DataTable).Rows.Count.ToString().ToFarsiNumber(), Resources.DashboardText.SelectRecordCount); switch (Session["UserTypeID"].ToString()) { case "1": { VStudentsRepository vstdir = new VStudentsRepository(); VStudent std = vstdir.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "دانشجو" + ":" + std.FirstName + " " + std.LastName; } break; case "2": { VLecturersRepository vlec = new VLecturersRepository(); VLecturer lec = vlec.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "استاد" + ":" + lec.FirstName + " " + lec.LastName; } break; case "3": { VEmployeesRepository vlec = new VEmployeesRepository(); VEmployee emp = vlec.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "کارمند" + ":" + emp.FirstName + " " + emp.LastName; } break; } // } // catch // { //// Redirector.Goto(Redirector.PageName.errorpage); // } }
public void loadform() { try { lbluserid.Text = Session["UserID"].ToString(); lblusertypeid.Text = Session["UserTypeID"].ToString(); EmailTypesRepository etr = new EmailTypesRepository(); DataTable dt = etr.GetAllEmailTypes(); ddlemailtype.Items.Clear(); foreach (DataRow dr in dt.Rows) { ddlemailtype.Items.Add(new ListItem(dr["EmailTypeTitle"].ToString(), dr["EmailTypeID"].ToString())); } switch (Session["UserTypeID"].ToString()) { case "1": { VStudentsRepository vstdir = new VStudentsRepository(); VStudent std = vstdir.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "دانشجو" + ":" + std.FirstName + " " + std.LastName; } break; case "2": { VLecturersRepository vlec = new VLecturersRepository(); VLecturer lec = vlec.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "استاد" + ":" + lec.FirstName + " " + lec.LastName; } break; case "3": { VEmployeesRepository vlec = new VEmployeesRepository(); VEmployee emp = vlec.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "کارمند" + ":" + emp.FirstName + " " + emp.LastName; } break; } } catch { Redirector.Goto(Redirector.PageName.errorpage); } }
public VStudent FindByid(int id) { VStudent result = null; using (PersonsDBEntities DC = conn.GetContext()) { //-- SELECT * FROM vPhoneList WHERE PhobeID = phoneID result = (from r in DC.VStudents where r.StudentID == id select r).FirstOrDefault(); } return(result); }
public VStudent FindBynationatcode(string text) { VStudent result = null; using (PersonsDBEntities DC = conn.GetContext()) { //-- SELECT * FROM vPhoneList WHERE PhobeID = phoneID result = (from r in DC.VStudents where r.NationalCode == text select r).FirstOrDefault(); } return(result); }
public VStudent FindByuserName(string userName) { VStudent result = null; using (PersonsDBEntities DC = conn.GetContext()) { //-- SELECT * FROM vPhoneList WHERE PhobeID = phoneID result = (from r in DC.VStudents where r.Username == userName select r).FirstOrDefault(); } return(result); }
public virtual errorReturn unenrollCourse(ref courseinfo course, ref VStudent student) { errorReturn er; //if (this.status == "faculty") //{ // //Depending on Future specs, we still might want to test for this. //} // shouldn't be needed //if ((this.status == "student") || (this.usertype == VType.student)) //{ // //Is the user doing the edit the student being registered? // if (this != student) // { // //We have a very clever student. // er.wasError = true; // er.errorWas = "diffStudent"; // return er; //This is one where we might want to kick them out. // } //} if (!student.Next.Remove(course)) { er.wasError = true; er.errorWas = "notenrolled"; return(er); // throw "Unenroll encountered an error. Were you enrolled?" error } //recheck conflicts student.checkConflicts(); er.wasError = false; er.errorWas = "notError"; return(er); }
public void LoadData(string id) { try { EmailContactsRepository ecrir = new EmailContactsRepository(); EmailContact email = ecrir.FindByid(id.ToInt()); lblid.Text = email.ID.ToString(); Session["UserID"] = email.UserID.ToString(); Session["EmailType"] = email.EmailTypeID.ToString(); Session["UserType"] = email.UserTypeID.ToString(); lblEmailaddrress.Text = email.EmailAddrress.ToString(); Session["newuserid"] = email.UserID.ToString(); Session["newemailtype"] = email.EmailTypeID.ToString(); VStudentsRepository vstdir = new VStudentsRepository(); VStudent std = vstdir.FindByid(Session["UserID"].ToString().ToInt()); if (std != null) { Label7.Text = std.FirstName.ToString() + " " + std.LastName.ToString(); } else { Redirector.Goto(Redirector.PageName.errorpage); } EmailTypesRepository etir = new EmailTypesRepository(); EmailType emailtype = etir.FindByid(Session["EmailType"].ToString().ToInt()); if (emailtype != null) { lblEmailtype.Text = emailtype.EmailTypeTitle; // Label7.Text = std.FirstName.ToString() + " " + std.LastName.ToString(); } else { Redirector.Goto(Redirector.PageName.errorpage); } EmailTypesRepository etr = new EmailTypesRepository(); DataTable dt2 = etr.GetAllEmailTypes(); ddlemailtype.Items.Clear(); foreach (DataRow dr in dt2.Rows) { ddlemailtype.Items.Add(new ListItem(dr["EmailTypeTitle"].ToString(), dr["EmailTypeID"].ToString())); } switch ((Session["UserType"].ToString())) { case "1": { DropDownList1.SelectedValue = "1"; VStudentsRepository vstd = new VStudentsRepository(); DataTable dtstd = vstd.GetAllstd(); ddluserid.Items.Clear(); foreach (DataRow dr in dtstd.Rows) { ddluserid.Items.Add(new ListItem(dr["FirstName"].ToString() + " " + dr["LastName"].ToString(), dr["StudentID"].ToString())); } } break; case "2": { DropDownList1.SelectedValue = "2"; VLecturersRepository vlrir = new VLecturersRepository(); DataTable dtlec = vlrir.GetAllLec(); ddluserid.Items.Clear(); foreach (DataRow dr in dtlec.Rows) { ddluserid.Items.Add(new ListItem(dr["FirstName"].ToString() + " " + dr["LastName"].ToString(), dr["LecturerID"].ToString())); } } break; case "3": { DropDownList1.SelectedValue = "3"; VEmployeesRepository verir = new VEmployeesRepository(); DataTable dtemp = verir.GetAllEmp(); ddluserid.Items.Clear(); foreach (DataRow dr in dtemp.Rows) { ddluserid.Items.Add(new ListItem(dr["FirstName"].ToString() + " " + dr["LastName"].ToString(), dr["EmployeeID"].ToString())); } } break; } } catch { Redirector.Goto(Redirector.PageName.errorpage); } }
public override errorReturn unenrollCourse(ref courseinfo course, ref VStudent student) { return base.unenrollCourse(ref course,ref student); }
//An admin may add any student to any class. public override List<errorReturn> enrollCourse(ref courseinfo course, ref VStudent student) { return base.enrollCourse(ref course,ref student); }
public virtual errorReturn unenrollCourse(ref courseinfo course, ref VStudent student) { errorReturn er; //if (this.status == "faculty") //{ // //Depending on Future specs, we still might want to test for this. //} // shouldn't be needed //if ((this.status == "student") || (this.usertype == VType.student)) //{ // //Is the user doing the edit the student being registered? // if (this != student) // { // //We have a very clever student. // er.wasError = true; // er.errorWas = "diffStudent"; // return er; //This is one where we might want to kick them out. // } //} if (!student.Next.Remove(course)) { er.wasError = true; er.errorWas = "notenrolled"; return er; // throw "Unenroll encountered an error. Were you enrolled?" error } //recheck conflicts student.checkConflicts(); er.wasError = false; er.errorWas = "notError"; return er; }
//Returns a list of errorReturns. Warnings are errorList objects with wasError = false; //Returns an empty list if there were neither errors nor warnings. //Test for success by List<errorReturn> i = enrollCourse(c,s); ((i.Count == 0) || (i[0].wasError == false)); public virtual List<errorReturn> enrollCourse(ref courseinfo course, ref VStudent student) { List<errorReturn> errlist = new List<errorReturn>(); List<errorReturn> warnlist = new List<errorReturn>(); errorReturn eN; // Always use this to add errors and warnings. if (student.Next.Contains(course)) //Is the student already registered for this course? Return an error. { if (course.Students.Contains(student)) { eN.wasError = true; eN.errorWas = "AlreadyHere"; errlist.Add(eN); return errlist; } else student.Next.Remove(course); //if out of sync, course has priority } //Generate list of Errors. if (course.isFull()) //Is the course full? Return an error. { eN.wasError = true; eN.errorWas = "CourseIsFull"; errlist.Add(eN); } if ((student.enrolledCredits() + course.Credit) > 5.0) //Would this put the student over 5.0 credits? { eN.errorWas = ">5.0"; if (status == "admin") //If Admin, warn, but allow. { eN.wasError = false; warnlist.Add(eN); } else //If not Admin, return error. { eN.wasError = true; errlist.Add(eN); } } if (errlist.Count == 0) { //Generate list of Warnings. //Warnings for class conflict foreach (courseinfo course2 in student.Next) //Compare to each already added class { foreach (coursetime time in course.Times) //Each time the course is offered { foreach (coursetime time2 in course2.Times) //And each time of that class. { bool iscnflct = false; if (((time.start <= time2.start) && (time2.start <= time.end)) || ((time2.start <= time.start) && (time.start <= time2.end))) { //Does this time overlap? foreach (char day in time.days) { //Is it on the same day? if (time2.days.Contains(day)) { //Throw warning message. eN.wasError = false; eN.errorWas = "!" + course2.Coursetitle; warnlist.Add(eN); if (!student.Conflicts.Contains(course.Coursetitle)) student.Conflicts.Add(course.Coursetitle); if (!student.Conflicts.Contains(course2.Coursetitle)) student.Conflicts.Add(course2.Coursetitle); iscnflct = true; break; } } if (iscnflct) break; } } } } // Hopefully interface handles this now? bool repeat = false; // are they currently taking it? foreach(var course2 in student.Current) { if(course.Equals(course2)) { repeat = true; break; } } // have they taken it before? if (!repeat) { foreach (var course2 in student.History) { if (course.Equals(course2)) { repeat = true; break; } } } // warn if they have taken it if (repeat) { eN.wasError = false; eN.errorWas = "?" + course.Coursetitle; warnlist.Add(eN); } //Beyond here, no new errors and no new warnings. student.Next.Add(course); //The student has a course. course.enrollStudent(ref student); //The course has a student. //Otherwise, we'll return the list of warnings. The only way to have returned an empty list is //If there are no warnings. return warnlist; } else return errlist; }
//An admin may add any student to any class. public override List <errorReturn> enrollCourse(ref courseinfo course, ref VStudent student) { return(base.enrollCourse(ref course, ref student)); }
//Returns a list of errorReturns. Warnings are errorList objects with wasError = false; //Returns an empty list if there were neither errors nor warnings. //Test for success by List<errorReturn> i = enrollCourse(c,s); ((i.Count == 0) || (i[0].wasError == false)); public virtual List <errorReturn> enrollCourse(ref courseinfo course, ref VStudent student) { List <errorReturn> errlist = new List <errorReturn>(); List <errorReturn> warnlist = new List <errorReturn>(); errorReturn eN; // Always use this to add errors and warnings. if (student.Next.Contains(course)) //Is the student already registered for this course? Return an error. { if (course.Students.Contains(student)) { eN.wasError = true; eN.errorWas = "AlreadyHere"; errlist.Add(eN); return(errlist); } else { student.Next.Remove(course); //if out of sync, course has priority } } //Generate list of Errors. if (course.isFull()) //Is the course full? Return an error. { eN.wasError = true; eN.errorWas = "CourseIsFull"; errlist.Add(eN); } if ((student.enrolledCredits() + course.Credit) > 5.0) //Would this put the student over 5.0 credits? { eN.errorWas = ">5.0"; if (status == "admin") //If Admin, warn, but allow. { eN.wasError = false; warnlist.Add(eN); } else //If not Admin, return error. { eN.wasError = true; errlist.Add(eN); } } if (errlist.Count == 0) { //Generate list of Warnings. //Warnings for class conflict foreach (courseinfo course2 in student.Next) //Compare to each already added class { foreach (coursetime time in course.Times) //Each time the course is offered { foreach (coursetime time2 in course2.Times) //And each time of that class. { bool iscnflct = false; if (((time.start <= time2.start) && (time2.start <= time.end)) || ((time2.start <= time.start) && (time.start <= time2.end))) { //Does this time overlap? foreach (char day in time.days) { //Is it on the same day? if (time2.days.Contains(day)) { //Throw warning message. eN.wasError = false; eN.errorWas = "!" + course2.Coursetitle; warnlist.Add(eN); if (!student.Conflicts.Contains(course.Coursetitle)) { student.Conflicts.Add(course.Coursetitle); } if (!student.Conflicts.Contains(course2.Coursetitle)) { student.Conflicts.Add(course2.Coursetitle); } iscnflct = true; break; } } if (iscnflct) { break; } } } } } // Hopefully interface handles this now? bool repeat = false; // are they currently taking it? foreach (var course2 in student.Current) { if (course.Equals(course2)) { repeat = true; break; } } // have they taken it before? if (!repeat) { foreach (var course2 in student.History) { if (course.Equals(course2)) { repeat = true; break; } } } // warn if they have taken it if (repeat) { eN.wasError = false; eN.errorWas = "?" + course.Coursetitle; warnlist.Add(eN); } //Beyond here, no new errors and no new warnings. student.Next.Add(course); //The student has a course. course.enrollStudent(ref student); //The course has a student. //Otherwise, we'll return the list of warnings. The only way to have returned an empty list is //If there are no warnings. return(warnlist); } else { return(errlist); } }
// we only need a list of students in a specific course, not all, so this doesn't need to be a function //public List<VStudent> futureStudents(ref courseinfo course) //{ // List<VStudent> nextStudents = new List<VStudent>(); // foreach (courseinfo course in NextClasses) // { // foreach (VStudent student in course.Students) // { // if (!nextStudents.Contains(student)) // nextStudents.Add(student); // } // } // return nextStudents; //} public List <pastcourse> VerifyAdviseeCurrentSchedule(ref VStudent advisee) { return(advisee.Current); }
// we only need a list of students in a specific course, not all, so this doesn't need to be a function //public List<VStudent> futureStudents(ref courseinfo course) //{ // List<VStudent> nextStudents = new List<VStudent>(); // foreach (courseinfo course in NextClasses) // { // foreach (VStudent student in course.Students) // { // if (!nextStudents.Contains(student)) // nextStudents.Add(student); // } // } // return nextStudents; //} public List<pastcourse> VerifyAdviseeCurrentSchedule(ref VStudent advisee) { return advisee.Current; }
public void LoadData(string id) { try { VPNsRepository vpnir = new VPNsRepository(); // EmailContactsRepository ecrir = new EmailContactsRepository(); VVPN vpn = vpnir.FindByid(id.ToInt()); lblid.Text = id; Session["UserID"] = vpn.UserID.ToString(); Session["UserType"] = vpn.UserTypeID.ToString(); Session["DepartmentID"] = vpn.DepartmentID; lblusername.Text = vpn.Username; Lbldep.Text = vpn.DepartmentTitle; VStudentsRepository vstdir = new VStudentsRepository(); VStudent std = vstdir.FindByid(Session["UserID"].ToString().ToInt()); if (std != null) { Label7.Text = std.FirstName.ToString() + " " + std.LastName.ToString(); } else { Redirector.Goto(Redirector.PageName.errorpage); } DepartmentsRepository etr = new DepartmentsRepository(); DataTable dt = etr.GetAllDepartment(); ddldepartment.Items.Clear(); foreach (DataRow dr in dt.Rows) { ddldepartment.Items.Add(new ListItem(dr["DepartmentTitle"].ToString(), dr["DepartmentID"].ToString())); } switch ((Session["UserType"].ToString())) { case "1": { DropDownList1.SelectedValue = "1"; VStudentsRepository vstd = new VStudentsRepository(); DataTable dtstd = vstd.GetAllstd(); ddluserid.Items.Clear(); foreach (DataRow dr in dtstd.Rows) { ddluserid.Items.Add(new ListItem(dr["FirstName"].ToString() + " " + dr["LastName"].ToString(), dr["StudentID"].ToString())); } } break; case "2": { DropDownList1.SelectedValue = "2"; VLecturersRepository vlrir = new VLecturersRepository(); DataTable dtlec = vlrir.GetAllLec(); ddluserid.Items.Clear(); foreach (DataRow dr in dtlec.Rows) { ddluserid.Items.Add(new ListItem(dr["FirstName"].ToString() + " " + dr["LastName"].ToString(), dr["LecturerID"].ToString())); } } break; case "3": { DropDownList1.SelectedValue = "3"; VEmployeesRepository verir = new VEmployeesRepository(); DataTable dtemp = verir.GetAllEmp(); ddluserid.Items.Clear(); foreach (DataRow dr in dtemp.Rows) { ddluserid.Items.Add(new ListItem(dr["FirstName"].ToString() + " " + dr["LastName"].ToString(), dr["EmployeeID"].ToString())); } } break; } } catch { Redirector.Goto(Redirector.PageName.errorpage); } }
//Should return the schedule for the advisee with a list of warnings for conflicts. public List <courseinfo> VerifyAdviseeNextSchedule(ref VStudent advisee, out List <string> conflicts) { conflicts = new List <string>(advisee.Conflicts); return(advisee.Next); }
public errorReturn unenrollCourse(ref courseinfo course, ref VStudent student) { VStudent dummy = new VStudent(this); errorReturn eN = base.unenrollCourse(ref course, ref dummy); Next = dummy.Next; Conflicts = dummy.Conflicts; return eN; }
//Should return the schedule for the advisee with a list of warnings for conflicts. public List<courseinfo> VerifyAdviseeNextSchedule(ref VStudent advisee, out List<string> conflicts) { conflicts = new List<string>(advisee.Conflicts); return advisee.Next; }
public override errorReturn unenrollCourse(ref courseinfo course, ref VStudent student) { return(base.unenrollCourse(ref course, ref student)); }
public void loadform(string stdi) { //try //{ FacultiesRepositpry fair = new FacultiesRepositpry(); DataTable dt = fair.GetAllFaculties(); ddlfacultuy.Items.Clear(); foreach (DataRow dr in dt.Rows) { ddlfacultuy.Items.Add(new ListItem(dr["FacultyTitle"].ToString(), dr["FacultyID"].ToString())); } EduLevelsRepository leveir = new EduLevelsRepository(); DataTable dtlevel = leveir.GetAllEduLevels(); foreach (DataRow dr in dtlevel.Rows) { ddllevel.Items.Add(new ListItem(dr["LevelTitle"].ToString(), dr["LevelID"].ToString())); } EduFieldsRepository fieldir = new EduFieldsRepository(); DataTable dtfield = fieldir.GetAllEduFields(); foreach (DataRow dr in dtfield.Rows) { ddlfield.Items.Add(new ListItem(dr["FieldTitle"].ToString(), dr["FieldID"].ToString())); } VEduTendenciesRepository tenir = new VEduTendenciesRepository(); DataTable ten = tenir.GetAllTendency(); foreach (DataRow dr in ten.Rows) { ddltendency.Items.Add(new ListItem(dr["TendencyTitle"].ToString(), dr["TendencyID"].ToString())); } VStudentsRepository vstir = new VStudentsRepository(); VStudent std = vstir.FindByid(stdi.ToInt()); if (std != null) { lblstdid.Text = std.StudentID.ToString(); txtstdcode.Text = std.StudentCode; txtname.Text = std.FirstName; txtlastname.Text = std.LastName; RadioButtonList1.SelectedValue = std.Gender.ToString(); txtnationalcode.Text = std.NationalCode; lblfaculty.Text = std.FacultyTitle; lbllevel.Text = std.LevelTitle; lblfield.Text = std.FieldTitle; lbltend.Text = std.TendencyTitle; RadioButtonList2.SelectedValue = std.EntryTerm.ToString(); lblusername.Text = std.Username; if (txtpass.Text != null) { txtpass.Text = std.Password; } // ImageButton1.ImageUrl = std.ImageFileName; Session["newfacultyid"] = std.FacultyID.ToString(); Session["newlevelid"] = std.LevelID.ToString(); Session["newfieldid"] = std.FieldID.ToString(); Session["newtenid"] = std.TendencyID.ToString(); Session["pass"] = std.Password; chkActiveAccount.Checked = (std.Status.Value == 0 ? true : false); Session["imageurl"] = std.ImageFileName; if (Session["imageurl"].ToString() != null) { ImageButton2.ImageUrl = "~/file/" + std.ImageFileName; } } else { Redirector.Goto(Redirector.PageName.errorpage); } //} //catch //{ // Redirector.Goto(Redirector.PageName.errorpage); //} }
public void loadform() { try { EmailContactsRepository ecrir = new EmailContactsRepository(); EmailContact email = ecrir.FindByid(Session["ID"].ToString().ToInt()); lblid.Text = email.ID.ToString(); lbluserid.Text = Session["UserID"].ToString(); lblusertypeid.Text = Session["UserTypeID"].ToString(); Session["EmailType"] = email.EmailTypeID.ToString(); lblemailaddrress.Text = email.EmailAddrress; Session["newemailtype"] = email.EmailTypeID.ToString(); switch (Session["UserTypeID"].ToString()) { case "1": { VStudentsRepository vstdir = new VStudentsRepository(); VStudent std = vstdir.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "دانشجو" + ":" + std.FirstName + " " + std.LastName; } break; case "2": { VLecturersRepository vlec = new VLecturersRepository(); VLecturer lec = vlec.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "استاد" + ":" + lec.FirstName + " " + lec.LastName; } break; case "3": { VEmployeesRepository vlec = new VEmployeesRepository(); VEmployee emp = vlec.FindByid(Session["UserID"].ToString().ToInt()); Label9.Text = "کارمند" + ":" + emp.FirstName + " " + emp.LastName; } break; } EmailTypesRepository etir = new EmailTypesRepository(); EmailType emailtype = etir.FindByid(Session["EmailType"].ToString().ToInt()); if (emailtype != null) { lblEmailtype.Text = emailtype.EmailTypeTitle; // Label7.Text = std.FirstName.ToString() + " " + std.LastName.ToString(); } else { Redirector.Goto(Redirector.PageName.errorpage); } EmailTypesRepository etr = new EmailTypesRepository(); DataTable dt2 = etr.GetAllEmailTypes(); ddlemailtype.Items.Clear(); foreach (DataRow dr in dt2.Rows) { ddlemailtype.Items.Add(new ListItem(dr["EmailTypeTitle"].ToString(), dr["EmailTypeID"].ToString())); } } catch { Redirector.Goto(Redirector.PageName.errorpage); } }
//A student may only enroll itself. // super kludgy, but it should do the job. public List<errorReturn> enrollCourse(ref courseinfo course, ref VStudent student) { VStudent dummy = new VStudent(this); List<errorReturn> errlist = base.enrollCourse(ref course, ref dummy); Next = dummy.Next; Conflicts = dummy.Conflicts; return errlist; }