private void Search(ProspectStudentCase obj) { DatabaseConnection connection = new DatabaseConnection( @" declare @levelName as varchar(30); select @levelName = strNameLevel from [Level] where intIdLevel = @levelid; if (SUBSTRING(@levelName, 0, 3) like 'IP') select intID from CCEx_ProspectCase where intSubjectID = @subjectid and intLevelID = @levelid and intSchoolID = @schoolid and intID <> @id; else select intID from CCEx_ProspectCase where intSubjectID = @subjectid and intLevelID = @levelid and intID <> @id; "); DataTable table = connection.AddParameter("@id", obj.ID).AddParameter("@subjectid", obj.SubjectID).AddParameter("@levelid", obj.LevelID).AddParameter("@schoolid", obj.SchoolID).Query; foreach (DataRow row in table.Rows) _cases.Add(new ProspectStudentCase((int)row[0], null)); }
private void Populate(ProspectStudentCase scase) { DatabaseConnection connection = new DatabaseConnection( @" select convert(varchar(100),dtmTimeStartRegular, 108) + ' to ' + convert(varchar(100),dtmTimeEndRegular, 108) as 'Session', strDayRegular as 'Day', strNameBranch as 'Branch' from ClassSchedule inner join Regular on ClassSchedule.intIdClassSchedule = Regular.intIdClassScheduleRegular inner join Branch on intIdBranch = intIdClassroomRegular where intIdLevelClassSchedule = @levelid and intIdSubjectClassSchedule = @subjectid and intIdClassroomRegular = @branchid and strYearClassSchedule like DATEPART(year, getdate()); " ); DataTable table = connection.AddParameter("@levelid", scase.LevelID).AddParameter("@branchid", scase.BranchID).AddParameter("@subjectid", scase.SubjectID).Query; foreach (DataRow row in table.Rows) _entries.Add(new CaseSimilarRegularClassEntry(row["session"].ToString(), row["branch"].ToString(), row["day"].ToString())); }
public CaseSimilarityEngine(ProspectStudentCase caseObj) { Search(caseObj); }
public CaseSimilarRegularClass(ProspectStudentCase scase) { Populate(scase); }
protected void lbNewProspect_Click(object sender, EventArgs e) { try { WorkspaceBufferEngine engine = CurrentSession.BufferEngine; Prospect prospect = new Prospect(engine.GetNextValidID(), null); engine.Append(prospect); Prospect student = new Prospect(engine.GetNextValidID(), prospect); student.SetStudent = true; prospect.AddStudent(student); ProspectStudentCase studentCase = new ProspectStudentCase( engine.GetNextValidID(), student); studentCase.StaffID = CurrentSession.CredentialManager.ValidStaffID(1); UpdateWorkspaceSideBar(); } catch (Exception ex) { bool rethrow = ExceptionPolicy.HandleException(ex, "GenericPolicy"); if (rethrow) throw; } }
protected void lbAddNewCase_Click(object sender, EventArgs e) { try { UpdateCurrentInfo(); WorkspaceBufferEngine engine = CurrentSession.BufferEngine; Prospect student = engine.GetWorkspaceObjectWithType<Prospect> (CurrentSession.CurrentStudentID); ProspectStudentCase sCase = new ProspectStudentCase(engine.GetNextValidID() , student); DisplayStudent(CurrentSession.CurrentStudentID); } catch (Exception ex) { bool rethrow = ExceptionPolicy.HandleException(ex, "GenericPolicy"); if (rethrow) throw; } }
public override void Populate() { DatabaseConnection connection = new DatabaseConnection (@"select * from CCEx_Prospect where intID = @id"); DataTable result = connection.AddParameter("@id", ID).Query; Name = result.Rows[0]["strFullName"].ToString(); Address = result.Rows[0]["strAddress"].ToString(); Email = result.Rows[0]["strEmail"].ToString(); // Populate Prospect Student connection = new DatabaseConnection (@"select CCEx_ProspectRelation.intStudentID from CCEx_ProspectRelation where intProspectID = @prospectid"); foreach (DataRow row in connection.AddParameter("@prospectid", ID).Query.Rows) AddStudent(new Prospect((int)row[0], this)); // Populate Prospect Contact connection = new DatabaseConnection (@"select intContactID, strContactNumber from CCEx_ProspectContact where intID = @id;"); foreach (DataRow row in connection.AddParameter("@id", ID).Query.Rows) AddContact(new ProspectContact((int)row[0] , row[1].ToString(), this)); if (this.IsInstanceStudent()) { connection = new DatabaseConnection( @"select intID from CCEx_ProspectCase where intStudentID = @studentid; "); foreach (DataRow row in connection.AddParameter("@studentid", ID).Query.Rows) { ProspectStudentCase pscase = new ProspectStudentCase( (int)row[0], this); } } }