private void SetUpdateRecordInfoToForm()
        {
            if (_StudUpdateRecordEntity.GetUpdateDate().HasValue)
            {
                dtUpdateDate.Value = _StudUpdateRecordEntity.GetUpdateDate().Value;
            }
            else
            {
                dtUpdateDate.IsEmpty = true;
            }
            txtComment.Text        = _StudUpdateRecordEntity.GetComment();
            txtGraduateSchool.Text = _StudUpdateRecordEntity.GetGraduateSchool();
            txtClass.Text          = _StudUpdateRecordEntity.GetClassName();
            txtAddress.Text        = _StudUpdateRecordEntity.GetAddress();
            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;
            }
            if (_StudUpdateRecordEntity.GetADDate().HasValue)
            {
                dtADDate.Value = _StudUpdateRecordEntity.GetADDate().Value;
            }
            else
            {
                dtADDate.IsEmpty = true;
            }

            txtADNumber.Text             = _StudUpdateRecordEntity.GetADNumber();
            txtEnrollmentSchoolYear.Text = _StudUpdateRecordEntity.GetEnrollmentSchoolYear();

            // 記 log --
            UpdateRecordItemForm.prlp.SetBeforeSaveText("異動日期", dtUpdateDate.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("入學年月", txtEnrollmentSchoolYear.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("備註", txtComment.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("畢業國小", txtGraduateSchool.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("班級", txtClass.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("姓名", txtName.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("身分證號", txtIDNumber.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("學號", txtStudentNumber.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("性別", cboGender.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("生日", dtBirthday.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("地址", txtAddress.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("核准日期", dtADDate.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("核准文號", txtADNumber.Text);
        }
        private void SetUpdateRecordInfoToForm()
        {
            if (_StudUpdateRecordEntity.GetUpdateDate().HasValue)
            {
                dtUpdateDate.Value = _StudUpdateRecordEntity.GetUpdateDate().Value;
            }
            else
            {
                dtUpdateDate.IsEmpty = true;
            }

            txtComment.Text       = _StudUpdateRecordEntity.GetComment();
            txtClass.Text         = _StudUpdateRecordEntity.GetClassName();
            txtAddress.Text       = _StudUpdateRecordEntity.GetAddress();
            txtSeatNo.Text        = _StudUpdateRecordEntity.GetSeatNo();
            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;
            }

            txtImportSchool.Text = _StudUpdateRecordEntity.GetImportExportSchool();

            if (_StudUpdateRecordEntity.GetLastADDate().HasValue)
            {
                dtLastADDate.Value = _StudUpdateRecordEntity.GetLastADDate().Value;
            }
            else
            {
                dtLastADDate.IsEmpty = true;
            }

            txtLastADNumber.Text = _StudUpdateRecordEntity.GetLastADNumber();

            if (_StudUpdateRecordEntity.GetADDate().HasValue)
            {
                dtADDate.Value = _StudUpdateRecordEntity.GetADDate().Value;
            }
            else
            {
                dtADDate.IsEmpty = true;
            }

            txtADNumber.Text          = _StudUpdateRecordEntity.GetADNumber();
            cboUpdateDescription.Text = _StudUpdateRecordEntity.GetUpdateDescription();

            // 記 log --
            UpdateRecordItemForm.prlp.SetBeforeSaveText("異動日期", dtUpdateDate.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("備註", txtComment.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("班級", txtClass.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("姓名", txtName.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("身分證號", txtIDNumber.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("學號", txtStudentNumber.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("性別", cboGender.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("生日", dtBirthday.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("地址", txtAddress.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("核准日期", dtADDate.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("核准文號", txtADNumber.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("異動原因", cboUpdateDescription.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("學籍核准日期", dtLastADDate.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("學籍核准文號", txtLastADNumber.Text);
            UpdateRecordItemForm.prlp.SetBeforeSaveText("座號", txtSeatNo.Text);
        }
Exemple #3
0
        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();
        }
Exemple #4
0
        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;
        }