private string transferInConfigKey = "TransferInReason"; //紀錄轉入原因清單的組態值的Key public UpdateRecordInfo03(DAL.StudUpdateRecordEntity sure) { InitializeComponent(); Errors = new EnhancedErrorProvider(); // 設定男、女值與設定只能選不能修改 cboGender.Items.Add("男"); cboGender.Items.Add("女"); cd = JHSchool.School.Configuration[updateConfigKey]; if (!cd.Contains(transferInConfigKey)) { cd[transferInConfigKey] = "遷居;安置;其他"; cd.Save(); } string[] reasons = cd[transferInConfigKey].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); List <string> reasonList = new List <string>(reasons); foreach (string reason in reasons) { this.cboUpdateDescription.Items.Add(reason); } foreach (string defaultReason in new string[] { "遷居", "安置", "其他" }) { if (!reasonList.Contains(defaultReason)) { this.cboUpdateDescription.Items.Add(defaultReason); } } _StudUpdateRecordEntity = sure; SetUpdateRecordInfoToForm(); }
public UpdateRecordInfo01(DAL.StudUpdateRecordEntity sure) { InitializeComponent(); // 設定男、女值與設定只能選不能修改 cboGender.Items.Add("男"); cboGender.Items.Add("女"); cboGender.DropDownStyle = ComboBoxStyle.DropDownList; _StudUpdateRecordEntity = sure; SetUpdateRecordInfoToForm(); }
private string transferOutConfigKey = "TransferOutReason"; //紀錄轉入原因清單的組態值的Key public UpdateRecordInfo04(DAL.StudUpdateRecordEntity sure) { InitializeComponent(); if (JHSchool.Permrec.Program.ModuleType == JHSchool.Permrec.Program.ModuleFlag.KaoHsiung) { labelX6.Text = "遷出地址"; } Errors = new EnhancedErrorProvider(); // 設定男、女值與設定只能選不能修改 cboGender.Items.Add("男"); cboGender.Items.Add("女"); cboGender.DropDownStyle = ComboBoxStyle.DropDownList; //將轉入紀錄清單的key輸入至list cd中 cd = JHSchool.School.Configuration[updateConfigKey]; if (!cd.Contains(transferOutConfigKey)) { cd[transferOutConfigKey] = "遷居;出國;其他"; cd.Save(); } string[] reasons = cd[transferOutConfigKey].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); List <string> reasonList = new List <string>(reasons); foreach (string reason in reasons) { this.cboUpdateDescription.Items.Add(reason); } foreach (string defaultreason in new string[] { "遷居", "出國", "其他" }) { if (!reasonList.Contains(defaultreason)) { this.cboUpdateDescription.Items.Add(defaultreason); } } //將cdlist拆成由char所組成的,最後加入畫面之中 //string[] reasons = cd[transferOutConfigKey].Split(new char[] { ';' }); //foreach (string reason in reasons) // { // this.cboUpdateDescription.Items.Add(reason); //} _StudUpdateRecordEntity = sure; SetUpdateRecordInfoToForm(); }
private string SuspensionConfigKey = "SuspensionReason"; //紀錄休學原因清單的組態值的Key public UpdateRecordInfo05(DAL.StudUpdateRecordEntity sure) { InitializeComponent(); Errors = new EnhancedErrorProvider(); // 設定男、女值與設定只能選不能修改 cboGender.Items.Add("男"); cboGender.Items.Add("女"); cboGender.DropDownStyle = ComboBoxStyle.DropDownList; //將休學紀錄清單的key輸入至list cd中 cd = JHSchool.School.Configuration[updateConfigKey]; if (!cd.Contains(SuspensionConfigKey)) { cd[SuspensionConfigKey] = "因病;出國"; cd.Save(); } string[] reasons = cd[SuspensionConfigKey].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); List <string> reasonList = new List <string>(reasons); if (reasonList.Contains("其他")) { reasonList.Remove("其他"); } if (reasonList.Contains("死亡")) { reasonList.Remove("死亡"); } foreach (string defaultreason in new string[] { "因病", "出國" }) { if (!reasonList.Contains(defaultreason)) { reasonList.Add(defaultreason); } } foreach (string name in reasonList) { this.cboUpdateDescription.Items.Add(name); } _StudUpdateRecordEntity = sure; SetUpdateRecordInfoToForm(); }
private string ExtendingConfigKey = "ExtendingReason10"; //紀錄中輟原因清單的組態值的Key //將中輟紀錄清單的key輸入至list cd中 public UpdateRecordInfo10(DAL.StudUpdateRecordEntity sure) { InitializeComponent(); Errors = new EnhancedErrorProvider(); // 設定男、女值與設定只能選不能修改 cboGender.Items.Add("男"); cboGender.Items.Add("女"); cboGender.DropDownStyle = ComboBoxStyle.DropDownList; cd = JHSchool.School.Configuration[updateConfigKey]; if (!cd.Contains(ExtendingConfigKey)) { cd[ExtendingConfigKey] = "因病;出國;其它"; cd.Save(); } string[] reasons = cd[ExtendingConfigKey].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); List <string> reasonList = new List <string>(reasons); foreach (string reason in reasons) { if (reason == "死亡") { continue; } this.cboUpdateDescription.Items.Add(reason); } foreach (string defaultreason in new string[] { "因病", "出國", "其它" }) { if (!reasonList.Contains(defaultreason)) { this.cboUpdateDescription.Items.Add(defaultreason); } } _StudUpdateRecordEntity = sure; SetUpdateRecordInfoToForm(); }
private void btnNext_Click(object sender, EventArgs e) { // 驗證身份證號 if (!string.IsNullOrEmpty(txtNewIDNumber.Text)) { if (StudCheckTool.CheckStudIDNumberSame(txtNewIDNumber.Text, _StudentID)) { FISCA.Presentation.Controls.MsgBox.Show("身分證號重覆請檢查."); return; } } // 呼叫異動並帶入相對資料 DAL.StudUpdateRecordEntity sure = DAL.DALTransfer2.AddStudUpdateRecordEntity(_StudentID, JHPermrec.UpdateRecord.DAL.DALTransfer2.UpdateType.更正學籍, DateTime.Now.ToShortDateString()); if (isNameEnable) { sure.SetNewName(txtNewName.Text); } if (isIDNumberEnable) { sure.SetNewIDNumber(txtNewIDNumber.Text); } if (isBirthdayEnable) { sure.SetNewBirthday(dtNewBirthday.Text); } if (isGenderEnable) { sure.SetNewGender(cboNewGender.Text); } if (sure == null) { return; } UpdateRecordItemForm form = new UpdateRecordItemForm(UpdateRecordItemForm.actMode.修改, sure, _StudentID); form.StartPosition = FormStartPosition.CenterParent; this.Hide(); this.Close(); this.Location = new Point(-100, -100); form.ShowDialog(FISCA.Presentation.MotherForm.Form); // 當使用這按確定 if (form.DialogResult == DialogResult.OK) { // Log JHSchool.PermRecLogProcess prlp = new JHSchool.PermRecLogProcess(); prlp.SetBeforeSaveText("姓名", sure.GetName()); prlp.SetBeforeSaveText("身分證號", sure.GetIDNumber()); if (sure.GetBirthday().HasValue) { prlp.SetBeforeSaveText("生日", sure.GetBirthday().Value.ToShortDateString()); } prlp.SetBeforeSaveText("性別", sure.GetGender()); JHSchool.Data.JHStudentRecord studRec = JHSchool.Data.JHStudent.SelectByID(_StudentID); // 更正資料 if (isNameEnable && string.IsNullOrEmpty(sure.GetNewName()) == false) { studRec.Name = sure.GetNewName(); } if (isIDNumberEnable && string.IsNullOrEmpty(sure.GetNewIDNumber()) == false) { studRec.IDNumber = sure.GetNewIDNumber(); } if (isBirthdayEnable && sure.GetNewBirthday().HasValue) { studRec.Birthday = sure.GetNewBirthday(); } if (isGenderEnable && string.IsNullOrEmpty(sure.GetNewGender()) == false) { studRec.Gender = sure.GetNewGender(); } if (isNameEnable == true || isIDNumberEnable == true || isBirthdayEnable == true || isGenderEnable == true) { JHSchool.Data.JHStudent.Update(studRec); JHSchool.Student.Instance.SyncAllBackground(); } prlp.SetAfterSaveText("姓名", studRec.Name); prlp.SetAfterSaveText("身分證號", studRec.IDNumber); if (studRec.Birthday.HasValue) { prlp.SetAfterSaveText("生日", studRec.Birthday.Value.ToShortDateString()); } prlp.SetAfterSaveText("性別", studRec.Gender); prlp.SetActionBy("學生學籍", "學生更正學籍功能"); prlp.SetDescTitle("學生姓名:" + sure.GetName() + ",更改資料:"); prlp.SaveLog("", "", "student", _StudentID); this.Close(); } //else //form.Dispose(); }
public AddTransStudUpdateRecord(JHSchool.Data.JHStudentRecord studEntity) { InitializeComponent(); // 取得原理:當有同一天轉入異動,帶入同一筆,如果沒有新增一筆。 bool checkNoTodayUrData = true; // 取得 StudUpdateRecordEntityList List <DAL.StudUpdateRecordEntity> sureList = DAL.DALTransfer2.GetStudUpdateRecordEntityListByUpdateType(studEntity.ID, JHPermrec.UpdateRecord.DAL.DALTransfer2.UpdateType.轉入); foreach (DAL.StudUpdateRecordEntity sure in sureList) { if (sure.GetUpdateDate().HasValue) { if (sure.GetUpdateDate().Value.ToShortDateString() == DateTime.Now.ToShortDateString()) { _StudUpdateRecordEntity = sure; checkNoTodayUrData = false; } } } if (checkNoTodayUrData) { _StudUpdateRecordEntity = DAL.DALTransfer2.AddStudUpdateRecordEntity(studEntity.ID, JHPermrec.UpdateRecord.DAL.DALTransfer2.UpdateType.轉入, DateTime.Now.ToShortDateString()); txtClass.Text = _StudUpdateRecordEntity.GetClassName(); txtName.Text = _StudUpdateRecordEntity.GetName(); txtStudentNumber.Text = _StudUpdateRecordEntity.GetStudentNumber(); txtSeatNo.Text = _StudUpdateRecordEntity.GetSeatNo(); txtIDNumber.Text = _StudUpdateRecordEntity.GetIDNumber(); cboGender.Text = _StudUpdateRecordEntity.GetGender(); if (_StudUpdateRecordEntity.GetBirthday().HasValue) { dtBirthday.Value = _StudUpdateRecordEntity.GetBirthday().Value; } else { dtBirthday.IsEmpty = true; }; dtUpdateDate.Text = DateTime.Now.ToString(); txtAddress.Text = _StudUpdateRecordEntity.GetAddress(); // cboUpdateDescription.Items.AddRange(new string[] { "遷居", "安置", "其他" }); } else { if (_StudUpdateRecordEntity.GetUpdateDate().HasValue) { dtUpdateDate.Value = _StudUpdateRecordEntity.GetUpdateDate().Value; } else { dtUpdateDate.IsEmpty = true; } if (_StudUpdateRecordEntity.GetADDate().HasValue) { dtADDate.Value = _StudUpdateRecordEntity.GetADDate().Value; } else { dtADDate.IsEmpty = true; } txtComment.Text = _StudUpdateRecordEntity.GetComment(); txtClass.Text = _StudUpdateRecordEntity.GetClassName(); txtAddress.Text = _StudUpdateRecordEntity.GetAddress(); txtSeatNo.Text = _StudUpdateRecordEntity.GetSeatNo(); txtExportSchool.Text = _StudUpdateRecordEntity.GetImportExportSchool(); if (_StudUpdateRecordEntity.GetLastADDate().HasValue) { dtLastADDate.Value = _StudUpdateRecordEntity.GetLastADDate().Value; } else { dtLastADDate.IsEmpty = true; } txtLastADNumber.Text = _StudUpdateRecordEntity.GetLastADNumber(); txtName.Text = _StudUpdateRecordEntity.GetName(); txtIDNumber.Text = _StudUpdateRecordEntity.GetIDNumber(); txtStudentNumber.Text = _StudUpdateRecordEntity.GetStudentNumber(); cboGender.Text = _StudUpdateRecordEntity.GetGender(); if (_StudUpdateRecordEntity.GetBirthday().HasValue) { dtBirthday.Value = _StudUpdateRecordEntity.GetBirthday().Value; } else { dtBirthday.IsEmpty = true; } txtADNumber.Text = _StudUpdateRecordEntity.GetADNumber(); cboUpdateDescription.Text = _StudUpdateRecordEntity.GetUpdateDescription(); } cboUpdateDescription.Items.AddRange(new string[] { "遷居", "安置", "其他" }); chkNextYes.Checked = true; AddTransBackgroundManager.AddTransStudUpdateRecordObj = this; }