Пример #1
0
        private void DisplayRecord(JHCourseRecord record)
        {
            Enabled = (record != null);
            if (!Enabled)
            {
                return;
            }

            Errors.Clear();
            if (record != null)
            {
                if (record.CalculationFlag == "1")
                {
                    rdoCalcTrue.Checked = true;
                }
                //else if (record.CalculationFlag == "2")
                else if (record.CalculationFlag == "2" || record.CalculationFlag == "")
                {
                    rdoCalcFalse.Checked = true;
                }
            }
            JHAssessmentSetupRecord ass = JHAssessmentSetup.SelectByID(record.RefAssessmentSetupID);

            if (ass != null)
            {
                cboAssessmentSetup.Text = ass.Name;
            }
            else
            {
                cboAssessmentSetup.SelectedItem = NoScoreItem;
            }
        }
        //private Template CreateTemplateObject(XmlElement templateData)
        //{
        //    Template item;
        //    string id = templateData.GetAttribute("ID");
        //    string name = templateData.SelectSingleNode("TemplateName").InnerText;

        //    item = new Template(id, name);
        //    item.AllowUpload = templateData.SelectSingleNode("AllowUpload").InnerText;
        //    item.StartTime = DateToDisplayFormat(templateData.SelectSingleNode("StartTime").InnerText);
        //    item.EndTime = DateToDisplayFormat(templateData.SelectSingleNode("EndTime").InnerText);

        //    item.OptionGroup = "TemplateItems";
        //    item.Click += new EventHandler(Template_Click);
        //    item.DoubleClick += new EventHandler(Template_DoubleClick);
        //    return item;
        //}

        //private _Exam CreateExamObject(XmlElement each)
        //{
        //    _Exam item = new _Exam();
        //    item.Identity = each.SelectSingleNode("@ID").InnerText;
        //    item.TemplateID = each.SelectSingleNode("ExamTemplateID").InnerText;
        //    item.ExamID = each.SelectSingleNode("RefExamID").InnerText;
        //    item.OpenTeacherAccess = each.SelectSingleNode("OpenTeacherAccess").InnerText;
        //    item.StartTime = DateToDisplayFormat(each.SelectSingleNode("StartTime").InnerText);
        //    item.EndTime = DateToDisplayFormat(each.SelectSingleNode("EndTime").InnerText);
        //    item.UseScore = each.SelectSingleNode("UseScore").InnerText;
        //    item.UseText = each.SelectSingleNode("UseText").InnerText;
        //    item.Weight = each.SelectSingleNode("Weight").InnerText;
        //    item.InputRequired = each.SelectSingleNode("InputRequired").InnerText;

        //    return item;
        //}

        private void ResetDirty()
        {
            foreach (DataGridViewRow row in dataview.Rows)
            {
                foreach (DataGridViewCell cell in row.Cells)
                {
                    cell.Tag = cell.Value;
                }
            }
            //cboScoreSource.Tag = cboScoreSource.SelectedIndex;
            //txtStartTime.Tag = txtStartTime.Text;
            //txtEndTime.Tag = txtEndTime.Text;

            _has_deleted = false;
            _errors.Clear();

            if (CurrentItem == null)
            {
                peTemplateName1.Text = string.Empty;
            }
            else
            {
                peTemplateName1.Text = CurrentItem.Text;
            }

            ipt01.Tag = ipt01.Text;
        }
Пример #3
0
        //void _getClassBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        //{
        //    if ("" + e.Result != _WaitToGetClass)
        //    {
        //        GetGradeYearClassList(_WaitToGetClass);
        //    }
        //    else
        //    {
        //        foreach (string key in classList.Keys)
        //        {
        //            cboClass.AddItem(key, classList[key]);
        //        }
        //        //cboClass.SetComboBoxValue(test);

        //    }
        //}

        //void _getClassBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        //{
        //    string gradeyearID = e.Argument as string;
        //    classList = Class.GetClassListByGradeYear(gradeyearID);
        //    e.Result = gradeyearID;
        //}

        private void Initialize()
        {
            warnings.Clear();
            _errors.Clear();

            //年級
            //cboGradeYear.SelectedItem = null;
            //cboGradeYear.Items.Clear();
            //cboGradeYear.AddItem("", "");
            //cboGradeYear.AddItem("1", "一年級");
            //cboGradeYear.AddItem("2", "二年級");
            //cboGradeYear.AddItem("3", "三年級");
            //cboGradeYear.AddItem("4", "四年級");



            if (_isInitialized)
            {
                return;
            }

            //科別
            // 2008/04/30 黃耀明
            //DSResponse dsrsp = SmartSchool.Feature.Basic.Config.GetDepartment();
            //foreach (XmlNode node in dsrsp.GetContent().GetElements("Department"))
            //{
            //    cboDept.AddItem(node.SelectSingleNode("@ID").InnerText, node.SelectSingleNode("Name").InnerText);
            //}
            foreach (DepartmentRecord dept in Department.Instance.Items)
            {
                cboDept.AddItem(dept.ID, dept.FullName);
            }

            _isInitialized = true;
        }
Пример #4
0
        private void Initialize()
        {
            _errors.Clear();
            _warnings.Clear();

            if (_isInitialized)
            {
                return;
            }

            _isInitialized = true;
        }
Пример #5
0
        protected override void OnSaveButtonClick(EventArgs e)
        {
            //// 當輸入沒有 鄰自動補
            //if (!string.IsNullOrEmpty(txtArea.Text))
            //{
            //    if (txtArea.Text.IndexOf("鄰") == -1)
            //        txtArea.Text += "鄰";
            //}

            // 檢查畫面儲存相對應
            if (_address_type == AddressType.Permanent)
            {
                _StudAddressRec.Permanent.ZipCode   = txtZipcode.Text;
                _StudAddressRec.Permanent.County    = cboCounty.Text;
                _StudAddressRec.Permanent.Town      = cboTown.Text;
                _StudAddressRec.Permanent.District  = txtDistrict.Text;
                _StudAddressRec.Permanent.Area      = txtArea.Text;
                _StudAddressRec.Permanent.Detail    = txtDetail.Text;
                _StudAddressRec.Permanent.Longitude = txtLongtitude.Text;
                _StudAddressRec.Permanent.Latitude  = txtLatitude.Text;
            }

            if (_address_type == AddressType.Mailing)
            {
                _StudAddressRec.Mailing.ZipCode   = txtZipcode.Text;
                _StudAddressRec.Mailing.County    = cboCounty.Text;
                _StudAddressRec.Mailing.Town      = cboTown.Text;
                _StudAddressRec.Mailing.District  = txtDistrict.Text;
                _StudAddressRec.Mailing.Area      = txtArea.Text;
                _StudAddressRec.Mailing.Detail    = txtDetail.Text;
                _StudAddressRec.Mailing.Longitude = txtLongtitude.Text;
                _StudAddressRec.Mailing.Latitude  = txtLatitude.Text;
            }

            if (_address_type == AddressType.Other)
            {
                _StudAddressRec.Address1.ZipCode   = txtZipcode.Text;
                _StudAddressRec.Address1.County    = cboCounty.Text;
                _StudAddressRec.Address1.Town      = cboTown.Text;
                _StudAddressRec.Address1.District  = txtDistrict.Text;
                _StudAddressRec.Address1.Area      = txtArea.Text;
                _StudAddressRec.Address1.Detail    = txtDetail.Text;
                _StudAddressRec.Address1.Longitude = txtLongtitude.Text;
                _StudAddressRec.Address1.Latitude  = txtLatitude.Text;
            }

            prlp.SetAfterSaveText("戶籍郵遞區號", _StudAddressRec.Permanent.ZipCode);
            prlp.SetAfterSaveText("戶籍縣市", _StudAddressRec.Permanent.County);
            prlp.SetAfterSaveText("戶籍鄉鎮市區", _StudAddressRec.Permanent.Town);
            prlp.SetAfterSaveText("戶籍村里", _StudAddressRec.Permanent.District);
            prlp.SetAfterSaveText("戶籍鄰", _StudAddressRec.Permanent.Area);
            prlp.SetAfterSaveText("戶籍其它地址", _StudAddressRec.Permanent.Detail);
            prlp.SetAfterSaveText("戶籍經度", _StudAddressRec.Permanent.Longitude);
            prlp.SetAfterSaveText("戶籍緯度", _StudAddressRec.Permanent.Latitude);
            prlp.SetAfterSaveText("聯絡郵遞區號", _StudAddressRec.Mailing.ZipCode);
            prlp.SetAfterSaveText("聯絡縣市", _StudAddressRec.Mailing.County);
            prlp.SetAfterSaveText("聯絡鄉鎮市區", _StudAddressRec.Mailing.Town);
            prlp.SetAfterSaveText("聯絡村里", _StudAddressRec.Mailing.District);
            prlp.SetAfterSaveText("聯絡鄰", _StudAddressRec.Mailing.Area);
            prlp.SetAfterSaveText("聯絡其它地址", _StudAddressRec.Mailing.Detail);
            prlp.SetAfterSaveText("聯絡經度", _StudAddressRec.Mailing.Longitude);
            prlp.SetAfterSaveText("聯絡緯度", _StudAddressRec.Mailing.Latitude);
            prlp.SetAfterSaveText("其它郵遞區號", _StudAddressRec.Address1.ZipCode);
            prlp.SetAfterSaveText("其它縣市", _StudAddressRec.Address1.County);
            prlp.SetAfterSaveText("其它鄉鎮市區", _StudAddressRec.Address1.Town);
            prlp.SetAfterSaveText("其它村里", _StudAddressRec.Address1.District);
            prlp.SetAfterSaveText("其它鄰", _StudAddressRec.Address1.Area);
            prlp.SetAfterSaveText("其它其它地址", _StudAddressRec.Address1.Detail);
            prlp.SetAfterSaveText("其它經度", _StudAddressRec.Address1.Longitude);
            prlp.SetAfterSaveText("其它緯度", _StudAddressRec.Address1.Latitude);

            _errors.Clear();
            JHAddress.Update(_StudAddressRec);
            prlp.SetActionBy("學籍", "學生地址資訊");
            prlp.SetAction("修改學生地址資訊");
            JHStudentRecord studRec = JHStudent.SelectByID(PrimaryKey);

            prlp.SetDescTitle("學生姓名:" + studRec.Name + ",學號:" + studRec.StudentNumber + ",");
            prlp.SaveLog("", "", "student", PrimaryKey);
            BindDataToForm();
        }
Пример #6
0
        protected override void OnSaveButtonClick(EventArgs e)
        {
            SetFormDataToDALRec();

            // 檢查生日


            // 檢查性別
            List <string> checkGender = new List <string>();

            checkGender.Add("男");
            checkGender.Add("");
            checkGender.Add("女");

            if (!checkGender.Contains(cboGender.Text))
            {
                _errors.SetError(cboGender, "性別錯誤,請確認資料。");
                return;
            }

            DateTime dt;

            if (!string.IsNullOrEmpty(txtBirthDate.Text))
            {
                if (!DateTime.TryParse(txtBirthDate.Text, out dt))
                {
                    _errors.SetError(txtBirthDate, "日期錯誤,請確認資料。");
                    return;
                }
            }
            else
            {
                _StudRec.Birthday = null;
            }

            List <string> checkID  = new List <string>();
            List <string> checkSSN = new List <string>();


            foreach (JHStudentRecord studRec in JHStudent.SelectAll())
            {
                checkID.Add(studRec.SALoginName);
                checkSSN.Add(studRec.IDNumber);
            }
            if (!string.IsNullOrEmpty(_StudRec.SALoginName))
            {
                if (checkID.Contains(_StudRec.SALoginName))
                {
                    if (_defaultLoginID != _StudRec.SALoginName)
                    {
                        _errors.SetError(txtLoginID, "學生登入帳號重覆,請確認資料。");
                        return;
                    }
                }
            }
            if (!string.IsNullOrEmpty(_StudRec.IDNumber))
            {
                if (checkSSN.Contains(_StudRec.IDNumber))
                {
                    if (_defaultIDNumber != _StudRec.IDNumber)
                    {
                        _errors.SetError(txtSSN, "身分證號重覆,請確認資料。");
                        return;
                    }
                }
            }

            JHStudent.Update(_StudRec);
            SetAfterEditLog();
            Student.Instance.SyncDataBackground(PrimaryKey);
            _errors.Clear();
            //BindDataToForm();
        }
Пример #7
0
        protected override void OnSaveButtonClick(EventArgs e)
        {
            DateTime dt;

            //入學日期檢查
            if (!string.IsNullOrEmpty(txtEntranceDate.Text))
            {
                if (DateTime.TryParse(txtEntranceDate.Text, out dt))
                {
                    _errors.SetError(txtEntranceDate, string.Empty);
                }
                else
                {
                    _errors.SetError(txtEntranceDate, "入學日期錯誤,請確認資料。");
                    return;
                }
            }

            //離校日期檢查
            if (!string.IsNullOrEmpty(txtLeavingDate.Text))
            {
                if (DateTime.TryParse(txtLeavingDate.Text, out dt))
                {
                    _errors.SetError(txtLeavingDate, string.Empty);
                }
                else
                {
                    _errors.SetError(txtLeavingDate, "離校日期錯誤,請確認資料。");
                    return;
                }
            }

            SetFormDataToDALRec();

            // 檢查生日


            // 檢查性別
            List <string> checkGender = new List <string>();

            checkGender.Add("男");
            checkGender.Add("");
            checkGender.Add("女");

            if (!checkGender.Contains(cboGender.Text))
            {
                _errors.SetError(cboGender, "性別錯誤,請確認資料。");
                return;
            }

            //DateTime dt;

            if (!string.IsNullOrEmpty(txtBirthDate.Text))
            {
                if (!DateTime.TryParse(txtBirthDate.Text, out dt))
                {
                    _errors.SetError(txtBirthDate, "日期錯誤,請確認資料。");
                    return;
                }
            }
            else
            {
                _StudRec.Birthday = null;
            }

            List <string> checkID  = new List <string>();
            List <string> checkSSN = new List <string>();


            foreach (JHStudentRecord studRec in JHStudent.SelectAll())
            {
                checkID.Add(studRec.SALoginName);
                checkSSN.Add(studRec.IDNumber);
            }
            if (!string.IsNullOrEmpty(_StudRec.SALoginName))
            {
                if (checkID.Contains(_StudRec.SALoginName))
                {
                    if (_defaultLoginID != _StudRec.SALoginName)
                    {
                        _errors.SetError(txtLoginID, "學生登入帳號重覆,請確認資料。");
                        return;
                    }
                }
            }
            if (!string.IsNullOrEmpty(_StudRec.IDNumber))
            {
                if (checkSSN.Contains(_StudRec.IDNumber))
                {
                    if (_defaultIDNumber != _StudRec.IDNumber)
                    {
                        _errors.SetError(txtSSN, "身分證號重覆,請確認資料。");
                        return;
                    }
                }
            }

            //儲存延伸資料
            List <StudentRecord_Ext> list = new List <StudentRecord_Ext>();

            list.Add(_StudRec_Ext);
            if (!string.IsNullOrEmpty(_StudRec_Ext.UID))
            {
                tool._A.UpdateValues(list);
            }
            else
            {
                tool._A.InsertValues(list);
            }

            UpdateUDTData();

            eh(null, EventArgs.Empty);


            JHStudent.Update(_StudRec);
            SetAfterEditLog();
            JHSchool.Student.Instance.SyncDataBackground(PrimaryKey);
            _errors.Clear();
            //BindDataToForm();
        }