protected override void CompareValue(object sender, FISCA.Presentation.CompareValueEventArgs e) { int x, y; if (!int.TryParse(e.Value1.ToString(), out x)) x = -1; if (!int.TryParse(e.Value2.ToString(), out y)) y = -1; e.Result = x.CompareTo(y); }
static DataTable FindByTeacherQuery(string fieldName, FISCA.Presentation.SearchEventArgs e) { string strQuery = string.Empty; if (fieldName == "教師姓名") strQuery = string.Format("select teacher.id as teacher_id from teacher where teacher_name like '%{0}%'", e.Condition); if (fieldName == "所屬單位") strQuery = string.Format("select ref_teacher_id as teacher_id from $ischool.emba.teacher_ext where major_work_place like '%{0}%'", e.Condition); if (fieldName == "教師編號") strQuery = string.Format("select ref_teacher_id as teacher_id from $ischool.emba.teacher_ext where employee_no like '%{0}%'", e.Condition); if (fieldName == "帳號") strQuery = string.Format("select id as teacher_id from teacher where st_login_name like '%{0}%'", e.Condition); return (new QueryHelper()).Select(strQuery); }
static DataTable FindByCourseQuery(string fieldName, FISCA.Presentation.SearchEventArgs e) { string strQuery = string.Empty; if (fieldName == "課程名稱") strQuery = string.Format("select course.id as course_id from course where course_name like '%{0}%'", e.Condition); if (fieldName == "課程識別碼") strQuery = string.Format("select ref_course_id as course_id from $ischool.emba.course_ext where subject_code like '%{0}%'", e.Condition); if (fieldName == "課號") strQuery = string.Format("select ref_course_id as course_id from $ischool.emba.course_ext where new_subject_code like '%{0}%'", e.Condition); return (new QueryHelper()).Select(strQuery); }
static DataTable FindByQuery(string fieldName, FISCA.Presentation.SearchEventArgs e) { string strQuery = string.Empty; if (fieldName == "公司名稱") strQuery = string.Format("SELECT stu.id FROM student stu inner join $ischool.emba.experience exp on stu.id = exp.ref_student_id WHERE company_name ilike '%{0}%'", e.Condition); if (fieldName == "學校名稱") strQuery = string.Format("SELECT stu.id FROM student stu inner join $ischool.emba.education_background bg on bg.ref_student_id = stu.id WHERE school_name ilike '%{0}%'", e.Condition); if (fieldName == "備註") strQuery = string.Format("SELECT stu.id FROM student stu inner join $ischool.emba.student_brief2 bg on bg.ref_student_id = stu.id WHERE remark ilike '%{0}%'", e.Condition); if (fieldName == "姓名") strQuery = string.Format("SELECT stu.id FROM student as stu where name ilike '%{0}%'", e.Condition); if (fieldName == "學號") strQuery = string.Format("SELECT stu.id FROM student as stu where student_number ilike '%{0}%'", e.Condition); if (fieldName == "身分證號") strQuery = string.Format("SELECT stu.id FROM student as stu where id_number ilike '%{0}%'", e.Condition); return (new QueryHelper()).Select(strQuery); }