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);
        }
Example #3
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;
        }