/// <summary> /// 取得比較字串 /// </summary> static public string GetString(K12.Data.StudentRecord sr1) { string ClassYear = ""; //年級 string ClassIndex = ""; //班級序號 string ClassName = ""; //班級名稱 string StudentSeatNo = ""; //學生座號 string StudentName = ""; //學生姓名 K12.Data.StudentRecord _StudentRecord = sr1; #region ClassIndex & ClassName if (_StudentRecord.Class != null) //如果有班級 { ClassYear = Year(_StudentRecord.Class); ClassIndex = Index(_StudentRecord.Class); ClassName = _StudentRecord.Class.Name.PadLeft(10, '0'); } else //如果沒有班級 { ClassYear = ClassYear.PadLeft(10, '9'); ClassIndex = ClassIndex.PadLeft(10, '9'); ClassName = ClassName.PadLeft(10, '9'); } #endregion StudentName = _StudentRecord.Name.PadLeft(10, '0'); StudentSeatNo = _StudentRecord.SeatNo.HasValue ? _StudentRecord.SeatNo.Value.ToString().PadLeft(10, '0') : StudentSeatNo.PadLeft(10, '9'); string _SortString = ClassYear + ClassIndex + ClassName + StudentSeatNo + StudentName; return(_SortString); }
public StudentSortObj_K12Data(K12.Data.ClassRecord classRecord, K12.Data.StudentRecord student) { string ClassYear = ""; //年級 string ClassIndex = ""; //班級序號 string ClassName = ""; //班級名稱 string StudentSeatNo = ""; //學生座號 string StudentName = ""; //學生姓名 _StudentRecord = student; #region ClassIndex & ClassName if (classRecord != null) //如果有班級 { _ClassRecord = classRecord; ClassYear = Year(_ClassRecord); ClassIndex = Index(_ClassRecord); ClassName = _ClassRecord.Name.PadLeft(10, '0'); } else //如果沒有班級 { ClassYear = ClassYear.PadLeft(10, '9'); ClassIndex = ClassIndex.PadLeft(10, '9'); ClassName = ClassName.PadLeft(10, '9'); } #endregion StudentName = _StudentRecord.Name.PadLeft(10, '0'); StudentSeatNo = _StudentRecord.SeatNo.HasValue ? _StudentRecord.SeatNo.Value.ToString().PadLeft(10, '0') : StudentSeatNo.PadLeft(10, '9'); _SortString = ClassYear + ClassIndex + ClassName + StudentSeatNo + StudentName; }
/// <summary> /// 資料取得 /// </summary> private void Bgw_DoWork(object sender, DoWorkEventArgs e) { //取得目前資料是哪一位學生 _student = K12.Data.Student.SelectByID(this.PrimaryKey); //取得該名學生的UDT資料 List <SiblingRecord> siblingsList = tool._a.Select <SiblingRecord> (string.Format("ref_student_id={0}", _student.ID)); //將作業結果傳遞至 Completed e.Result = siblingsList; }
public RStudentRecord(K12.Data.StudentRecord record) { ID = record.ID; Name = record.Name; SeatNo = record.SeatNo.HasValue ? record.SeatNo.Value.ToString() : ""; StudentNumber = record.StudentNumber; ClassName = string.Empty; GradeYear = string.Empty; K12.Data.ClassRecord cr = record.Class; if (cr != null) { ClassName = record.Class.Name; GradeYear = record.Class.GradeYear.HasValue ? record.Class.GradeYear.Value.ToString() : ""; } }
private void btnDelete_Click(object sender, EventArgs e) { if (lvCareRecord.SelectedItems.Count == 1) { DAO.UDT_CounselCareRecordDef careRec = lvCareRecord.SelectedItems[0].Tag as DAO.UDT_CounselCareRecordDef; if (careRec != null) { DAO.LogTransfer logTransfer = new DAO.LogTransfer(); K12.Data.StudentRecord studRec = K12.Data.Student.SelectByID(PrimaryKey); StringBuilder logData = new StringBuilder(); logData.AppendLine("刪除" + Utility.ConvertString1(studRec)); if (FISCA.Presentation.Controls.MsgBox.Show("請問是否確定是刪除優先關懷紀錄?", "刪除優先關懷紀錄", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { // log logData.AppendFormat("代號:" + careRec.CodeName); if (careRec.FileDate.HasValue) { logData.AppendLine("立案日期:" + careRec.FileDate.Value.ToShortDateString()); } logData.AppendLine("個案類別:" + careRec.CaseCategory); logData.AppendLine("個案類別備註:" + careRec.CaseCategoryRemark); logData.AppendLine("個案來源:" + careRec.CaseOrigin); logData.AppendLine("個案來源備註:" + careRec.CaseOriginRemark); logData.AppendLine("優勢能力及財力:" + careRec.Superiority); logData.AppendLine("弱勢能力及阻力:" + careRec.Weakness); logData.AppendLine("輔導人員輔導目標:" + careRec.CounselGoal); logData.AppendLine("校外協輔機構:" + careRec.OtherInstitute); logData.AppendLine("輔導人員輔導方式:" + careRec.CounselType); logData.AppendLine("協同輔導人員協助導師事項:" + careRec.AssistedMatter); logData.AppendLine("記錄者:" + careRec.AuthorID); logData.AppendLine("記錄者姓名:" + careRec.AuthorName); _UDTTransfer.DeleteCareRecord(careRec); logTransfer.SaveLog("學生.輔導優先關懷-刪除", "刪除", "student", PrimaryKey, logData); _BGRun(); } } } else { FISCA.Presentation.Controls.MsgBox.Show("請選擇資料."); } }
private void btnDel_Click(object sender, EventArgs e) { // 刪除 if (lvStudQuizData.SelectedItems.Count == 1) { DAO.UDT_StudQuizDataDef sqd = lvStudQuizData.SelectedItems[0].Tag as DAO.UDT_StudQuizDataDef; if (sqd != null) { if (FISCA.Presentation.Controls.MsgBox.Show("請問刪除測驗資料", "刪除測驗資料", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { List <DAO.UDT_StudQuizDataDef> delData = new List <DAO.UDT_StudQuizDataDef> (); delData.Add(sqd); K12.Data.StudentRecord rec = K12.Data.Student.SelectByID(PrimaryKey); StringBuilder logData = new StringBuilder(); logData.AppendLine("刪除" + Utility.ConvertString1(rec)); logData.AppendLine("測驗名稱「 " + lvStudQuizData.SelectedItems[0].SubItems[0].Text + " 」"); if (sqd.ImplementationDate.HasValue) { logData.AppendLine("實施日期:" + sqd.ImplementationDate.Value.ToShortDateString()); } if (sqd.AnalysisDate.HasValue) { logData.AppendLine("解析日期:" + sqd.AnalysisDate.Value.ToShortDateString()); } XElement elmContent = Utility.ConvertStringToXelm1(sqd.Content); if (elmContent != null) { foreach (XElement elm in elmContent.Elements("Item")) { if (elm.Attribute("name") != null && elm.Attribute("value") != null) { logData.AppendLine("項目名稱:" + elm.Attribute("name").Value + " , 測驗結果:" + elm.Attribute("value").Value); } } } _UDTTransfer.DeleteStudQuizDataLlist(delData); // log _LogTransfer.SaveLog("學生.輔導相關測驗-刪除", "刪除", "student", PrimaryKey, logData); _BGRun(); } } } }
private void btnSave_Click(object sender, EventArgs e) { if (txtName.Text.Trim() == "") return; K12.Data.StudentRecord studRec = new K12.Data.StudentRecord(); studRec.Name = txtName.Text; string StudentID = K12.Data.Student.Insert(studRec); PermRecLogProcess prlp = new PermRecLogProcess(); if (chkInputData.Checked == true) { if (StudentID != "") { Student.Instance.PopupDetailPane(StudentID); Student.Instance.SyncDataBackground(StudentID); } } Student.Instance.SyncDataBackground(StudentID); prlp.SaveLog("學籍.學生", "新增學生", "新增學生姓名:" + txtName.Text); this.Close(); }
private void btnDelete_Click(object sender, EventArgs e) { if (lvFitnessList.SelectedItems.Count > 0) { DAO.StudentFitnessRecord rec = lvFitnessList.SelectedItems[0].Tag as DAO.StudentFitnessRecord; if (FISCA.Presentation.Controls.MsgBox.Show("請問是否確定是刪除體適能紀錄?", "刪除體適能紀錄", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { K12.Data.StudentRecord studRec = K12.Data.Student.SelectByID(PrimaryKey); string studStr = "學號:" + studRec.StudentNumber + ",姓名:" + studRec.Name + ","; Log.LogTransfer LogTransfer = new Log.LogTransfer(); Utility.SetLogData(LogTransfer, rec); LogTransfer.SaveDeleteLog("學生.體適能-刪除", "刪除", studStr, "", "student", studRec.ID); DAO.StudentFitness.DeleteByRecord(rec); _BGRun(); } } else { FISCA.Presentation.Controls.MsgBox.Show("請選擇資料."); } }
/// <summary> /// 回傳2個學生的大小比較值(2013/9/2) /// </summary> static public int SortStudentDouble(K12.Data.StudentRecord sr1, K12.Data.StudentRecord sr2) { return(GetString(sr1).CompareTo(GetString(sr2))); }
void _BGWorker_DoWork(object sender, DoWorkEventArgs e) { // Get Photo _FreshmanPhotoStr = _GraduatePhotoStr = string.Empty; _FreshmanPhotoStr = K12.Data.Photo.SelectFreshmanPhoto(PrimaryKey); _GraduatePhotoStr = K12.Data.Photo.SelectGraduatePhoto(PrimaryKey); // studentRec _StudRec = K12.Data.Student.SelectByID(PrimaryKey); }
private void btnDel_Click(object sender, EventArgs e) { if (lvInterview.SelectedItems.Count > 0) { DAO.UDT_CounselStudentInterviewRecordDef studInterviewRec = lvInterview.SelectedItems[0].Tag as DAO.UDT_CounselStudentInterviewRecordDef; if (studInterviewRec != null) { DAO.LogTransfer logTransfer = new DAO.LogTransfer(); string teacherName = lvInterview.SelectedItems[0].SubItems[colTeacherID.Index].Text; K12.Data.StudentRecord studRec = K12.Data.Student.SelectByID(PrimaryKey); StringBuilder logData = new StringBuilder(); logData.AppendLine("刪除" + Utility.ConvertString1(studRec)); // 取得 XML 解析後 Dictionary <string, string> item_AttendessDict = Utility.GetConvertCounselXMLVal_Attendees(studInterviewRec.Attendees); Dictionary <string, string> item_CounselTypeDict = Utility.GetConvertCounselXMLVal_CounselType(studInterviewRec.CounselType); Dictionary <string, string> item_CounselTypeKindDict = Utility.GetConvertCounselXMLVal_CounselTypeKind(studInterviewRec.CounselTypeKind); if (FISCA.Presentation.Controls.MsgBox.Show("請問是否確定是刪除晤談紀錄?", "刪除晤談紀錄", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { // log logData.AppendLine("晤談老師:" + teacherName); logData.AppendLine("晤談對象:" + studInterviewRec.IntervieweeType); logData.AppendLine("晤談方式:" + studInterviewRec.InterviewType); if (studInterviewRec.InterviewDate.HasValue) { logData.AppendLine("日期:" + studInterviewRec.InterviewDate.Value.ToShortDateString()); } logData.AppendLine("時間:" + studInterviewRec.InterviewTime); logData.AppendLine("地點:" + studInterviewRec.Place); logData.AppendLine("晤談編號:" + studInterviewRec.InterviewNo); logData.AppendLine("晤談事由:" + studInterviewRec.Cause); logData.AppendLine("參與人員:"); foreach (KeyValuePair <string, string> data in item_AttendessDict) { if (!string.IsNullOrEmpty(data.Value)) { logData.AppendLine(data.Key + ":" + data.Value); } } logData.AppendLine("輔導方式:"); foreach (KeyValuePair <string, string> data in item_CounselTypeDict) { if (!string.IsNullOrEmpty(data.Value)) { logData.AppendLine(data.Key + ":" + data.Value); } } logData.AppendLine("輔導歸類:"); foreach (KeyValuePair <string, string> data in item_CounselTypeKindDict) { if (!string.IsNullOrEmpty(data.Value)) { logData.AppendLine(data.Key + ":" + data.Value); } } logData.AppendLine("內容要點:" + studInterviewRec.ContentDigest); logData.AppendLine("記錄者:" + studInterviewRec.AuthorID); logData.AppendLine("記錄者姓名:" + studInterviewRec.AuthorName); _UDTTransfer.DeleteCounselStudentInterviewRecord(studInterviewRec); logTransfer.SaveLog("學生.輔導晤談紀錄-刪除", "刪除", "student", PrimaryKey, logData); _BGRun(); } } } else { FISCA.Presentation.Controls.MsgBox.Show("請選擇資料."); } }
protected override void OnSaveButtonClick(EventArgs e) { Errors.Clear(); objStudent = K12.Data.Student.SelectByID(PrimaryKey); if (chkClassName() == false) { Errors.SetError(cboClass, "班級名稱錯誤!"); return; } int tmpSeatNo = 0; int.TryParse(cboSeatNo.Text, out tmpSeatNo); if (tmpSeatNo < 1 && cboSeatNo.Text.Trim() != "") { Errors.SetError(cboSeatNo, "學生座號錯誤!"); return; } // 檢查班級座號是否重複 if (tmpSeatNo > 0) if (_ClassSeatNoList.Contains(tmpSeatNo)) { // 是否是自己原本座號 if (this._DefaultSeatNo != cboSeatNo.Text.Trim()) { Errors.SetError(cboSeatNo, "座號重複!"); return; } } // 更改學生班級 if (_ClassNameIDDic.ContainsKey(cboClass.Text)) { objStudent.RefClassID = _ClassNameIDDic[cboClass.Text]; } // 當選空白時 if ((cboClass.Text == "" && cboSeatNo.Text == "") || cboClass.Text == "<空白>") { objStudent.RefClassID = null; } // 檢查學號是否重複 if (txtStudentNumber.Text != this._DefaultStudNum) { // 判斷是否是空 if (string.IsNullOrEmpty(txtStudentNumber.Text)) objStudent.StudentNumber = ""; else { // 取得目前學生狀態 K12.Data.StudentRecord.StudentStatus studtStatus = K12.Data.Student.SelectByID(PrimaryKey).Status; List<string> checkData = new List<string>(); // 同狀態下學號不能重複 foreach (K12.Data.StudentRecord studRec in K12.Data.Student.SelectAll()) if (studRec.Status == studtStatus) checkData.Add(studRec.StudentNumber); if (checkData.Contains(txtStudentNumber.Text)) { Errors.SetError(txtStudentNumber, "學號重複!"); return; } objStudent.StudentNumber = txtStudentNumber.Text; } } if (tmpSeatNo > 0) objStudent.SeatNo = tmpSeatNo; else objStudent.SeatNo = null; K12.Data.Student.Update(objStudent); SaveButtonVisible = false; CancelButtonVisible = false; prlp.SetAfterSaveText("班級", cboClass.Text); prlp.SetAfterSaveText("座號", cboSeatNo.Text); prlp.SetAfterSaveText("學號", txtStudentNumber.Text); prlp.SetActionBy("學籍", "學生班級資訊"); prlp.SetAction("修改學生班級資訊"); prlp.SetDescTitle("學生姓名:" + objStudent.Name + ",學號:" + objStudent.StudentNumber + ","); prlp.SaveLog("", "", "student", PrimaryKey); this._DefaultClassName = cboClass.Text; this._DefaultSeatNo = cboSeatNo.Text; this._DefaultStudNum = txtStudentNumber.Text; Student.Instance.SyncDataBackground(PrimaryKey); reloadChkdData(); }
private void ClassItem_Load(object sender, EventArgs e) { Errors = new EnhancedErrorProvider(); _ClassNameIDDic = new Dictionary<string, string>(); _ClassSeatNoList = new List<int>(); K12.Data.Student.AfterChange += new EventHandler<K12.Data.DataChangedEventArgs>(JHStudent_AfterChange); objStudent = K12.Data.Student.SelectByID(PrimaryKey); _AllClassRecs = K12.Data.Class.SelectAll(); _AllStudRecList = new List<K12.Data.StudentRecord>(); _studRecList = new List<K12.Data.StudentRecord>(); BGWork = new BackgroundWorker(); BGWork.DoWork += new DoWorkEventHandler(BGWork_DoWork); BGWork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGWork_RunWorkerCompleted); DataListener = new ChangeListener(); DataListener.Add(new TextBoxSource(txtStudentNumber)); DataListener.Add(new ComboBoxSource(cboClass, ComboBoxSource.ListenAttribute.Text)); DataListener.Add(new ComboBoxSource(cboSeatNo, ComboBoxSource.ListenAttribute.Text)); DataListener.StatusChanged += new EventHandler<ChangeEventArgs>(ValueManager_StatusChanged); prlp = new PermRecLogProcess(); if (!string.IsNullOrEmpty(PrimaryKey)) BGWork.RunWorkerAsync(); Disposed += new EventHandler(ClassItem_Disposed); }
void BGWork_DoWork(object sender, DoWorkEventArgs e) { _AllClassRecs.Clear(); _AllClassRecs = K12.Data.Class.SelectAll(); _AllStudRecList.Clear(); _AllStudRecList = K12.Data.Student.SelectAll(); _studRecList.Clear(); // 有條件加入一般狀態學生與有班級座號學生 foreach (K12.Data.StudentRecord studRec in _AllStudRecList) if (studRec.Class != null) if (studRec.Status == K12.Data.StudentRecord.StudentStatus.一般 && studRec.SeatNo.HasValue) _studRecList.Add(studRec); objStudent = K12.Data.Student.SelectByID(PrimaryKey); }
void _bgWorker_DoWork(object sender, DoWorkEventArgs e) { _HighConcernDict = UDTTransfer.GetHighConcernDictByStudentIDList(sidList); _StudRec = K12.Data.Student.SelectByID(PrimaryKey); }
private void btnDelete_Click(object sender, EventArgs e) { if (lvCaseMeeting.SelectedItems.Count == 1) { DAO.UDT_CounselCaseMeetingRecordDef CaseMeetingRecord = lvCaseMeeting.SelectedItems[0].Tag as DAO.UDT_CounselCaseMeetingRecordDef; if (CaseMeetingRecord != null) { DAO.LogTransfer logTransfer = new DAO.LogTransfer(); K12.Data.StudentRecord studRec = K12.Data.Student.SelectByID(PrimaryKey); StringBuilder logData = new StringBuilder(); logData.AppendLine("刪除" + Utility.ConvertString1(studRec)); // 取得 XML 解析後 Dictionary <string, string> item_AttendessDict = Utility.GetConvertCounselXMLVal_Attendees(CaseMeetingRecord.Attendees); Dictionary <string, string> item_CounselTypeDict = Utility.GetConvertCounselXMLVal_CounselType(CaseMeetingRecord.CounselType); Dictionary <string, string> item_CounselTypeKindDict = Utility.GetConvertCounselXMLVal_CounselTypeKind(CaseMeetingRecord.CounselTypeKind); if (FISCA.Presentation.Controls.MsgBox.Show("請問是否確定刪除個案會議?", "刪除個案會議", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { // log logData.AppendLine("個案編號:" + CaseMeetingRecord.CaseNo); if (CaseMeetingRecord.MeetingDate.HasValue) { logData.AppendLine("會議日期" + CaseMeetingRecord.MeetingDate.Value.ToShortDateString()); } K12.Data.TeacherRecord tRec = K12.Data.Teacher.SelectByID(CaseMeetingRecord.CounselTeacherID.ToString()); if (tRec != null) { if (string.IsNullOrEmpty(tRec.Nickname)) { logData.AppendLine("晤談老師:" + tRec.Name); } else { logData.AppendLine("晤談老師:" + tRec.Name + "(" + tRec.Nickname + ")"); } } logData.AppendLine("會議時間:" + CaseMeetingRecord.MeetigTime); logData.AppendLine("會議事由:" + CaseMeetingRecord.MeetingCause); logData.AppendLine("會議地點:" + CaseMeetingRecord.Place); logData.AppendLine("內容要點:" + CaseMeetingRecord.ContentDigest); logData.AppendLine("記錄者:" + CaseMeetingRecord.AuthorID); logData.AppendLine("記錄者姓名:" + CaseMeetingRecord.AuthorName); logData.AppendLine("參與人員:"); foreach (KeyValuePair <string, string> data in item_AttendessDict) { if (!string.IsNullOrEmpty(data.Value)) { logData.AppendLine(data.Key + ":" + data.Value); } } logData.AppendLine("輔導方式:"); foreach (KeyValuePair <string, string> data in item_CounselTypeDict) { if (!string.IsNullOrEmpty(data.Value)) { logData.AppendLine(data.Key + ":" + data.Value); } } logData.AppendLine("輔導歸類:"); foreach (KeyValuePair <string, string> data in item_CounselTypeKindDict) { if (!string.IsNullOrEmpty(data.Value)) { logData.AppendLine(data.Key + ":" + data.Value); } } _UDTTransfer.DeleteCaseMeetingRecord(CaseMeetingRecord); logTransfer.SaveLog("學生.輔導個案會議-刪除", "刪除", "student", PrimaryKey, logData); _BGRun(); } } } else { FISCA.Presentation.Controls.MsgBox.Show("請選擇資料."); } }