Ejemplo n.º 1
0
        private void LoadDALDataToForm()
        {
            if (_StudRec.Birthday.HasValue)
            {
                txtBirthDate.Text = _StudRec.Birthday.Value.ToShortDateString();
            }
            txtBirthPlace.Text  = _StudRec.BirthPlace;
            txtEngName.Text     = _StudRec.EnglishName;
            txtLoginID.Text     = _StudRec.SALoginName;
            txtLoginPwd.Text    = _StudRec.SAPassword;
            txtName.Text        = _StudRec.Name;
            txtSSN.Text         = _StudRec.IDNumber;
            cboAccountType.Text = _StudRec.AccountType;
            cboGender.Text      = _StudRec.Gender;
            cboNationality.Text = _StudRec.Nationality;
            // 解析
            try
            {
                pic1.Image = Photo.ConvertFromBase64Encoding(_FreshmanPhotoStr, pic1.Width, pic1.Height);
            }
            catch (Exception)
            {
                pic1.Image = pic1.InitialImage;
            }

            try
            {
                pic2.Image = Photo.ConvertFromBase64Encoding(_GraduatePhotoStr, pic2.Width, pic2.Height);
            }
            catch (Exception)
            {
                pic2.Image = pic2.InitialImage;
            }
        }
Ejemplo n.º 2
0
        // 載入資料到畫面
        private void DataBindToForm()
        {
            if (_TeacherRec == null)
            {
                _TeacherRec = new JHTeacherRecord();
            }

            _DataListener.SuspendListen();

            txtName.Text           = _TeacherRec.Name;
            txtIDNumber.Text       = _TeacherRec.IDNumber;
            cboGender.Text         = _TeacherRec.Gender;
            txtNickname.Text       = _TeacherRec.Nickname;
            txtPhone.Text          = _TeacherRec.ContactPhone;
            txtEmail.Text          = _TeacherRec.Email;
            txtCategory.Text       = _TeacherRec.Category;
            txtSTLoginAccount.Text = _TeacherRec.TALoginName;
            txtSTLoginPwd.Text     = _TeacherRec.TAPassword;
            cboAccountType.Text    = _TeacherRec.AccountType;
            txtTeacherNumber.Text  = _TeacherRec.TeacherNumber;


            try
            {
                pic1.Image = Photo.ConvertFromBase64Encoding(_TeacherRec.Photo, pic1.Width, pic1.Height);
            }
            catch (Exception)
            {
                pic1.Image = pic1.InitialImage;
            }



            // Log
            prlp.SetBeforeSaveText("姓名", txtName.Text);
            prlp.SetBeforeSaveText("身分證號", txtIDNumber.Text);
            prlp.SetBeforeSaveText("性別", cboGender.Text);
            prlp.SetBeforeSaveText("暱稱", txtNickname.Text);
            prlp.SetBeforeSaveText("聯絡電話", txtPhone.Text);
            prlp.SetBeforeSaveText("電子信箱", txtEmail.Text);
            prlp.SetBeforeSaveText("教師類別", txtCategory.Text);
            prlp.SetBeforeSaveText("登入帳號", txtSTLoginAccount.Text);
            prlp.SetBeforeSaveText("登入密碼", txtSTLoginPwd.Text);
            prlp.SetBeforeSaveText("帳號類型", cboAccountType.Text);
            prlp.SetBeforeSaveText("教師編號", txtTeacherNumber.Text);
            this.Loading        = false;
            SaveButtonVisible   = false;
            CancelButtonVisible = false;
            _DataListener.Reset();
            _DataListener.ResumeListen();
        }
Ejemplo n.º 3
0
        private void LoadDALDataToForm()
        {
            if (_StudRec.Birthday.HasValue)
            {
                txtBirthDate.Text = _StudRec.Birthday.Value.ToShortDateString();
            }
            txtBirthPlace.Text  = _StudRec.BirthPlace;
            txtEngName.Text     = _StudRec.EnglishName;
            txtLoginID.Text     = _StudRec.SALoginName;
            txtLoginPwd.Text    = _StudRec.SAPassword;
            txtName.Text        = _StudRec.Name;
            txtSSN.Text         = _StudRec.IDNumber;
            cboAccountType.Text = _StudRec.AccountType;
            cboGender.Text      = _StudRec.Gender;
            cboNationality.Text = _StudRec.Nationality;

            txtChineseName.Text    = _StudRec_Ext.Nickname;
            txtPassportNumber.Text = _StudRec_Ext.PassportNumber;
            txtEntranceDate.Text   = _StudRec_Ext.EntranceDate.HasValue ? _StudRec_Ext.EntranceDate.Value.ToShortDateString() : "";
            txtLeavingDate.Text    = _StudRec_Ext.LeavingDate.HasValue ? _StudRec_Ext.LeavingDate.Value.ToShortDateString() : "";

            txtGivenName.Text  = _StudRec_Ext.GivenName;
            txtMiddleName.Text = _StudRec_Ext.MiddleName;
            txtFamilyName.Text = _StudRec_Ext.FamilyName;

            // 解析
            try
            {
                pic1.Image = Photo.ConvertFromBase64Encoding(_FreshmanPhotoStr, pic1.Width, pic1.Height);
            }
            catch (Exception)
            {
                pic1.Image = pic1.InitialImage;
            }

            try
            {
                pic2.Image = Photo.ConvertFromBase64Encoding(_GraduatePhotoStr, pic2.Width, pic2.Height);
            }
            catch (Exception)
            {
                pic2.Image = pic2.InitialImage;
            }
        }
Ejemplo n.º 4
0
        private void LoadDALDataToForm()
        {
            //2017/4/19 穎驊新增  尚未載入完畢,避免觸發cboNationality_TextChanged()
            load_completed = false;

            if (_StudRec.Birthday.HasValue)
            {
                txtBirthDate.Text = _StudRec.Birthday.Value.ToShortDateString();
            }
            txtBirthPlace.Text  = _StudRec.BirthPlace;
            txtEngName.Text     = _StudRec.EnglishName;
            txtLoginID.Text     = _StudRec.SALoginName;
            txtLoginPwd.Text    = _StudRec.SAPassword;
            txtName.Text        = _StudRec.Name;
            txtSSN.Text         = _StudRec.IDNumber;
            cboAccountType.Text = _StudRec.AccountType;
            cboGender.Text      = _StudRec.Gender;
            cboNationality.Text = _StudRec.Nationality;
            txtEmail.Text       = _StudRec.EMail;
            //2017/4/19 穎驊新增 記錄原原國籍,作為與新輸入比較使用
            cboNationality_ori = _StudRec.Nationality;
            // 解析
            try
            {
                pic1.Image = Photo.ConvertFromBase64Encoding(_FreshmanPhotoStr, pic1.Width, pic1.Height);
            }
            catch (Exception)
            {
                pic1.Image = pic1.InitialImage;
            }

            try
            {
                pic2.Image = Photo.ConvertFromBase64Encoding(_GraduatePhotoStr, pic2.Width, pic2.Height);
            }
            catch (Exception)
            {
                pic2.Image = pic2.InitialImage;
            }

            load_completed = true;
        }