示例#1
0
        private string GetStudentInfo(JHSchool.Data.JHStudentRecord student)
        {
            string        info    = string.Empty;
            StringBuilder builder = new StringBuilder("");

            if (student.Class != null)
            {
                builder.Append(student.Class.Name);
                if (!string.IsNullOrEmpty("" + student.SeatNo))
                {
                    builder.Append("(" + student.SeatNo + "號)");
                }
                builder.Append(" ");
            }
            if (!string.IsNullOrEmpty(student.StudentNumber))
            {
                builder.Append(student.StudentNumber + " ");
            }
            if (string.IsNullOrEmpty(builder.ToString()))
            {
                builder.Append("學生:");
            }
            builder.Append(student.Name);
            return(builder.ToString());
        }
示例#2
0
        private void ClassItem_Load(object sender, EventArgs e)
        {
            Errors           = new EnhancedErrorProvider();
            _ClassNameIDDic  = new Dictionary <string, string>();
            _ClassSeatNoList = new List <int>();

            JHSchool.Data.JHStudent.AfterChange += new EventHandler <K12.Data.DataChangedEventArgs>(JHStudent_AfterChange);

            objStudent                 = JHSchool.Data.JHStudent.SelectByID(PrimaryKey);
            _AllClassRecs              = JHSchool.Data.JHClass.SelectAll();
            _AllStudRecList            = new List <JHSchool.Data.JHStudentRecord>();
            _studRecList               = new List <JHSchool.Data.JHStudentRecord>();
            BGWork                     = new BackgroundWorker();
            BGWork.DoWork             += new DoWorkEventHandler(BGWork_DoWork);
            BGWork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGWork_RunWorkerCompleted);

            DataListener = new ChangeListener();
            DataListener.Add(new TextBoxSource(txtStudentNumber));
            DataListener.Add(new ComboBoxSource(cboClass, ComboBoxSource.ListenAttribute.Text));
            DataListener.Add(new ComboBoxSource(cboSeatNo, ComboBoxSource.ListenAttribute.Text));
            DataListener.StatusChanged += new EventHandler <ChangeEventArgs>(ValueManager_StatusChanged);
            prlp = new PermRecLogProcess();

            if (!string.IsNullOrEmpty(PrimaryKey))
            {
                BGWork.RunWorkerAsync();
            }

            Disposed += new EventHandler(ClassItem_Disposed);
        }
示例#3
0
        public AddTransStudCourseScore(JHSchool.Data.JHStudentRecord studentRec)
        {
            InitializeComponent();
            if (JHSchool.Permrec.Program.ModuleType == JHSchool.Permrec.Program.ModuleFlag.NULL)
            {
                return;
            }

            //if (JHSchool.Permrec.Program.ModuleType == JHSchool.Permrec.Program.ModuleFlag.HsinChu)

            // 預設用新竹
            _ScoreType = DAL.DALTransfer2.ScoreType.HsinChu;

            if (JHSchool.Permrec.Program.ModuleType == JHSchool.Permrec.Program.ModuleFlag.KaoHsiung)
            {
                _ScoreType = DAL.DALTransfer2.ScoreType.KaoHsiung;
            }

            prlp = new JHSchool.PermRecLogProcess();

            studRec                   = studentRec;
            dgValueManager            = new DGValueManager();
            ExamScoreEntityList       = new List <JHPermrec.UpdateRecord.DAL.ExamScoreEntity>();
            _CheckExamScoreEntityList = new List <JHPermrec.UpdateRecord.DAL.ExamScoreEntity>();
            EffortScoreDic            = new Dictionary <decimal, int>();
            EffortScoreList           = new List <decimal>();

            _BGWorker                     = new BackgroundWorker();
            _BGWorker.DoWork             += new DoWorkEventHandler(_BGWorker_DoWork);
            _BGWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_BGWorker_RunWorkerCompleted);


            AddTransBackgroundManager.AddTransStudCourseScoreObj = this;
        }
 /// <summary>
 /// 透過身分證號設定學生資料
 /// </summary>
 /// <param name="SSN"></param>
 /// <returns></returns>
 public static void SetStudentBySSN(string SSN)
 {
     _Student = DALTransfer1.GetStudentRecBySSN(SSN);
     if (_Student != null)
     {
         _HasStudentData = true;
     }
     else
     {
         _HasStudentData = false;
     }
 }
示例#5
0
 internal StudentRecord(JHSchool.Data.JHStudentRecord student)
 {
     ID                      = student.ID;
     Status                  = student.Status.ToString();
     SeatNo                  = "" + student.SeatNo;
     Name                    = student.Name;
     StudentNumber           = student.StudentNumber;
     Gender                  = student.Gender;
     IDNumber                = student.IDNumber;
     Birthday                = student.Birthday == null ? "" : student.Birthday.Value.ToString("yyyy/MM/dd");
     OverrideProgramPlanID   = student.OverrideProgramPlanID;
     OverrideScoreCalcRuleID = student.OverrideScoreCalcRuleID;
     RefClassID              = student.RefClassID;
     Nationality             = student.Nationality;
 }
示例#6
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string sid = AddTransBackgroundManager.GetStudent().ID;

            JHSchool.Data.JHStudentRecord StudRec = JHSchool.Data.JHStudent.SelectByID(sid);

            if (chkStudBase.Checked)
            {
                AddTransStudBaseData atsbd = new AddTransStudBaseData(AddTransBackgroundManager.GetStudent());
                atsbd.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                atsbd.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }

            if (chkStudCourse.Checked)
            {
                AddTransStudCourse atsc = new AddTransStudCourse(StudRec);
                atsc.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                atsc.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }

            if (chkStudCourseScore.Checked)
            {
                AddTransStudCourseScore atscs = new AddTransStudCourseScore(StudRec);
                atscs.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                atscs.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }

            if (chkSemesterHistory.Checked)
            {
                AddTransStudSemesterHistory atssh = new AddTransStudSemesterHistory(StudRec);
                atssh.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                atssh.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }

            if (chkStudSemsSubjScore.Checked)
            {
                AddTransStudSemsSubjScore atssss = new AddTransStudSemsSubjScore(AddTransBackgroundManager.GetStudent());
                atssss.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                atssss.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }

            if (chkStudUpdateRec.Checked)
            {
                AddTransStudUpdateRecord atsur = new AddTransStudUpdateRecord(AddTransBackgroundManager.GetStudent());
                atsur.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                atsur.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }
        }
示例#7
0
        public AddTransStudBaseData(JHSchool.Data.JHStudentRecord studentEntity)
        {
            InitializeComponent();
            _CountyTown = new JHSchool.Permrec.StudentExtendControls.CountyTown();

            student    = studentEntity;
            _StudentID = student.ID;
            ParentRec  = JHSchool.Data.JHParent.SelectByStudentID(_StudentID);
            AddressRec = JHSchool.Data.JHAddress.SelectByStudentID(_StudentID);
            LoadStudParentInfo();
            LoadStudAddress();

            string msg = "班級:";

            if (student.Class != null)
            {
                msg += student.Class.Name;
            }
            if (student.SeatNo.HasValue)
            {
                msg += ", 座號:" + student.SeatNo.Value;
            }
            msg += ", 姓名:" + student.Name + ", 學號:" + student.StudentNumber;

            lblStudName.Text   = msg;
            chkNextYes.Checked = true;
            cboAlive.Items.Add("存");
            cboAlive.Items.Add("歿");
            cboAlive.Items.Add("");

            // 讀取稱謂
            DSXmlHelper helper = Config.GetRelationship().GetContent();

            foreach (XmlNode node in helper.GetElements("Relationship"))
            {
                //cboRelationship.Items.Add(new KeyValuePair<string, string>(node.InnerText, node.InnerText));
                cboRelationship.Items.Add(node.InnerText);
            }

            _warnings = new EnhancedErrorProvider();

            _zip_code_mapping = new Dictionary <string, string>();

            AddTransBackgroundManager.AddTransStudBaseDataObj = this;
        }
示例#8
0
        public ImportRecord(JHSchool.Data.JHStudentRecord record)   //XmlElement record)
        {
            //_identity = record.GetAttribute("ID");
            //_id_number = record.GetAttribute("IDNumber");
            //_student_number = record.GetAttribute("StudentNumber");
            //_login_name = record.GetAttribute("SALoginName");

            // 學生編號
            _identity = record.ID;
            // 身分證號
            _id_number = record.IDNumber;
            // 學號
            _student_number = record.StudentNumber;
            // 登入帳號
            _login_name = record.SALoginName;

            // 學生狀態
            _Status = record.Status.ToString();
        }
示例#9
0
        void BGWork_DoWork(object sender, DoWorkEventArgs e)
        {
            _AllClassRecs.Clear();
            _AllClassRecs = JHSchool.Data.JHClass.SelectAll();
            _AllStudRecList.Clear();
            _AllStudRecList = JHSchool.Data.JHStudent.SelectAll();
            _studRecList.Clear();

            // 有條件加入一般狀態學生與有班級座號學生
            foreach (JHSchool.Data.JHStudentRecord studRec in _AllStudRecList)
            {
                if (studRec.Class != null)
                {
                    if (studRec.Status == K12.Data.StudentRecord.StudentStatus.一般 && studRec.SeatNo.HasValue)
                    {
                        _studRecList.Add(studRec);
                    }
                }
            }

            objStudent = JHSchool.Data.JHStudent.SelectByID(PrimaryKey);
        }
        // 載入系統預設學年度學期
        private void SetDefaultSchoolYearSemester()
        {
            int sy, sm;

            if (int.TryParse(JHSchool.School.DefaultSchoolYear, out sy))
            {
                intSchoolYear.Value = sy;
            }
            else
            {
                intSchoolYear.IsEmpty = true;
            }

            if (int.TryParse(JHSchool.School.DefaultSemester, out sm))
            {
                intSemester.Value = sm;
            }
            else
            {
                intSemester.IsEmpty = true;
            }


            // 取得年級

            JHSchool.Data.JHStudentRecord studRec = JHSchool.Data.JHStudent.SelectByID(RunningID);
            if (studRec.Class != null)
            {
                if (studRec.Class.GradeYear.HasValue)
                {
                    if (intGradeYear.IsEmpty)
                    {
                        intGradeYear.Value = studRec.Class.GradeYear.Value;
                    }
                }
            }
        }
示例#11
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtName.Text.Trim() == "")
            {
                return;
            }
            JHSchool.Data.JHStudentRecord studRec = new JHSchool.Data.JHStudentRecord();
            studRec.Name = txtName.Text;
            string            StudentID = JHSchool.Data.JHStudent.Insert(studRec);
            PermRecLogProcess prlp      = new PermRecLogProcess();

            if (chkInputData.Checked == true)
            {
                if (StudentID != "")
                {
                    Student.Instance.PopupDetailPane(StudentID);
                    Student.Instance.SyncDataBackground(StudentID);
                }
            }
            Student.Instance.SyncDataBackground(StudentID);

            prlp.SaveLog("學籍.學生", "新增學生", "新增學生姓名:" + txtName.Text);
            this.Close();
        }
示例#12
0
        public void setStudent_Status(JHSchool.Data.JHStudentRecord student, AddTransStudStatus status)
        {
            _student = student;
            _status  = status;
            Errors   = new EnhancedErrorProvider();
            //           Errors.Icon = Properties.Resources.warning;

            cboNewNationality.Items.AddRange(DALTransfer1.GetNationalities().ToArray());
            //cboClass.Items.Add(new KeyValuePair<string, string>("", "<空白>"));

            //

            //foreach (KeyValuePair<string, string> classItem in Utility.GetClassNameIDDict())
            //{
            //    cboClass.Items.Add(classItem);
            //}


            //cboClass.DisplayMember = "Value";
            //cboClass.ValueMember = "Key";

            //cboClass.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            //cboClass.AutoCompleteSource = AutoCompleteSource.ListItems;

            cboNewGender.Items.AddRange(new string[] { "男", "女" });

            if (student != null)
            {
                //把資料填入各項控制項當中
                txtName.Text = txtNewName.Text = _student.Name;
                txtSSN.Text  = txtNewSSN.Text = _student.IDNumber;
                if (_student.Birthday.HasValue)
                {
                    dtBirthDate.Text = dtNewBirthday.Text = _student.Birthday.Value.ToString();
                }
                cboGender.Text      = cboNewGender.Text = _student.Gender;
                cboNationality.Text = cboNewNationality.Text = _student.Nationality;
                txtBirthPlace.Text  = txtNewBirthPlace.Text = _student.BirthPlace;
                _StudentPhone       = JHSchool.Data.JHPhone.SelectByStudentID(_student.ID);

                txtTel.Text = txtNewTel.Text = _StudentPhone.Contact;
                //txtEngName.Text = txtNewEngName.Text = _student.na
                if (_student.Class != null)
                {
                    lblClassName.Text = _student.Class.Name;
                }
                if (_student.SeatNo.HasValue)
                {
                    lblSeatNo.Text = cboSeatNo.Text = _student.SeatNo.Value.ToString();
                }
                lblStudentNum.Text = cbotStudentNumber.Text = _student.StudentNumber;

                // 如果轉出又入,使用原班
                lblNewClassName.Text = lblClassName.Text;
            }

            //依照status不同調整畫面大小
            if (status == AddTransStudStatus.Added)
            {
                gpOld.Visible = false;
                this.Size     = new Size(422, 438);
                //txtNewName.Text = "";
                txtNewSSN.Text = AddTransBackgroundManager.StudentIDNumber;
            }
            else
            {
                gpOld.Visible = true;
                this.Size     = new Size(823, 379);
            }
            // setClassNo();
            reLoadStudNumItems();
            this.MaximumSize = this.MinimumSize = this.Size;
            //AddTransBackgroundManager.AddTransStudBaseObj = this;
        }
示例#13
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtNewName.Text.Trim() == "")
                {
                    MsgBox.Show("姓名必填");
                    return;
                }

                if (lblNewClassName.Text.Trim() == "")
                {
                    MsgBox.Show("班級必填");
                    return;
                }

                if (string.IsNullOrEmpty(cbotStudentNumber.Text))
                {
                    Errors.SetError(cbotStudentNumber, "學號空白!");
                }


                MsgForm mf = new MsgForm();

                string msg = "請問是否將班級由「" + lblClassName.Text + "」調整成「" + lblNewClassName.Text + "」,並傳送至局端備查?";

                bool chkSend = false;

                mf.Text = "調整確認";
                mf.SetMsg(msg);
                //if (FISCA.Presentation.Controls.MsgBox.Show(msg, "調整確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                if (mf.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                {
                    chkSend = true;
                }

                if (chkSend)
                {
                    string sid = string.Empty;


                    //if (StudCheckTool.CheckStudIDNumberSame(txtNewSSN.Text, sid))
                    //{
                    //    FISCA.Presentation.Controls.MsgBox.Show("身分證號重複請檢查");
                    //    return;
                    //}


                    Dictionary <string, int> chkSum = new Dictionary <string, int>();
                    foreach (JHSchool.Data.JHStudentRecord studRec in JHSchool.Data.JHStudent.SelectAll())
                    {
                        if (studRec.Status == K12.Data.StudentRecord.StudentStatus.一般)
                        {
                            if (!string.IsNullOrEmpty(studRec.StudentNumber))
                            {
                                if (chkSum.ContainsKey(studRec.StudentNumber))
                                {
                                    chkSum[studRec.StudentNumber]++;
                                }
                                else
                                {
                                    chkSum.Add(studRec.StudentNumber, 1);
                                }
                            }
                        }
                    }

                    bool chkDNumber = false;
                    if (chkSum.ContainsKey(cbotStudentNumber.Text))
                    {
                        if (chkSum[cbotStudentNumber.Text] > 0)
                        {
                            chkDNumber = true;
                        }
                    }

                    Errors.SetError(cbotStudentNumber, "");

                    if (chkDNumber)
                    {
                        Errors.SetError(cbotStudentNumber, "學號重複請檢查!");
                        return;
                    }

                    if (_status == AddTransStudStatus.Added)
                    {
                        JHSchool.Data.JHStudentRecord NewStudRec = new JHSchool.Data.JHStudentRecord();
                        NewStudRec.Name     = txtNewName.Text;
                        NewStudRec.Gender   = cboNewGender.Text;
                        NewStudRec.IDNumber = txtNewSSN.Text;
                        sid                   = JHSchool.Data.JHStudent.Insert(NewStudRec);
                        _StudentPhone         = JHSchool.Data.JHPhone.SelectByStudentID(sid);
                        _StudentPhone.Contact = txtNewTel.Text;
                    }

                    if (!string.IsNullOrEmpty(sid))
                    {
                        _student = JHSchool.Data.JHStudent.SelectByID(sid);
                    }

                    //_student.Name = txtNewName.Text;

                    _student.IDNumber = txtNewSSN.Text;
                    DateTime dt;
                    if (DateTime.TryParse(dtNewBirthday.Text, out dt))
                    {
                        _student.Birthday = dt;
                    }

                    //_student.Gender = cboNewGender.Text;
                    _student.Nationality = cboNewNationality.Text;
                    _student.BirthPlace  = txtNewBirthPlace.Text;
                    //_StudentPhone.Contact = txtNewTel.Text;
                    //_student.EnglishName = txtNewEngName.Text;

                    foreach (JHSchool.Data.JHClassRecord cr in JHSchool.Data.JHClass.SelectAll())
                    {
                        if (lblNewClassName.Text == cr.Name)
                        {
                            _student.RefClassID = cr.ID;
                            break;
                        }
                    }

                    if (string.IsNullOrEmpty(cboSeatNo.Text))
                    {
                        _student.SeatNo = null;
                    }
                    else
                    {
                        int no;
                        int.TryParse(cboSeatNo.Text, out no);
                        _student.SeatNo = no;
                    }
                    _student.StudentNumber = cbotStudentNumber.Text;


                    string strGradeYear = "";

                    if (_student.Class != null)
                    {
                        if (_student.Class.GradeYear.HasValue)
                        {
                            strGradeYear = _student.Class.GradeYear.Value.ToString();
                        }
                    }

                    // 當學生狀態非一般調整學生狀態
                    if (_student.Status != K12.Data.StudentRecord.StudentStatus.一般)
                    {
                        _student.Status = K12.Data.StudentRecord.StudentStatus.一般;
                    }

                    try
                    {
                        JHSchool.Data.JHStudent.Update(_student);
                        JHSchool.Data.JHPhone.Update(_StudentPhone);
                    }
                    catch (Exception ex)
                    {
                        FISCA.Presentation.Controls.MsgBox.Show("更新學生資料發生錯誤:" + ex.Message);
                    }

                    // 寫入班級學生變動
                    UDT_ClassSpecial StudSpec = UDTTransfer.AddClassSpecStudent(_student.ID, "", _student.RefClassID, lblClassName.Text, lblNewClassName.Text, lblNewClassName.Text, "", "");


                    // 傳送至局端
                    string errMsg = Utility.SendData("自動轉入", _student.IDNumber, _student.StudentNumber, _student.Name, strGradeYear, lblClassName.Text, cboSeatNo.Text, lblNewClassName.Text, "", "", _student.ID, _student.RefClassID, StudSpec.ClassComment);
                    if (errMsg != "")
                    {
                        FISCA.Presentation.Controls.MsgBox.Show(errMsg);
                    }

                    //log
                    JHSchool.PermRecLogProcess prlp = new JHSchool.PermRecLogProcess();
                    if (_status == AddTransStudStatus.Added)
                    {
                        prlp.SaveLog("學生.轉入異動", "新增班級資料", "修改轉入與班級資料.");
                    }
                    else
                    {
                        prlp.SaveLog("學生.轉入異動", "修改班級資料", "修改轉入與班級資料.");
                    }

                    AddTransBackgroundManager.SetStudent(_student);

                    AddTransManagerForm atmf = new AddTransManagerForm();
                    this.Visible       = false;
                    atmf.StartPosition = FormStartPosition.CenterParent;
                    atmf.ShowDialog(FISCA.Presentation.MotherForm.Form);
                    this.Close();
                    JHSchool.Student.Instance.SyncAllBackground();
                    JHSchool.Data.JHStudent.RemoveAll();
                    JHSchool.Data.JHStudent.SelectAll();

                    //註冊一個事件引發模組
                    EventHandler eh = FISCA.InteractionService.PublishEvent("KH_StudentTransStudBase");
                    eh(this, EventArgs.Empty);
                }
            }
            catch (Exception ex)
            {
                FISCA.Presentation.Controls.MsgBox.Show(ex.Message);
                return;
            }
        }
示例#14
0
        private void buttonItem2_CheckedChanged(object sender, EventArgs e)
        {
            var button = (DevComponents.DotNetBar.ButtonItem)sender;

            if (button.Checked)
            {
                var studentRec = Student.Instance.Items[PrimaryKey];
                if (studentRec != null)
                {
                    if (button.Text != studentRec.Status)
                    {
                        //if (button.Text == "刪除")
                        //    throw new ArgumentException();

                        try
                        {
                            PermRecLogProcess prlp = new PermRecLogProcess();

                            JHSchool.Data.JHStudentRecord stu = JHSchool.Data.JHStudent.SelectByID(PrimaryKey);
                            prlp.SetBeforeSaveText("學生狀態", stu.Status.ToString());


                            if (K12.Data.StudentRecord.StudentStatus.一般.ToString() == button.Text)
                            {
                                stu.Status = K12.Data.StudentRecord.StudentStatus.一般;
                            }

                            if (K12.Data.StudentRecord.StudentStatus.休學.ToString() == button.Text)
                            {
                                stu.Status = K12.Data.StudentRecord.StudentStatus.休學;
                            }

                            if (K12.Data.StudentRecord.StudentStatus.畢業或離校.ToString() == button.Text)
                            {
                                stu.Status = K12.Data.StudentRecord.StudentStatus.畢業或離校;
                            }

                            if (K12.Data.StudentRecord.StudentStatus.輟學.ToString() == button.Text)
                            {
                                stu.Status = K12.Data.StudentRecord.StudentStatus.輟學;
                            }

                            if (K12.Data.StudentRecord.StudentStatus.刪除.ToString() == button.Text)
                            {
                                stu.Status = K12.Data.StudentRecord.StudentStatus.刪除;
                            }

                            // 檢查同狀態要身分證或學號相同時,無法變更

                            List <string> checkIDNumber = new List <string>();
                            List <string> checkSnum     = new List <string>();

                            foreach (JHSchool.Data.JHStudentRecord studRec in JHSchool.Data.JHStudent.SelectAll())
                            {
                                if (studRec.Status == stu.Status)
                                {
                                    if (!string.IsNullOrEmpty(studRec.StudentNumber))
                                    {
                                        checkSnum.Add(studRec.StudentNumber.Trim());
                                    }
                                    if (!string.IsNullOrEmpty(studRec.IDNumber))
                                    {
                                        checkIDNumber.Add(studRec.IDNumber.Trim());
                                    }
                                }
                            }

                            if (checkSnum.Contains(stu.StudentNumber.Trim()))
                            {
                                MsgBox.Show("在" + stu.Status.ToString() + "狀態學號有重複無法變更.");
                                return;
                            }

                            if (checkIDNumber.Contains(stu.IDNumber.Trim()))
                            {
                                MsgBox.Show("在" + stu.Status.ToString() + "狀態身分證號有重複無法變更.");
                                return;
                            }

                            JHSchool.Data.JHStudent.Update(stu);
                            prlp.SetAfterSaveText("學生狀態", stu.Status.ToString());
                            prlp.SetActionBy("學籍", "學生學生狀態");
                            prlp.SetAction("修改學生學生狀態");
                            prlp.SaveLog("", "", "student", PrimaryKey);


                            //Feature.Legacy.EditStudent.ChangeStudentStatus(studentRec.ID, button.Text);
                        }
                        catch (ArgumentException aa)
                        {
                            MessageBox.Show("目前無法移到刪除");
                        }

                        catch
                        {
                            OnPrimaryKeyChanged(new EventArgs());
                            FISCA.Presentation.MotherForm.SetStatusBarMessage("變更狀態失敗,可能發生原因為學號或身分證號在" + button.Text + "學生中已經存在,請檢查學生資料。");
                            return;
                        }
                        Student.Instance.SyncDataBackground(studentRec.ID);
                        FISCA.Presentation.MotherForm.SetStatusBarMessage("已變更學生狀態。" + DescriptionLabel.Text);
                    }
                }
            }
        }
示例#15
0
        public static void Main()
        {
            #region SyncAllBackground
            //授課教師
            if (!TCInstruct.Instance.Loaded)
            {
                TCInstruct.Instance.SyncAllBackground();
            }
            //修課記錄
            //if (!SCAttend.Instance.Loaded) SCAttend.Instance.SyncAllBackground();
            //課程規劃
            if (!ProgramPlan.Instance.Loaded)
            {
                ProgramPlan.Instance.SyncAllBackground();
            }
            //計算規則
            if (!ScoreCalcRule.Instance.Loaded)
            {
                ScoreCalcRule.Instance.SyncAllBackground();
            }
            //評量設定
            if (!AssessmentSetup.Instance.Loaded)
            {
                AssessmentSetup.Instance.SyncAllBackground();
            }
            #endregion

            #region SetupPresentation
            //授課教師
            TCInstruct.Instance.SetupPresentation();
            //修課記錄
            SCAttend.Instance.SetupPresentation();
            //課程規劃
            ProgramPlan.Instance.SetupPresentation();
            //計算規則
            ScoreCalcRule.Instance.SetupPresentation();
            //評量設定
            AssessmentSetup.Instance.SetupPresentation();
            #endregion

            #region ContentItem 資料項目
            //學期成績
            //Student.Instance.AddDetailBulider(new DetailBulider<SemesterScoreItem>());
            //Student.Instance.AddDetailBulider(new DetailBulider<DLScoreItem>());
            //課程基本資訊
            Course.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider <CourseExtendControls.BasicInfoItem>());

            //成績計算
            Course.Instance.AddDetailBulider(new DetailBulider <ScoreCalcSetupItem>());
            //修課學生

            Course.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider <SCAttendItem>());
            //電子報表(因相關功能未完成先註)
            //Course.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<CourseExtendControls.ElectronicPaperItem>());
            //班級課程規劃
            Class.Instance.AddDetailBulider(new DetailBulider <ClassExtendControls.ClassBaseInfoItem_Extend>());

            //暫時註解
            //個人活動表現紀錄
            //Student.Instance.AddDetailBulider(new DetailBulider<StudentActivityRecordItem>());

            // 2017/5/9 穎驊  註解 下面位子 搬去 JHEvaluation.ScoreCalculation
            //畢業成績
            //Student.Instance.AddDetailBulider(new DetailBulider<GraduationScoreItem>());

            //修課及評量成績
            //Student.Instance.AddDetailBulider(new DetailBulider<CourseScoreItem>());
            #endregion

            #region RibbonBar

            NLDPanels.Student.RibbonBarItems["教務"]["成績作業"].Size  = RibbonBarButton.MenuButtonSize.Large;
            NLDPanels.Student.RibbonBarItems["教務"]["成績作業"].Image = Properties.Resources.calc_save_64;

            NLDPanels.Student.RibbonBarItems["教務"]["畢業作業"].Size  = RibbonBarButton.MenuButtonSize.Large;
            NLDPanels.Student.RibbonBarItems["教務"]["畢業作業"].Image = Properties.Resources.graduated_write_64;

            #region 學生/資料統計/報表
            RibbonBarButton rbButton = Student.Instance.RibbonBarItems["資料統計"]["報表"];

            // 2017/5/9 穎驊  註解 下面位子 搬去 JHEvaluation.ScoreCalculation
            //rbButton["成績相關報表"]["畢業預警報表"].Enable = User.Acl["JHSchool.Student.Report0010"].Executable;
            //rbButton["成績相關報表"]["畢業預警報表"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count <= 0) return;
            //    JHSchool.Evaluation.StudentExtendControls.Ribbon.GraduationPredictReport report = new JHSchool.Evaluation.StudentExtendControls.Ribbon.GraduationPredictReport(Student.Instance.SelectedList);
            //};
            //rbButton["學務相關報表"]["畢業預警報表"].Enable = User.Acl["JHSchool.Student.Report0010"].Executable;
            //rbButton["學務相關報表"]["畢業預警報表"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count <= 0) return;
            //    JHSchool.Evaluation.StudentExtendControls.Ribbon.GraduationPredictReport report = new JHSchool.Evaluation.StudentExtendControls.Ribbon.GraduationPredictReport(Student.Instance.SelectedList);
            //};
            #endregion

            #region 學生/資料統計/匯入匯出
            RibbonBarButton rbItemExport = Student.Instance.RibbonBarItems["資料統計"]["匯出"];
            RibbonBarButton rbItemImport = Student.Instance.RibbonBarItems["資料統計"]["匯入"];
            //rbItemExport["匯出學期科目成績"].Enable = User.Acl["JHSchool.Student.Ribbon0180"].Executable;
            //rbItemExport["匯出學期科目成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Evaluation.ImportExport.ExportSemesterSubjectScore();
            //    JHSchool.Evaluation.ImportExport.ExportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};
            //rbItemExport["匯出學期領域成績"].Enable = User.Acl["JHSchool.Student.Ribbon0181"].Executable;
            //rbItemExport["匯出學期領域成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Evaluation.ImportExport.ExportSemesterDomainScore();
            //    JHSchool.Evaluation.ImportExport.ExportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};
            //rbItemExport["匯出畢業成績"].Enable = User.Acl["JHSchool.Student.Ribbon0182"].Executable;
            //rbItemExport["匯出畢業成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Evaluation.ImportExport.ExportGradScore();
            //    JHSchool.Evaluation.ImportExport.ExportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};
            rbItemExport["成績相關匯出"]["匯出課程成績"].Enable = User.Acl["JHSchool.Student.Ribbon0183"].Executable;
            rbItemExport["成績相關匯出"]["匯出課程成績"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter           exporter = new JHSchool.Evaluation.ImportExport.ExportCourseScore();
                JHSchool.Evaluation.ImportExport.ExportStudentV2 wizard   = new JHSchool.Evaluation.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            rbItemExport["成績相關匯出"]["匯出學期歷程"].Enable = User.Acl["JHSchool.Student.Ribbon0169"].Executable;
            rbItemExport["成績相關匯出"]["匯出學期歷程"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter           exporter = new JHSchool.Evaluation.ImportExport.ExportSemesterHistory();
                JHSchool.Evaluation.ImportExport.ExportStudentV2 wizard   = new JHSchool.Evaluation.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            //rbItemExport["匯出評量成績"].Enable = User.Acl["JHSchool.Student.Ribbon0184"].Executable;
            //rbItemExport["匯出評量成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Evaluation.ImportExport.ExportExamScore();
            //    JHSchool.Evaluation.ImportExport.ExportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};

            //rbItemImport["匯入學期科目成績"].Enable = User.Acl["JHSchool.Student.Ribbon0190"].Executable;
            //rbItemImport["匯入學期科目成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer importer = new JHSchool.Evaluation.ImportExport.ImportSemesterSubjectScore();
            //    JHSchool.Evaluation.ImportExport.ImportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ImportStudentV2(importer.Text, importer.Image);
            //    importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};
            //rbItemImport["匯入學期領域成績"].Enable = User.Acl["JHSchool.Student.Ribbon0191"].Executable;
            //rbItemImport["匯入學期領域成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer importer = new JHSchool.Evaluation.ImportExport.ImportSemesterDomainScore();
            //    JHSchool.Evaluation.ImportExport.ImportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ImportStudentV2(importer.Text, importer.Image);
            //    importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};
            //rbItemImport["匯入畢業成績"].Enable = User.Acl["JHSchool.Student.Ribbon0192"].Executable;
            //rbItemImport["匯入畢業成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer importer = new JHSchool.Evaluation.ImportExport.ImportGradScore();
            //    JHSchool.Evaluation.ImportExport.ImportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ImportStudentV2(importer.Text, importer.Image);
            //    importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};
            rbItemImport["成績相關匯入"]["匯入課程成績"].Enable = User.Acl["JHSchool.Student.Ribbon0193"].Executable;
            rbItemImport["成績相關匯入"]["匯入課程成績"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer           importer = new JHSchool.Evaluation.ImportExport.ImportCourseScore();
                JHSchool.Evaluation.ImportExport.ImportStudentV2 wizard   = new JHSchool.Evaluation.ImportExport.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };

            rbItemImport["成績相關匯入"]["匯入學期歷程"].Enable = User.Acl["JHSchool.Student.Ribbon0170"].Executable;
            rbItemImport["成績相關匯入"]["匯入學期歷程"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer           importer = new JHSchool.Evaluation.ImportExport.ImportSemesterHistory();
                JHSchool.Evaluation.ImportExport.ImportStudentV2 wizard   = new JHSchool.Evaluation.ImportExport.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };

            //rbItemImport["匯入評量成績"].Enable = User.Acl["JHSchool.Student.Ribbon0194"].Executable;
            //rbItemImport["匯入評量成績"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer importer = new JHSchool.Evaluation.ImportExport.ImportExamScore();
            //    JHSchool.Evaluation.ImportExport.ImportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.ImportStudentV2(importer.Text, importer.Image);
            //    importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};
            #endregion

            #region 學生/教務
            //移到成績計算模組。
            RibbonBarItem rbItem = Student.Instance.RibbonBarItems["教務"];
            //rbItem["畢業資格審查"].Enable = User.Acl["JHSchool.Student.Ribbon0058"].Executable;
            //rbItem["畢業資格審查"].Image = JHSchool.Evaluation.CourseExtendControls.Ribbon.Resources.graduation_64;
            //rbItem["畢業資格審查"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count == 0) return;
            //    Form form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.GraduationInspectWizard("Student");
            //    form.ShowDialog();
            //};
            #endregion

            #region 學生/成績/排名
            /** 程式碼移動到 JHEvaluation.Rating Module 中。*/

            //rbButton = Student.Instance.RibbonBarItems["成績"]["排名"];
            //rbButton.Enable = User.Acl["JHSchool.Student.Ribbon0059"].Executable;
            //rbButton["評量科目成績排名"].Enable = true;
            //rbButton["評量科目成績排名"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormExamSubject form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormExamSubject();
            //        form.SetRatingStudents(K12.Presentation.NLDPanels.Student.SelectedSource);
            //        form.ShowDialog();
            //    }
            //};

            ////rbButton.Enable = User.Acl[""].Executable;
            //rbButton["評量領域成績排名"].Enable = true;
            //rbButton["評量領域成績排名"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormExamDomain form= new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormExamDomain();
            //        form.SetRatingStudents(K12.Presentation.NLDPanels.Student.SelectedSource);
            //        form.ShowDialog();
            //    }
            //};

            //rbButton["學期科目成績排名"].Enable = true;
            //rbButton["學期科目成績排名"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemesterSubject form= new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemesterSubject();
            //        form.SetRatingStudents(K12.Presentation.NLDPanels.Student.SelectedSource);
            //        form.ShowDialog();
            //    }
            //};

            //rbButton["學期領域成績排名"].Enable = true;
            //rbButton["學期領域成績排名"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemesterDomain form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemesterDomain();
            //        form.SetRatingStudents(K12.Presentation.NLDPanels.Student.SelectedSource);
            //        form.ShowDialog();
            //    }
            //};

            //rbButton["學期科目成績排名(多學期)"].Enable = true;
            //rbButton["學期科目成績排名(多學期)"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemestersSubject form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemestersSubject();
            //        form.SetRatingStudents(K12.Presentation.NLDPanels.Student.SelectedSource);
            //        form.ShowDialog();
            //    }
            //};

            //rbButton["學期領域成績排名(多學期)"].Enable = true;
            //rbButton["學期領域成績排名(多學期)"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemestersDomain form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormSemestersDomain();
            //        form.SetRatingStudents(K12.Presentation.NLDPanels.Student.SelectedSource);
            //        form.ShowDialog();
            //    }
            //};

            //rbButton["畢業成績排名"].Enable = true;
            //rbButton["畢業成績排名"].Click += delegate
            //{
            //    if (Student.Instance.SelectedList.Count > 0)
            //    {
            //        Form form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.Rating.FormGraduation();
            //        form.ShowDialog();
            //    }
            //};
            #endregion

            #region 班級/資料統計/報表
            MenuButton semsGoodStudentReportButton = Class.Instance.RibbonBarItems["資料統計"]["報表"]["成績相關報表"]["學期優異表現名單"];
            semsGoodStudentReportButton.Enable = User.Acl["JHSchool.Class.Report0180"].Executable;
            semsGoodStudentReportButton.Click += delegate
            {
                if (Class.Instance.SelectedList.Count > 0)
                {
                    Form form = new JHSchool.Evaluation.ClassExtendControls.Ribbon.Score.SemsGoodStudentReport.SemsGoodStudentReport();
                    form.ShowDialog();
                }
            };
            #endregion

            #region 班級/教務
            rbButton = K12.Presentation.NLDPanels.Class.RibbonBarItems["教務"]["班級開課"];
            //rbButton = Class.Instance.RibbonBarItems["成績"]["班級開課"];
            rbButton.Enable             = User.Acl["JHSchool.Class.Ribbon0070"].Executable;
            rbButton.Image              = Properties.Resources.organigram_refresh_64;
            rbButton["依課程規劃表開課"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Class.SelectedSource.Count > 0)
                {
                    JHSchool.Evaluation.ClassExtendControls.Ribbon.CreateCoursesByProgramPlan.Run();
                }
            };
            rbButton["直接開課"].Click += delegate
            {
                if (Class.Instance.SelectedList.Count > 0)
                {
                    new JHSchool.Evaluation.ClassExtendControls.Ribbon.CreateCoursesDirectly();
                }
            };
            #endregion

            #region 課程/編輯
            rbItem          = Course.Instance.RibbonBarItems["編輯"];
            rbButton        = rbItem["新增"];
            rbButton.Size   = RibbonBarButton.MenuButtonSize.Large;
            rbButton.Image  = JHSchool.Evaluation.CourseExtendControls.Ribbon.Resources.btnAddCourse;
            rbButton.Enable = User.Acl["JHSchool.Course.Ribbon0000"].Executable;
            rbButton.Click += delegate
            {
                new JHSchool.Evaluation.CourseExtendControls.Ribbon.AddCourse().ShowDialog();
            };

            rbButton        = rbItem["刪除"];
            rbButton.Size   = RibbonBarButton.MenuButtonSize.Large;
            rbButton.Image  = JHSchool.Evaluation.CourseExtendControls.Ribbon.Resources.btnDeleteCourse;
            rbButton.Enable = User.Acl["JHSchool.Course.Ribbon0010"].Executable;
            rbButton.Click += delegate
            {
                if (Course.Instance.SelectedKeys.Count == 1)
                {
                    JHSchool.Data.JHCourseRecord record = JHSchool.Data.JHCourse.SelectByID(Course.Instance.SelectedKeys[0]);
                    //int CourseAttendCot = Course.Instance.Items[record.ID].GetAttendStudents().Count;
                    List <JHSchool.Data.JHSCAttendRecord> scattendList = JHSchool.Data.JHSCAttend.SelectByStudentIDAndCourseID(new List <string>()
                    {
                    }, new List <string>()
                    {
                        record.ID
                    });
                    int attendStudentCount = 0;
                    foreach (JHSchool.Data.JHSCAttendRecord scattend in scattendList)
                    {
                        if (scattend.Student.Status == K12.Data.StudentRecord.StudentStatus.一般)
                        {
                            attendStudentCount++;
                        }
                    }

                    if (attendStudentCount > 0)
                    {
                        MsgBox.Show(record.Name + " 有" + attendStudentCount.ToString() + "位修課學生,請先移除修課學生後再刪除課程.");
                    }
                    else
                    {
                        string msg = string.Format("確定要刪除「{0}」?", record.Name);
                        if (MsgBox.Show(msg, "刪除課程", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            #region 自動刪除非一般學生的修課記錄
                            List <JHSchool.Data.JHSCAttendRecord> deleteSCAttendList = new List <JHSchool.Data.JHSCAttendRecord>();
                            foreach (JHSchool.Data.JHSCAttendRecord scattend in scattendList)
                            {
                                JHSchool.Data.JHStudentRecord stuRecord = JHSchool.Data.JHStudent.SelectByID(scattend.RefStudentID);
                                if (stuRecord == null)
                                {
                                    continue;
                                }
                                if (stuRecord.Status != K12.Data.StudentRecord.StudentStatus.一般)
                                {
                                    deleteSCAttendList.Add(scattend);
                                }
                            }
                            List <string> studentIDs = new List <string>();
                            foreach (JHSchool.Data.JHSCAttendRecord scattend in deleteSCAttendList)
                            {
                                studentIDs.Add(scattend.RefStudentID);
                            }
                            List <JHSchool.Data.JHSCETakeRecord> sceList = JHSchool.Data.JHSCETake.SelectByStudentAndCourse(studentIDs, new List <string>()
                            {
                                record.ID
                            });
                            JHSchool.Data.JHSCETake.Delete(sceList);
                            JHSchool.Data.JHSCAttend.Delete(deleteSCAttendList);
                            #endregion

                            JHSchool.Data.JHCourse.Delete(record);
                            //CourseRecordEditor crd = Course.Instance.Items[record.ID].GetEditor();
                            //crd.Remove = true;
                            //crd.Save();
                            // 加這主要是重新整理
                            Course.Instance.SyncDataBackground(record.ID);
                        }
                        else
                        {
                            return;
                        }
                    }
                }
            };

            RibbonBarButton CouItem = Course.Instance.RibbonBarItems["編輯"]["刪除"];
            Course.Instance.SelectedListChanged += delegate
            {
                // 課程刪除不能多選
                CouItem.Enable = (Course.Instance.SelectedList.Count < 2) && User.Acl["JHSchool.Course.Ribbon0010"].Executable;
            };
            #endregion

            #region 課程/資料統計/報表
            rbButton = Course.Instance.RibbonBarItems["資料統計"]["報表"];
            rbButton["學生修課清單"].Enable = User.Acl["JHSchool.Course.Report0000"].Executable;
            rbButton["學生修課清單"].Click += delegate
            {
                if (Course.Instance.SelectedList.Count >= 1)
                {
                    new JHSchool.Evaluation.ClassExtendControls.Ribbon.StuinCourse.StuinCourse();
                }
                else
                {
                    MsgBox.Show("請選擇課程");
                }
            };
            #endregion

            #region 課程/資料統計/匯入匯出
            RibbonBarItem rbItemCourseImportExport = Course.Instance.RibbonBarItems["資料統計"];
            rbItemCourseImportExport["匯出"]["匯出課程修課學生"].Enable = User.Acl["JHSchool.Course.Ribbon0031"].Executable;
            rbItemCourseImportExport["匯出"]["匯出課程修課學生"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Evaluation.ImportExport.Course.ExportCourseStudents("");
                JHSchool.Evaluation.ImportExport.Course.ExportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.Course.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };
            rbItemCourseImportExport["匯入"]["匯入課程修課學生"].Enable = User.Acl["JHSchool.Course.Ribbon0021"].Executable;
            rbItemCourseImportExport["匯入"]["匯入課程修課學生"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer importer = new JHSchool.Evaluation.ImportExport.Course.ImportCourseStudents("");
                JHSchool.Evaluation.ImportExport.Course.ImportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.Course.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };

            //rbItemCourseImportExport = FISCA.Presentation.MotherForm.RibbonBarItems["社團作業", "資料統計"];
            //rbItemCourseImportExport["匯出"]["匯出社團參與學生"].Enable = User.Acl["JHSchool.Course.Ribbon0031"].Executable;
            //rbItemCourseImportExport["匯出"]["匯出社團參與學生"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Evaluation.ImportExport.Course.ExportCourseStudents("社團");
            //    JHSchool.Evaluation.ImportExport.Course.ExportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.Course.ExportStudentV2(exporter.Text, exporter.Image, "社團", K12.Presentation.NLDPanels.Course.SelectedSource);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};
            //rbItemCourseImportExport["匯入"]["匯入社團參與學生"].Enable = User.Acl["JHSchool.Course.Ribbon0021"].Executable;
            //rbItemCourseImportExport["匯入"]["匯入社團參與學生"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer importer = new JHSchool.Evaluation.ImportExport.Course.ImportCourseStudents("社團");
            //    JHSchool.Evaluation.ImportExport.Course.ImportStudentV2 wizard = new JHSchool.Evaluation.ImportExport.Course.ImportStudentV2(importer.Text, importer.Image);
            //    importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};
            #endregion

            #region 課程/教務
            RibbonBarButton group = Course.Instance.RibbonBarItems["教務"]["分組上課"];
            group.Size   = RibbonBarButton.MenuButtonSize.Medium;
            group.Image  = Properties.Resources.meeting_refresh_64;
            group.Enable = User.Acl["JHSchool.Course.Ribbon0060"].Executable;
            group.Click += delegate
            {
                if (Course.Instance.SelectedList.Count > 0)
                {
                    new JHSchool.Evaluation.Legacy.SwapAttendStudents(Course.Instance.SelectedList.Count).ShowDialog();
                }
            };

            // 2018/8/15 穎驊 優化 分班功能,取消上限
            ////課程超過7項,則"分組上課"不能點擊
            //Course.Instance.SelectedListChanged += delegate
            //{
            //    //分組上課不能超過七個課程。
            //    group.Enable = (Course.Instance.SelectedList.Count <= 7) && User.Acl["JHSchool.Course.Ribbon0060"].Executable;
            //};

            RibbonBarItem scores = Course.Instance.RibbonBarItems["教務"];
            //scores["成績輸入"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //scores["成績輸入"].Image = Resources.exam_write_64;
            //scores["成績輸入"].Enable = User.Acl["JHSchool.Course.Ribbon0070"].Executable;
            //scores["成績輸入"].Click += delegate
            //{
            //    if (Course.Instance.SelectedList.Count == 1)
            //    {
            //        //new JHSchool.Evaluation.CourseExtendControls.Ribbon.EditCourseScore(Course.Instance.SelectedList[0]).ShowDialog();
            //        CourseRecord courseRecord = Course.Instance.SelectedList[0];
            //        if (courseRecord.GetAssessmentSetup() == null)
            //            MsgBox.Show("課程 '" + courseRecord.Name + "' 沒有評量設定。");
            //        else
            //            new JHSchool.Evaluation.CourseExtendControls.Ribbon.CourseScoreInputForm(courseRecord).ShowDialog();
            //    }
            //};
            //Course.Instance.SelectedListChanged += delegate
            //{
            //    scores["成績輸入"].Enable = Course.Instance.SelectedList.Count == 1 && User.Acl["JHSchool.Course.Ribbon0070"].Executable;
            //};

            //scores["成績計算"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //scores["成績計算"].Image = Resources.calcScore;
            //scores["成績計算"].Enable = User.Acl["JHSchool.Course.Ribbon0080"].Executable;
            //scores["成績計算"].Click += delegate
            //{
            //    new JHSchool.Evaluation.CourseExtendControls.Ribbon.CalculateionWizard().ShowDialog();
            //};

            // UNDONE: 等有討論出什麼結論再說吧…
            //scores["合科什麼鬼的"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //scores["合科什麼鬼的"].Enable = true;
            //scores["合科什麼鬼的"].Click += delegate
            //{
            //    List<JHSchool.Data.JHCourseRecord> courseList = JHSchool.Data.JHCourse.SelectByIDs(K12.Presentation.NLDPanels.Course.SelectedSource);
            //    if (courseList.Count <= 0) return;

            //    if (SubjectCombinationConfigForm.CheckAssessmentSetup(courseList) == true)
            //    {
            //        new SubjectCombinationConfigForm(courseList).ShowDialog();
            //    }
            //};
            #endregion

            #region 教務作業/課務作業

            rbItem = EduAdmin.Instance.RibbonBarItems["基本設定"];

            rbItem["管理"].Size             = RibbonBarButton.MenuButtonSize.Large;
            rbItem["管理"].Image            = Properties.Resources.network_lock_64;
            rbItem["管理"]["領域資料管理"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon.DomainList"].Executable;
            rbItem["管理"]["領域資料管理"].Click += delegate
            {
                new DomainListTable().ShowDialog();
            };

            rbItem["管理"]["科目資料管理"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon.DomainList"].Executable;
            rbItem["管理"]["科目資料管理"].Click += delegate
            {
                new SubjectListTable().ShowDialog();
            };

            //rbItem["管理"]["評量名稱管理"].Image = Resources.評量名稱管理;
            rbItem["管理"]["評量名稱管理"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0000"].Executable;
            rbItem["管理"]["評量名稱管理"].Click += delegate
            {
                new JHSchool.Evaluation.CourseExtendControls.Ribbon.ExamManager().ShowDialog();
            };

            //rbItem["等第對照表"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["等第對照表"].Image = Resources.對照表;
            rbItem["管理"]["等第對照管理"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0031"].Executable;
            rbItem["管理"]["等第對照管理"].Click += delegate
            {
                new JHSchool.Evaluation.EduAdminExtendControls.Ribbon.ScoreMappingTable().ShowDialog();
            };
            #endregion

            #region 教務作業/成績作業
            rbItem["對照/代碼"].Image             = Properties.Resources.notepad_lock_64;
            rbItem["對照/代碼"].Size              = RibbonBarButton.MenuButtonSize.Large;
            rbItem["對照/代碼"]["文字描述代碼表"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0032"].Executable;
            rbItem["對照/代碼"]["文字描述代碼表"].Click += delegate
            {
                TextMappingTable text = new TextMappingTable();
                text.ShowDialog();
            };

            //rbItem["努力程度對照表"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["努力程度對照表"].Image = Resources.對照表;
            rbItem["對照/代碼"]["努力程度代碼表"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0030"].Executable;
            rbItem["對照/代碼"]["努力程度代碼表"].Click += delegate
            {
                new JHSchool.Evaluation.EduAdminExtendControls.Ribbon.EffortDegreeTable().ShowDialog();
            };
            EffortDegreeTable.CheckDefault();

            //如果需要此分類再進行應用
            rbItem["設定"].Image = Properties.Resources.sandglass_unlock_64;
            rbItem["設定"].Size  = RibbonBarButton.MenuButtonSize.Large;

            ScoreMappingTable.CheckDefault();

            //rbItem["課程規劃表"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["課程規劃表"].Image = ClassExtendControls.Ribbon.Resources.btnProgramPlan_Image;
            rbItem["設定"]["課程規劃表"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0050"].Executable;
            rbItem["設定"]["課程規劃表"].Click += delegate
            {
                new ProgramPlanManager().ShowDialog();
            };

            //rbItem["成績計算規則"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["成績計算規則"].Image = JHSchool.Evaluation.CourseExtendControls.Ribbon.Resources.course_plan;
            rbItem["設定"]["成績計算規則"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0040"].Executable;
            rbItem["設定"]["成績計算規則"].Click += delegate
            {
                //if (Control.ModifierKeys == Keys.Shift)
                new JHSchool.Evaluation.EduAdminExtendControls.Ribbon.ScoreCalcRuleManager().ShowDialog();
            };


            //移到成績計算模組。
            //rbItem["畢業資格審查"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0046"].Executable;
            //rbItem["畢業資格審查"].Image = JHSchool.Evaluation.CourseExtendControls.Ribbon.Resources.graduation_64;
            //rbItem["畢業資格審查"].Click += delegate
            //{
            //    Form form = new JHSchool.Evaluation.StudentExtendControls.Ribbon.GraduationInspectWizard("EduAdmin");
            //    form.ShowDialog();
            //};

            //rbItem["評量輸入狀況"].Image = Resources.成績輸入檢查;
            //rbItem["評量輸入狀況"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0020"].Executable;
            //rbItem["評量輸入狀況"].Click += delegate
            //{
            //    new JHSchool.Evaluation.EduAdminExtendControls.Ribbon.CourseScoreStatusForm().ShowDialog();
            //};

            //rbItem["評量設定"].Image = Resources.評量設定;
            //rbItem["評量設定"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0010"].Executable;
            //rbItem["評量設定"].Click += delegate
            //{
            //    new JHSchool.Evaluation.CourseExtendControls.Ribbon.AssessmentSetupManager().ShowDialog();
            //};

            //rbItem["特殊教育領域設定"].Image = Resources.;

            //rbItem["特殊教育領域設定"].Enable = true;
            //rbItem["特殊教育領域設定"].Click += delegate
            //{
            //    new SpecialEduDomainTable().ShowDialog();
            //};
            #endregion

            #endregion

            //--------------------------------下面還沒整理的分隔線--------------------------------

            #region 註冊權限管理

            //學生
            Catalog detail = RoleAclSource.Instance["學生"]["資料項目"];

            // 2017/5/9 穎驊  註解 下面位子 搬去 JHEvaluation.ScoreCalculation
            //detail.Add(new DetailItemFeature(typeof(SemesterScoreItem)));
            //detail.Add(new DetailItemFeature(typeof(GraduationScoreItem)));
            //detail.Add(new DetailItemFeature(typeof(CourseScoreItem)));

            Catalog ribbon = RoleAclSource.Instance["學生"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0055", "課程規劃"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0056", "計算規則"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0057", "計算成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0058", "畢業資格審查"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0059", "排名")); //程式碼移動到 JHEvaluation.Rating Module 中。

            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0180", "匯出學期科目成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0181", "匯出學期領域成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0182", "匯出畢業成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0183", "匯出課程成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0184", "匯出評量成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0169", "匯出學期歷程"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0190", "匯入學期科目成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0191", "匯入學期領域成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0192", "匯入畢業成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0193", "匯入課程成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0194", "匯入評量成績"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0170", "匯入學期歷程"));

            ribbon = RoleAclSource.Instance["學生"]["報表"];
            ribbon.Add(new ReportFeature("JHSchool.Student.Report0010", "畢業預警報表"));

            //班級
            ribbon = RoleAclSource.Instance["班級"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0055", "課程規劃"));
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0056", "計算規則"));
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0070", "班級開課"));

            ribbon = RoleAclSource.Instance["班級"]["報表"];
            ribbon.Add(new RibbonFeature("JHSchool.Class.Report0180", "學期優異表現名單"));

            //課程
            ribbon = RoleAclSource.Instance["課程"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0031", "匯出課程修課學生"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0021", "匯入課程修課學生"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon.AssignAssessmentSetup", "評量設定")); //增加權限控管 by dylan(2010/11/25)

            detail = RoleAclSource.Instance["課程"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(CourseExtendControls.BasicInfoItem)));
            detail.Add(new DetailItemFeature(typeof(CourseExtendControls.ScoreCalcSetupItem)));
            detail.Add(new DetailItemFeature(typeof(CourseExtendControls.SCAttendItem)));

            // //電子報表(因相關功能未完成先註)
            //detail.Add(new DetailItemFeature(typeof(CourseExtendControls.ElectronicPaperItem)));

            //教務作業
            ribbon = RoleAclSource.Instance["教務作業"];
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon.DomainList", "領域清單"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon.SubjectList", "科目清單"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0000", "評量名稱管理"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0010", "評量設定"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0020", "評量輸入狀況"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0030", "努力程度對照表"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0031", "等第對照表"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0032", "文字描述代碼表"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0040", "成績計算規則"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0045", "計算成績"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0046", "畢業資格審查"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0050", "課程規劃表"));

            //建文的舊功能
            //ribbon = RoleAclSource.Instance["學務作業"];
            //ribbon.Add(new RibbonFeature("JHSchool.StuAdmin.Ribbon0090.2", "幹部名稱管理"));
            //ribbon.Add(new RibbonFeature("JHSchool.StuAdmin.Ribbon0091", "班級幹部管理"));
            //ribbon.Add(new RibbonFeature("JHSchool.StuAdmin.Ribbon0092", "社團幹部管理"));
            //ribbon.Add(new RibbonFeature("JHSchool.StuAdmin.Ribbon0093", "學校幹部管理"));
            //ribbon.Add(new RibbonFeature("JHSchool.StuAdmin.Ribbon0094", "競賽項目管理"));
            #endregion

            Domain.TestDrive();
            Course.Instance.AddView(new TeacherCategoryView());

            // 2017/5/9 穎驊  註解 下面位子 搬去 JHEvaluation.ScoreCalculation
            // 學生學期歷程與學期成績學年度學期檢查
            //DataRationalityManager.Checks.Add(new StudentExtendControls.Ribbon.CheckStudentSemHistoryScoreRAT());
        }
示例#16
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtNewName.Text.Trim() == "")
                {
                    MsgBox.Show("姓名必填");
                    return;
                }

                if (string.IsNullOrEmpty(cbotStudentNumber.Text))
                {
                    Errors.SetError(cbotStudentNumber, "學號空白!");
                }

                string sid = string.Empty;
                if (_status == AddTransStudStatus.Added)
                {
                    JHSchool.Data.JHStudentRecord NewStudRec = new JHSchool.Data.JHStudentRecord();
                    NewStudRec.Name     = txtNewName.Text;
                    NewStudRec.Gender   = cboNewGender.Text;
                    NewStudRec.IDNumber = txtNewSSN.Text;
                    sid                   = JHSchool.Data.JHStudent.Insert(NewStudRec);
                    _StudentPhone         = JHSchool.Data.JHPhone.SelectByStudentID(sid);
                    _StudentPhone.Contact = txtNewTel.Text;
                }

                if (StudCheckTool.CheckStudIDNumberSame(txtNewSSN.Text, sid))
                {
                    FISCA.Presentation.Controls.MsgBox.Show("身分證號重複請檢查");
                    return;
                }

                Dictionary <string, int> chkSum = new Dictionary <string, int>();
                foreach (JHSchool.Data.JHStudentRecord studRec in JHSchool.Data.JHStudent.SelectAll())
                {
                    if (studRec.Status == K12.Data.StudentRecord.StudentStatus.一般)
                    {
                        if (!string.IsNullOrEmpty(studRec.StudentNumber))
                        {
                            if (chkSum.ContainsKey(studRec.StudentNumber))
                            {
                                chkSum[studRec.StudentNumber]++;
                            }
                            else
                            {
                                chkSum.Add(studRec.StudentNumber, 1);
                            }
                        }
                    }
                }

                if (chkSum.ContainsKey(cbotStudentNumber.Text))
                {
                    if (chkSum[cbotStudentNumber.Text] > 1)
                    {
                        FISCA.Presentation.Controls.MsgBox.Show("學號重複請檢查");
                        return;
                    }
                }

                if (!string.IsNullOrEmpty(sid))
                {
                    _student = JHSchool.Data.JHStudent.SelectByID(sid);
                }

                //_student.Name = txtNewName.Text;

                _student.IDNumber = txtNewSSN.Text;
                DateTime dt;
                if (DateTime.TryParse(dtNewBirthday.Text, out dt))
                {
                    _student.Birthday = dt;
                }

                //_student.Gender = cboNewGender.Text;
                _student.Nationality = cboNewNationality.Text;
                _student.BirthPlace  = txtNewBirthPlace.Text;
                //_StudentPhone.Contact = txtNewTel.Text;
                //_student.EnglishName = txtNewEngName.Text;

                foreach (JHSchool.Data.JHClassRecord cr in JHSchool.Data.JHClass.SelectAll())
                {
                    if (cboClass.Text == cr.Name)
                    {
                        _student.RefClassID = cr.ID;
                        break;
                    }
                }

                if (string.IsNullOrEmpty(cboSeatNo.Text))
                {
                    _student.SeatNo = null;
                }
                else
                {
                    int no;
                    int.TryParse(cboSeatNo.Text, out no);
                    _student.SeatNo = no;
                }
                _student.StudentNumber = cbotStudentNumber.Text;


                if (_status == AddTransStudStatus.Added)
                {
                }

                JHSchool.Data.JHStudent.Update(_student);
                JHSchool.Data.JHPhone.Update(_StudentPhone);


                //log
                JHSchool.PermRecLogProcess prlp = new JHSchool.PermRecLogProcess();
                if (_status == AddTransStudStatus.Added)
                {
                    prlp.SaveLog("學生.轉入異動", "新增班級資料", "修改轉入與班級資料.");
                }
                else
                {
                    prlp.SaveLog("學生.轉入異動", "修改班級資料", "修改轉入與班級資料.");
                }

                AddTransBackgroundManager.SetStudent(_student);

                AddTransManagerForm atmf = new AddTransManagerForm();
                this.Visible       = false;
                atmf.StartPosition = FormStartPosition.CenterParent;
                atmf.ShowDialog(FISCA.Presentation.MotherForm.Form);
                this.Close();
                JHSchool.Student.Instance.SyncAllBackground();
                JHSchool.Data.JHStudent.RemoveAll();
                JHSchool.Data.JHStudent.SelectAll();
            }
            catch (Exception ex)
            {
                FISCA.Presentation.Controls.MsgBox.Show(ex.Message);
                return;
            }
        }
示例#17
0
 public AddTransStudSemesterHistory(JHSchool.Data.JHStudentRecord studentRec)
 {
     InitializeComponent();
     studRec = studentRec;
     LoadStudSemesterHsitoryEntity();
 }
示例#18
0
        private void setTransClassAndCourse(AddTransStudBase.AddTransStudStatus status, JHSchool.Data.JHStudentRecord student)
        {
            if (item != null)
            {
                this.Visible = false;
                ITransStudBase tt = item.CreateForm();
                tt.SetData(student, status);
                tt.Display();
//                item.SetData(student, status);

                //ats.setStudent_Status(student, status);


                //item.CreateForm().StartPosition = FormStartPosition.CenterParent;
                //item.CreateForm().ShowDialog(FISCA.Presentation.MotherForm.Form);
            }
            else
            {
                AddTransStudBase ats = new AddTransStudBase();
                ats.setStudent_Status(student, status);
                this.Visible      = false;
                ats.StartPosition = FormStartPosition.CenterParent;
                ats.ShowDialog(FISCA.Presentation.MotherForm.Form);
            }
        }
示例#19
0
 /// <summary>
 /// 取得學生異動記錄資料。
 /// </summary>
 public static List <JHSchool.Data.JHUpdateRecordRecord> GetUpdateRecords(this JHSchool.Data.JHStudentRecord studentRec)
 {
     return(UpdateRecord.Instance[studentRec.ID]);
 }
示例#20
0
        protected override void OnSaveButtonClick(EventArgs e)
        {
            Errors.Clear();

            objStudent = JHSchool.Data.JHStudent.SelectByID(PrimaryKey);

            if (chkClassName() == false)
            {
                Errors.SetError(cboClass, "班級名稱錯誤!");
                return;
            }

            int tmpSeatNo = 0;

            int.TryParse(cboSeatNo.Text, out tmpSeatNo);

            if (tmpSeatNo < 1 && cboSeatNo.Text.Trim() != "")
            {
                Errors.SetError(cboSeatNo, "學生座號錯誤!");
                return;
            }

            // 檢查班級座號是否重複
            if (tmpSeatNo > 0)
            {
                if (_ClassSeatNoList.Contains(tmpSeatNo))
                {
                    // 是否是自己原本座號
                    if (this._DefaultSeatNo != cboSeatNo.Text.Trim())
                    {
                        Errors.SetError(cboSeatNo, "座號重複!");
                        return;
                    }
                }
            }

            // 更改學生班級
            if (_ClassNameIDDic.ContainsKey(cboClass.Text))
            {
                objStudent.RefClassID = _ClassNameIDDic[cboClass.Text];
            }

            // 當選空白時
            if ((cboClass.Text == "" && cboSeatNo.Text == "") || cboClass.Text == "<空白>")
            {
                objStudent.RefClassID = null;
            }

            // 檢查學號是否重複
            if (txtStudentNumber.Text != this._DefaultStudNum)
            {
                // 判斷是否是空
                if (string.IsNullOrEmpty(txtStudentNumber.Text))
                {
                    objStudent.StudentNumber = "";
                }
                else
                {
                    // 取得目前學生狀態
                    JHSchool.Data.JHStudentRecord.StudentStatus studtStatus = JHSchool.Data.JHStudent.SelectByID(PrimaryKey).Status;

                    List <string> checkData = new List <string>();
                    // 同狀態下學號不能重複
                    foreach (JHSchool.Data.JHStudentRecord studRec in JHSchool.Data.JHStudent.SelectAll())
                    {
                        if (studRec.Status == studtStatus)
                        {
                            checkData.Add(studRec.StudentNumber);
                        }
                    }

                    if (checkData.Contains(txtStudentNumber.Text))
                    {
                        Errors.SetError(txtStudentNumber, "學號重複!");
                        return;
                    }
                    objStudent.StudentNumber = txtStudentNumber.Text;
                }
            }

            if (tmpSeatNo > 0)
            {
                objStudent.SeatNo = tmpSeatNo;
            }
            else
            {
                objStudent.SeatNo = null;
            }
            JHSchool.Data.JHStudent.Update(objStudent);

            SaveButtonVisible   = false;
            CancelButtonVisible = false;

            prlp.SetAfterSaveText("班級", cboClass.Text);
            prlp.SetAfterSaveText("座號", cboSeatNo.Text);
            prlp.SetAfterSaveText("學號", txtStudentNumber.Text);
            prlp.SetActionBy("學籍", "學生班級資訊");
            prlp.SetAction("修改學生班級資訊");
            prlp.SetDescTitle("學生姓名:" + objStudent.Name + ",學號:" + objStudent.StudentNumber + ",");

            prlp.SaveLog("", "", "student", PrimaryKey);


            this._DefaultClassName = cboClass.Text;
            this._DefaultSeatNo    = cboSeatNo.Text;
            this._DefaultStudNum   = txtStudentNumber.Text;
            Student.Instance.SyncDataBackground(PrimaryKey);

            reloadChkdData();
        }
        private void SaveData()
        {
            // 當新增時才處理
            if (cbxSel.Enabled)
            {
                if (cbxSel.Text == "新生")
                {
                    bool checkSameUpdateCode1 = DAL.DALTransfer2.checkStudentSameUpdateCode(RunningID, _StudUpdateRecordEntity, "1");

                    if (checkSameUpdateCode1)
                    {
                        MsgBox.Show("已有1筆新生異動,請刪除後再新增");
                        return;
                    }
                }

                if (cbxSel.Text == "畢業")
                {
                    bool checkSameUpdateCode2 = DAL.DALTransfer2.checkStudentSameUpdateCode(RunningID, _StudUpdateRecordEntity, "2");

                    if (checkSameUpdateCode2)
                    {
                        MsgBox.Show("已有1筆畢業異動,請刪除後再新增");
                        return;
                    }
                }

                // 檢查同一天是否有相同異動
                bool checkSameUpdateDateAndCode = false;
                checkSameUpdateDateAndCode = DAL.DALTransfer2.checkStudentSameUpdateCode(RunningID, _StudUpdateRecordEntity);

                if (checkSameUpdateDateAndCode)
                {
                    if (MsgBox.Show("此異動日期已有相同異動,請問是否新增?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No)
                    {
                        return;
                    }
                }
            }


            // 儲存學年度學期 年級
            _StudUpdateRecordEntity.SchoolYear = intSchoolYear.Value;
            _StudUpdateRecordEntity.Semester   = intSemester.Value;
            _StudUpdateRecordEntity.SetGradeYear(intGradeYear.Text);

            // 儲存異動資料
            DAL.DALTransfer2.SetStudUpdateRecordEntity(_StudUpdateRecordEntity);


            // Log
            string strItemName = "學生姓名:" + JHSchool.Data.JHStudent.SelectByID(RunningID).Name + "," + prlp.GetAction() + ":";

            if (_StudUpdateRecordEntity.checkSameUpdateCode("1"))
            {
                strItemName += "新生異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("2"))
            {
                strItemName += "畢業異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("3"))
            {
                strItemName += "轉入異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("4"))
            {
                strItemName += "轉出異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("5"))
            {
                strItemName += "休學異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("6"))
            {
                strItemName += "復學異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("7"))
            {
                strItemName += "中輟異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("8"))
            {
                strItemName += "續讀異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("9"))
            {
                strItemName += "更正學籍異動";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("10"))
            {
                strItemName += "延長修業年限";
            }
            if (_StudUpdateRecordEntity.checkSameUpdateCode("11"))
            {
                strItemName += "死亡";
            }

            prlp.SetActionBy("學生", strItemName);
            prlp.SaveLog("", ":", "student", RunningID);

            JHSchool.Data.JHStudentRecord studRec = JHSchool.Data.JHStudent.SelectByID(RunningID);
            bool checkUpdateStudStatus            = false;

            List <string> tmpList0 = new List <string>();
            List <string> tmpList1 = new List <string>();
            List <string> tmpList2 = new List <string>();
            List <string> tmpList3 = new List <string>();

            foreach (JHSchool.Data.JHStudentRecord stud in JHSchool.Data.JHStudent.SelectAll())
            {
                if (stud.Status == K12.Data.StudentRecord.StudentStatus.一般)
                {
                    tmpList0.Add(stud.IDNumber);
                }

                if (stud.Status == K12.Data.StudentRecord.StudentStatus.畢業或離校)
                {
                    tmpList1.Add(stud.IDNumber);
                }
                if (stud.Status == K12.Data.StudentRecord.StudentStatus.休學)
                {
                    tmpList2.Add(stud.IDNumber);
                }
                if (stud.Status == K12.Data.StudentRecord.StudentStatus.輟學)
                {
                    tmpList3.Add(stud.IDNumber);
                }
            }

            // 轉出
            if (_StudUpdateRecordEntity.checkSameUpdateCode("4") || _StudUpdateRecordEntity.checkSameUpdateCode("11"))
            {
                if (MessageBox.Show("請問是否更改學生狀態成 離校?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    if (tmpList1.Contains(studRec.IDNumber))
                    {
                        MsgBox.Show("學生狀態 離校 有重複身分證號,請檢查後變更.");
                        return;
                    }
                    studRec.Status        = JHSchool.Data.JHStudentRecord.StudentStatus.畢業或離校;
                    checkUpdateStudStatus = true;
                    strItemName          += ",更改學生狀態成 離校";
                }
            }

            // 休學
            if (_StudUpdateRecordEntity.checkSameUpdateCode("5"))
            {
                if (MessageBox.Show("請問是否更改學生狀態成 休學?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    if (tmpList2.Contains(studRec.IDNumber))
                    {
                        MsgBox.Show("學生狀態 休學 有重複身分證號,請檢查後變更.");
                        return;
                    }

                    studRec.Status        = JHSchool.Data.JHStudentRecord.StudentStatus.休學;
                    checkUpdateStudStatus = true;
                    strItemName          += "更改學生狀態成 休學";
                }
            }

            // 中輟

            if (_StudUpdateRecordEntity.checkSameUpdateCode("7"))
            {
                if (MessageBox.Show("請問是否更改學生狀態成 輟學?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    if (tmpList3.Contains(studRec.IDNumber))
                    {
                        MsgBox.Show("學生狀態 輟學 有重複身分證號,請檢查後變更.");
                        return;
                    }

                    studRec.Status        = JHSchool.Data.JHStudentRecord.StudentStatus.輟學;
                    checkUpdateStudStatus = true;
                    strItemName          += "更改學生狀態成 輟學";
                }
            }


            // 處理復學轉成一般
            if (_StudUpdateRecordEntity.checkSameUpdateCode("6"))
            {
                if (MessageBox.Show("請問是否更改學生狀態成 一般?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    if (tmpList0.Contains(studRec.IDNumber))
                    {
                        MsgBox.Show("學生狀態 一般 有重複身分證號,請檢查後變更.");
                        return;
                    }

                    studRec.Status        = JHSchool.Data.JHStudentRecord.StudentStatus.一般;
                    checkUpdateStudStatus = true;
                    strItemName          += "更改學生狀態成 一般";
                }
            }



            //  prlp.SaveLog("學生.異動資料", prlp.GetAction(),"學生",RunningID , strItemName);

            if (checkUpdateStudStatus)
            {
                JHSchool.Data.JHStudent.Update(studRec);
                JHSchool.Student.Instance.SyncDataBackground(RunningID);
            }
            JHSchool.Permrec.UpdateRecord.Instance.SyncAllBackground();
            JHSchool.Student.Instance.SyncDataBackground(RunningID);

            prlp = null;
        }
示例#22
0
        public void SetupPresentation()
        {
            //CourseSyncAllBackground
            //2013/4/22 - 提供轉學模組更新學生清單
            FISCA.Features.Register("StudentSyncAllBackground", x =>
            {
                this.SyncAllBackground();
            });

            Student.Instance.RibbonBarItems["編輯"].Index   = 0;
            Student.Instance.RibbonBarItems["資料統計"].Index = 1;
            Student.Instance.RibbonBarItems["指定"].Index   = 2;
            Student.Instance.RibbonBarItems["教務"].Index   = 3;
            Student.Instance.RibbonBarItems["學務"].Index   = 4;

            #region RibbonBar 學生/編輯
            RibbonBarItem rbItem = Student.Instance.RibbonBarItems["編輯"];
            rbItem["新增"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["新增"].Image  = StudentExtendControls.Ribbon.Resources.btnAddStudent_Image;
            rbItem["新增"].Enable = User.Acl["JHSchool.Student.Ribbon0000"].Executable;
            rbItem["新增"].Click += delegate
            {
                IRewriteAPI_JH.IStudentAddStudentAPI item = FISCA.InteractionService.DiscoverAPI <IRewriteAPI_JH.IStudentAddStudentAPI>();
                if (item != null)
                {
                    item.CreateForm().ShowDialog();
                }
                else
                {
                    new JHSchool.StudentExtendControls.Ribbon.AddStudent().ShowDialog();
                }
            };

            rbItem["刪除"].Image  = StudentExtendControls.Ribbon.Resources.btnDeleteStudent_Image;
            rbItem["刪除"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["刪除"].Enable = User.Acl["JHSchool.Student.Ribbon0010"].Executable;
            rbItem["刪除"].Click += delegate
            {
                if (SelectedList.Count == 1)
                {
                    PermRecLogProcess             prlp    = new PermRecLogProcess();
                    JHSchool.Data.JHStudentRecord studRec = JHSchool.Data.JHStudent.SelectByID(SelectedList[0].ID);
                    string msg = string.Format("確定要刪除「{0}」?", studRec.Name);
                    if (FISCA.Presentation.Controls.MsgBox.Show(msg, "刪除學生", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        // 檢查刪除狀態是否有同學號或身分證號,空白可刪
                        List <string> tmpSnumList         = new List <string>();
                        List <string> tmpStudIDNumberList = new List <string>();
                        foreach (JHSchool.Data.JHStudentRecord checkStudRec in JHSchool.Data.JHStudent.SelectAll())
                        {
                            if (checkStudRec.Status == K12.Data.StudentRecord.StudentStatus.刪除)
                            {
                                if (!string.IsNullOrEmpty(checkStudRec.StudentNumber))
                                {
                                    tmpSnumList.Add(checkStudRec.StudentNumber);
                                }
                                if (!string.IsNullOrEmpty(checkStudRec.IDNumber))
                                {
                                    tmpStudIDNumberList.Add(checkStudRec.IDNumber);
                                }
                            }
                        }

                        if (tmpSnumList.Contains(studRec.StudentNumber) || tmpSnumList.Contains(studRec.IDNumber))
                        {
                            MsgBox.Show("刪除狀態有重複學號或身分證號,請先修改後再刪除!");
                            return;
                        }

                        // 修改學生狀態 delete
                        studRec.Status = K12.Data.StudentRecord.StudentStatus.刪除;
                        JHSchool.Data.JHStudent.Update(studRec);
                        Student.Instance.SyncDataBackground(studRec.ID);
                        prlp.SaveLog("學籍學生", "刪除學生", "刪除學生,姓名:" + studRec.Name + ",學號:" + studRec.StudentNumber);
                    }
                    else
                    {
                        return;
                    }
                }
            };

            #endregion

            #region RibbonBar 學生/匯入匯出
            rbItem = Student.Instance.RibbonBarItems["資料統計"];

            rbItem["匯出"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯出"].Image = Properties.Resources.Export_Image;
            //rbItem["匯出"]["學籍相關匯出"]["匯出學生基本資料"].Enable = User.Acl["JHSchool.Student.Ribbon0030"].Executable;
            //rbItem["匯出"]["學籍相關匯出"]["匯出學生基本資料"].Click += delegate
            //{
            //        new StudentExportWizard().ShowDialog();

            //};

            rbItem["匯入"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯入"].Image = Properties.Resources.Import_Image;
            //rbItem["匯入"]["學籍相關匯入"]["匯入學生基本資料"].Enable = User.Acl["JHSchool.Student.Ribbon0020"].Executable;
            //rbItem["匯入"]["學籍相關匯入"]["匯入學生基本資料"].Click += delegate
            //{
            //    IRewriteAPI_JH.IStudentImportWizardAPI item = FISCA.InteractionService.DiscoverAPI<IRewriteAPI_JH.IStudentImportWizardAPI>();
            //    if (item != null)
            //    {
            //        item.CreateForm().ShowDialog();
            //    }
            //    else
            //    {
            //        new StudentImportWizard().ShowDialog();
            //    }

            //};
            #endregion

            //報表,是以常態呈現
            rbItem["報表"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["報表"].Image = Properties.Resources.paste_64;
            rbItem["報表"].SupposeHasChildern = true;

            #region RibbonBar 學生/指定
            //由類別模組提供。
            //rbItem = Student.Instance.RibbonBarItems["指定"];
            //rbItem["類別"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["類別"].Image = InternalExtendControls.Tagging.Resources.ctxTag_Image;
            //rbItem["類別"].SupposeHasChildern = true;
            //rbItem["類別"].PopupOpen += new EventHandler<PopupOpenEventArgs>(
            //    new TaggingMenu("JHSchool.Student.Ribbon0040", "JHSchool.Student.Ribbon0050").MenuOpen);
            #endregion

            // 要放:班級、座號、姓名、性別、學號、聯絡電話、戶籍電話、聯絡地址、戶籍地址、出生年月日、監護人、課程規劃、帳號。

            #region List Panel Fields

            ListPaneField classNameField = new ListPaneField("班級");
            classNameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    var classRec = Student.Instance.Items[e.Key].Class;
                    e.Value = (classRec == null ? "" : classRec.Name);
                }
            };
            Student.Instance.AddListPaneField(classNameField);

            ListPaneField seatNoField = new ListPaneField("座號");
            seatNoField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].SeatNo;
                }
            };

            seatNoField.CompareValue += delegate(object sender, CompareValueEventArgs e)
            {
                int x, y;

                if (!int.TryParse(e.Value1.ToString(), out x))
                {
                    x = int.MaxValue;
                }

                if (!int.TryParse(e.Value2.ToString(), out y))
                {
                    y = int.MaxValue;
                }

                e.Result = x.CompareTo(y);
            };

            Student.Instance.AddListPaneField(seatNoField);

            ListPaneField nameField = new ListPaneField("姓名");
            nameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Name;
                }
            };
            Student.Instance.AddListPaneField(nameField);

            ListPaneField genderField = new ListPaneField("性別");
            genderField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].Gender;
                }
            };
            Student.Instance.AddListPaneField(genderField);

            ListPaneField studnumberField = new ListPaneField("學號");
            studnumberField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].StudentNumber;
                }
            };
            Student.Instance.AddListPaneField(studnumberField);

            ListPaneField birthday = new ListPaneField("生日");
            birthday.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].Birthday;
                }
            };
            Student.Instance.AddListPaneField(birthday);

            ListPaneField IDNumber = new ListPaneField("身分證號");
            IDNumber.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].IDNumber;
                }
            };
            if (User.Acl["Student.Field.身分證號"].Executable)
            {
                Student.Instance.AddListPaneField(IDNumber);
            }

            #endregion

            #region Student Views
            Student.Instance.AddView(new JHSchool.StudentExtendControls.GradeYear_Class_View());
            //Student.Instance.AddView(new JHSchool.StudentExtendControls.CategoryView());
            #endregion

            #region 學生基本資料(20140429)

            IRewriteAPI_JH.IStudentDetailItemAPI itemB = FISCA.InteractionService.DiscoverAPI <IRewriteAPI_JH.IStudentDetailItemAPI>();
            if (itemB != null)
            {
                Student.Instance.AddDetailBulider(itemB.CreateBasicInfo());
            }
            else
            {
                Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.StudentExtendControls.BaseInfoPalmerwormItem>());
            }
            #endregion

            //            Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.BaseInfoPalmerwormItem>());
            //            Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider<JHSchool.StudentExtendControls.SemesterHistoryDetail>());
            //Student.Instance.AddDetailBulider(new DetailBulider<JHSchool.StudentExtendControls.ClassItem>());
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.ClassInfoPalmerwormItem>());
            //文字評量(jenyu)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.WordCommentPalmerworm>());


            // 電子報表(因相關功能未完成先註)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.ElectronicPaperPalmerworm>());

            #region Search Conditions
            ConfigData cd = User.Configuration["StudentSearchOptionPreference"];

            SearchName = SearchConditionMenu["姓名"];
            SearchName.AutoCheckOnClick    = true;
            SearchName.AutoCollapseOnClick = false;
            SearchName.Checked             = cd.GetBoolean("SearchName", true);
            SearchName.Click += delegate
            {
                cd.SetBoolean("SearchName", SearchName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            // 因用班級 Search 未用到先註 2009/9/30
            //SearchClass = SearchConditionMenu["班級"];
            //SearchClass.AutoCheckOnClick = true;
            //SearchClass.AutoCollapseOnClick = false;
            //SearchClass.Checked = cd.GetBoolean("SearchClass", true);
            //SearchClass.Click += delegate
            //{
            //    cd.SetBoolean("SearchClass", SearchClass.Checked);

            //    BackgroundWorker async = new BackgroundWorker();
            //    async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
            //    async.RunWorkerAsync(cd);
            //};

            SearchStudentNumber = SearchConditionMenu["學號"];
            SearchStudentNumber.AutoCheckOnClick    = true;
            SearchStudentNumber.AutoCollapseOnClick = false;
            SearchStudentNumber.Checked             = cd.GetBoolean("SearchStudentNumber", true);
            SearchStudentNumber.Click += delegate
            {
                cd.SetBoolean("SearchStudentNumber", SearchStudentNumber.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentIDNumber = SearchConditionMenu["身分證號"];
            SearchStudentIDNumber.AutoCheckOnClick    = true;
            SearchStudentIDNumber.AutoCollapseOnClick = false;
            SearchStudentIDNumber.Checked             = cd.GetBoolean("SearchStudentIDNumber", true);
            SearchStudentIDNumber.Click += delegate
            {
                cd.SetBoolean("SearchStudentIDNumber", SearchStudentIDNumber.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentParent = SearchConditionMenu["父母監護人"];
            SearchStudentParent.AutoCheckOnClick    = true;
            SearchStudentParent.AutoCollapseOnClick = false;
            SearchStudentParent.Checked             = cd.GetBoolean("SearchStudentParent", false);
            SearchStudentParent.Click += delegate
            {
                cd.SetBoolean("SearchStudentParent", SearchStudentParent.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentLoginID = SearchConditionMenu["登入帳號"];
            SearchStudentLoginID.AutoCheckOnClick    = true;
            SearchStudentLoginID.AutoCollapseOnClick = false;
            SearchStudentLoginID.Checked             = cd.GetBoolean("SearchStudentLoginID", false);
            SearchStudentLoginID.Click += delegate
            {
                cd.SetBoolean("SearchStudentLoginID", SearchStudentLoginID.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchEnglishName = SearchConditionMenu["英文姓名"];
            SearchEnglishName.AutoCheckOnClick    = true;
            SearchEnglishName.AutoCollapseOnClick = false;
            SearchEnglishName.Checked             = cd.GetBoolean("SearchEnglishName", false);
            SearchEnglishName.Click += delegate
            {
                cd.SetBoolean("SearchEnglishName", SearchEnglishName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            Present.Search += new EventHandler <SearchEventArgs>(Student_Search);
            #endregion

            //缺曠記錄(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.AbsencePalmerwormItem>());
            //懲戒資料(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.DemeritPalmerwormItem>());
            //獎勵資料(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.MeritPalmerwormItem>());
            //測試的先註解了(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<CriticalSection.Dylan_Test_Item>());

            Present.NavPaneContexMenu.GetChild("重新整理").Click += delegate { this.SyncAllBackground(); };

            Present.Picture = Properties.Resources.StudentIcon;

            //由類別模組提供
            //Present.SetDescriptionPaneBulider(new DescriptionPaneBulider<StudentExtendControls.StudentDescription>());

            //Student.Instance.RequiredDescription += delegate(object sender, RequiredDescriptionEventArgs e)
            //{
            //    if (string.IsNullOrEmpty(e.PrimaryKey)) return;

            //    var studentRec = Student.Instance.Items[e.PrimaryKey];
            //    e.Result = studentRec.GetDescription();
            //};

            //var defaultContentBulider = new DetailBulider<StudentControls.DetailContent>();
            //defaultContentBulider.ContentBulided += delegate(object sender, ContentBulidedEventArgs<K12.StudentControls.DetailContent> e)
            //{
            //    _DetialContents.Add(e.Content);
            //    e.Content.Visible = UseDefaultDetailContent;
            //    e.Content.Disposed += delegate(object sender2, EventArgs e2)
            //    {
            //        _DetialContents.Remove((StudentControls.DetailContent)sender2);
            //    };
            //};
            //this.AddDetailBulider(defaultContentBulider);

            #region  限管理
            Catalog ribbon = RoleAclSource.Instance["學生"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0000", "新增學生"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0010", "刪除學生"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0020", "匯入學籍資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0030", "匯出學籍資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0040", "指定學生類別"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0050", "管理學生類別清單"));

            Catalog detail = RoleAclSource.Instance["學生"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(StudentExtendControls.BaseInfoPalmerwormItem)));
            //detail.Add(new DetailItemFeature(typeof(JHSchool.StudentExtendControls.SemesterHistoryDetail)));
            //電子報表(因相關功能未完成先註)
            //detail.Add(new DetailItemFeature(typeof(StudentExtendControls.ElectronicPaperPalmerworm)));

            //Student.Field.身分證號
            ribbon = RoleAclSource.Instance["學生"]["清單欄位"];
            ribbon.Add(new RibbonFeature("Student.Field.身分證號", "身分證號"));
            #endregion

            //#region 待刪除畢業及離校
            //GraduateList = new List<string>();
            //GraduateLeaveInfoU = getAllStudGraduateIDs("畢業", "學年度畢業");
            //GraduateLeaveInfoD = getAllStudGraduateIDs("修業", "學年度修業");
            //GraduateLeaveInfoAll = getAllStudGraduateIDByStatus("畢業或離校");

            //foreach (string str in GraduateLeaveInfoU.Keys)
            //    if (!GraduateList.Contains(str))
            //        GraduateList.Add(str);

            //foreach (string str in GraduateLeaveInfoD.Keys)
            //    if (!GraduateList.Contains(str))
            //        GraduateList.Add(str);

            //GraduateList.Add("離校(非畢修業)");

            //GraduateList.Sort();
            //#endregion

            foreach (string each in AllStatus)
            {
                CreateFilterItem(each);
            }


            //#region 待刪除畢業及離校

            //JHSchool.Data.JHStudent.AfterUpdate += delegate
            //{
            //    GraduateLeaveInfoAll = null;
            //    GraduateLeaveInfoD = null;
            //    GraduateLeaveInfoU = null;
            //    GraduateList = null;
            //    GraduateList = new List<string>();
            //    GraduateLeaveInfoU = getAllStudGraduateIDs("畢業", "學年度畢業");
            //    GraduateLeaveInfoD = getAllStudGraduateIDs("修業", "學年度修業");
            //    GraduateLeaveInfoAll = getAllStudGraduateIDByStatus("畢業或離校");
            //    foreach (string str in GraduateLeaveInfoU.Keys)
            //        if (!GraduateList.Contains(str))
            //            GraduateList.Add(str);

            //    foreach (string str in GraduateLeaveInfoD.Keys)
            //        if (!GraduateList.Contains(str))
            //            GraduateList.Add(str);

            //    GraduateList.Add("離校(非畢修業)");

            //    GraduateList.Sort();

            //    FillFilter();
            //};
            //#endregion

            bool havedef = false;
            foreach (string each in AllStatus)
            {
                havedef |= FilterMenu[each].Checked;
            }

            if (!havedef)
            {
                FilterMenu["一般"].Checked = true;
            }

            UseFilter = true;

            MotherForm.AddPanel(K12.Presentation.NLDPanels.Student);
            _Initilized = true;
            FillFilter();
        }
 /// <summary>
 /// 設定學生資料
 /// </summary>
 /// <param name="Student"></param>
 public static void SetStudent(JHSchool.Data.JHStudentRecord Student)
 {
     _Student = Student;
 }
示例#24
0
 public static StudentRecord AsOldStudent(this JHSchool.Data.JHStudentRecord student)
 {
     return(new StudentRecord(student));
 }
示例#25
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();
        }
示例#26
0
        public static void Main()
        {
            //診斷模式不要執行 UDM 更新。
            if (!RTContext.IsDiagMode)
            {
                ServerModule.AutoManaged("http://module.ischool.com.tw/module/137815/School_IBSH/udm.xml");
            }

            // 課程加入教師檢視
            Course.Instance.AddView(new TeacherCategoryView());

            //Sync UDT Table
            AccessHelper a = new AccessHelper();

            a.Select <ConductRecord>("uid is null");
            a.Select <CourseExtendRecord>("uid is null");
            a.Select <ConductSetting>("uid is null");
            a.Select <SubjectRecord>("uid is null");
            a.Select <GpaRef>("uid is null");

            #region  限註冊
            // 學生
            Catalog ribbon = RoleAclSource.Instance["學生"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0169", "匯出學期歷程"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0170", "匯入學期歷程"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.SubjectScoreCalculate", "計算科目成績"));
            ribbon = RoleAclSource.Instance["學生"]["資料項目"];
            ribbon.Add(new DetailItemFeature("JHSchool.Student.Detail.SemsScore", "學期成績"));

            //班級
            ribbon = RoleAclSource.Instance["班級"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0070", "班級開課"));
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0070.HrtConductInputForm", "指標輸入"));

            // 課程
            ribbon = RoleAclSource.Instance["課程"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0031", "匯出課程修課學生"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0021", "匯入課程修課學生"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0070.CourseScoreInputForm", "成績輸入"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0070.SubjectConductInputForm", "指標輸入"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0070.CourseGradeEditor", "批次修改開課年級"));
            ribbon = RoleAclSource.Instance["課程"]["資料項目"];
            ribbon.Add(new DetailItemFeature("JHSchool.Course.Detail.BasicInfo", "基本資料"));
            ribbon.Add(new DetailItemFeature("JHSchool.Course.Detail.AttendStudent", "修課學生"));

            //教務作業
            ribbon = RoleAclSource.Instance["教務作業"];
            //ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0000", "評量名稱管理"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon.SubjectManager", "科目資料管理"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.SetHoursOpeningForm", "開放時間管理"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.SubjectScoreCalculateByGradeyear", "批次計算科目成績"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.GpaRefForm", "歷屆GPA統計"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.SemsHistoryMaker", "產生學期歷程"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.CourseScoreStatusForm", "輸入狀況檢視(評量成績)"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.HRTConductStatusForm", "輸入狀況檢視(Conduct班導師)"));
            ribbon.Add(new RibbonFeature("CourseGradeB.EduAdminExtendControls.Ribbon.SubjectConductStatusForm", "輸入狀況檢視(Conduct授課老師)"));
            //ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon.ExamTemplateManager", "評分樣板設定"));

            //學務作業
            ribbon = RoleAclSource.Instance["學務作業"];
            ribbon.Add(new RibbonFeature("JHSchool.StuAdmin.Ribbon.ConductTitleManager", "指標管理"));
            #endregion

            #region 資料項目
            // 基本資料
            //Course.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<BasicInfoItem>());
            Course.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider <BasicInfoItem>());

            // 修課學生
            Course.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider <SCAttendItem>());

            // 學期成績
            Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider <SemsSubjScoreItem>());

            #endregion

            #region 課程/編輯
            RibbonBarItem   rbItem = Student.Instance.RibbonBarItems["教務"];
            RibbonBarButton rbButton;
            rbItem          = Course.Instance.RibbonBarItems["編輯"];
            rbButton        = rbItem["新增"];
            rbButton.Size   = RibbonBarButton.MenuButtonSize.Large;
            rbButton.Image  = Properties.Resources.btnAddCourse;
            rbButton.Enable = User.Acl["JHSchool.Course.Ribbon0000"].Executable;
            rbButton.Click += delegate
            {
                new CourseGradeB.CourseExtendControls.Ribbon.AddCourse().ShowDialog();
            };

            rbButton        = rbItem["刪除"];
            rbButton.Size   = RibbonBarButton.MenuButtonSize.Large;
            rbButton.Image  = Properties.Resources.btnDeleteCourse;
            rbButton.Enable = User.Acl["JHSchool.Course.Ribbon0010"].Executable;
            rbButton.Click += delegate
            {
                if (Course.Instance.SelectedKeys.Count == 1)
                {
                    JHSchool.Data.JHCourseRecord record = JHSchool.Data.JHCourse.SelectByID(Course.Instance.SelectedKeys[0]);
                    //int CourseAttendCot = Course.Instance.Items[record.ID].GetAttendStudents().Count;
                    List <JHSchool.Data.JHSCAttendRecord> scattendList = JHSchool.Data.JHSCAttend.SelectByStudentIDAndCourseID(new List <string>()
                    {
                    }, new List <string>()
                    {
                        record.ID
                    });
                    int attendStudentCount = 0;
                    foreach (JHSchool.Data.JHSCAttendRecord scattend in scattendList)
                    {
                        if (scattend.Student.Status == K12.Data.StudentRecord.StudentStatus.一般)
                        {
                            attendStudentCount++;
                        }
                    }

                    if (attendStudentCount > 0)
                    {
                        MsgBox.Show(record.Name + " 有" + attendStudentCount.ToString() + "位修課學生,請先移除修課學生後再刪除課程.");
                    }
                    else
                    {
                        string msg = string.Format("確定要刪除「{0}」?", record.Name);
                        if (MsgBox.Show(msg, "刪除課程", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            #region 自動刪除非一般學生的修課記錄
                            List <JHSchool.Data.JHSCAttendRecord> deleteSCAttendList = new List <JHSchool.Data.JHSCAttendRecord>();
                            foreach (JHSchool.Data.JHSCAttendRecord scattend in scattendList)
                            {
                                JHSchool.Data.JHStudentRecord stuRecord = JHSchool.Data.JHStudent.SelectByID(scattend.RefStudentID);
                                if (stuRecord == null)
                                {
                                    continue;
                                }
                                if (stuRecord.Status != K12.Data.StudentRecord.StudentStatus.一般)
                                {
                                    deleteSCAttendList.Add(scattend);
                                }
                            }
                            List <string> studentIDs = new List <string>();
                            foreach (JHSchool.Data.JHSCAttendRecord scattend in deleteSCAttendList)
                            {
                                studentIDs.Add(scattend.RefStudentID);
                            }
                            List <JHSchool.Data.JHSCETakeRecord> sceList = JHSchool.Data.JHSCETake.SelectByStudentAndCourse(studentIDs, new List <string>()
                            {
                                record.ID
                            });
                            JHSchool.Data.JHSCETake.Delete(sceList);
                            JHSchool.Data.JHSCAttend.Delete(deleteSCAttendList);
                            #endregion

                            JHSchool.Data.JHCourse.Delete(record);

                            //刪除CourseExtendRecord
                            List <CourseExtendRecord> list = a.Select <CourseExtendRecord>("ref_course_id=" + record.ID);
                            if (list.Count > 0)
                            {
                                a.DeletedValues(list);
                            }

                            // 加這主要是重新整理
                            Course.Instance.SyncDataBackground(record.ID);
                        }
                        else
                        {
                            return;
                        }
                    }
                }
            };

            RibbonBarButton CouItem = Course.Instance.RibbonBarItems["編輯"]["刪除"];
            Course.Instance.SelectedListChanged += delegate
            {
                // 課程刪除不能多選
                CouItem.Enable = (Course.Instance.SelectedList.Count < 2) && User.Acl["JHSchool.Course.Ribbon0010"].Executable;
            };

            //指定評分樣板
            //CouItem = Course.Instance.RibbonBarItems["指定"]["指定評分樣板"];
            //Course.Instance.SelectedListChanged += delegate
            //{
            //    CouItem.Enable = (Course.Instance.SelectedList.Count > 0);
            //};
            //CouItem.Click += delegate
            //{
            //    new CourseGradeB.CourseExtendControls.Ribbon.GiveRefExamTemplateForm(K12.Presentation.NLDPanels.Course.SelectedSource).ShowDialog();
            //};

            RibbonBarItem scores = JHSchool.Course.Instance.RibbonBarItems["教務"];
            scores["成績輸入"].Size   = RibbonBarButton.MenuButtonSize.Medium;
            scores["成績輸入"].Image  = Properties.Resources.exam_write_64;
            scores["成績輸入"].Enable = Framework.User.Acl["JHSchool.Course.Ribbon0070.CourseScoreInputForm"].Executable;
            scores["成績輸入"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Course.SelectedSource.Count == 1)
                {
                    CourseRecord courseRecord = Course.Instance.SelectedList[0];
                    //int key = int.Parse(courseRecord.ID);
                    //int value = Global.Instance.CourseExtendCatch.ContainsKey(key) ? Global.Instance.CourseExtendCatch[key] : -1;
                    //if (value == -1)
                    //     FISCA.Presentation.Controls.MsgBox.Show("課程 '" + courseRecord.Name + "' 沒有評量設定。");
                    //else
                    new CourseGradeB.CourseExtendControls.Ribbon.CourseScoreInputForm(courseRecord).ShowDialog();
                }
            };
            K12.Presentation.NLDPanels.Course.SelectedSourceChanged += delegate
            {
                scores["成績輸入"].Enable = K12.Presentation.NLDPanels.Course.SelectedSource.Count == 1 && Framework.User.Acl["JHSchool.Course.Ribbon0070.CourseScoreInputForm"].Executable;
            };

            RibbonBarItem conduct = JHSchool.Course.Instance.RibbonBarItems["教務"];
            conduct["指標輸入"].Size   = RibbonBarButton.MenuButtonSize.Medium;
            conduct["指標輸入"].Image  = Properties.Resources.exam_write_64;
            conduct["指標輸入"].Enable = Framework.User.Acl["JHSchool.Course.Ribbon0070.SubjectConductInputForm"].Executable;
            conduct["指標輸入"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Course.SelectedSource.Count == 1)
                {
                    CourseRecord courseRecord = Course.Instance.SelectedList[0];
                    new CourseGradeB.CourseExtendControls.Ribbon.SubjectConductInputForm(courseRecord).ShowDialog();
                }
            };
            K12.Presentation.NLDPanels.Course.SelectedSourceChanged += delegate
            {
                conduct["指標輸入"].Enable = K12.Presentation.NLDPanels.Course.SelectedSource.Count == 1 && Framework.User.Acl["JHSchool.Course.Ribbon0070.SubjectConductInputForm"].Executable;
            };

            RibbonBarItem editGrade = JHSchool.Course.Instance.RibbonBarItems["指定"];
            editGrade["批次修改開課年級"].Size   = RibbonBarButton.MenuButtonSize.Medium;
            editGrade["批次修改開課年級"].Image  = Properties.Resources.record_b_write_64;
            editGrade["批次修改開課年級"].Enable = Framework.User.Acl["JHSchool.Course.Ribbon0070.CourseGradeEditor"].Executable;
            editGrade["批次修改開課年級"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Course.SelectedSource.Count > 0)
                {
                    new CourseGradeB.CourseExtendControls.Ribbon.CourseGradeEditor(K12.Presentation.NLDPanels.Course.SelectedSource).ShowDialog();
                }
            };
            K12.Presentation.NLDPanels.Course.SelectedSourceChanged += delegate
            {
                editGrade["批次修改開課年級"].Enable = K12.Presentation.NLDPanels.Course.SelectedSource.Count > 0 && Framework.User.Acl["JHSchool.Course.Ribbon0070.CourseGradeEditor"].Executable;
            };

            #endregion

            #region 匯出/匯入

            RibbonBarButton rbItemExport = Student.Instance.RibbonBarItems["資料統計"]["匯出"];
            RibbonBarButton rbItemImport = Student.Instance.RibbonBarItems["資料統計"]["匯入"];

            rbItemExport["成績相關匯出"]["匯出學期歷程"].Enable = User.Acl["JHSchool.Student.Ribbon0169"].Executable;
            rbItemExport["成績相關匯出"]["匯出學期歷程"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter    exporter = new CourseGradeB.ImportExport.ExportSemesterHistory();
                CourseGradeB.ImportExport.ExportStudentV2 wizard   = new CourseGradeB.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            rbItemImport["成績相關匯入"]["匯入學期歷程"].Enable = User.Acl["JHSchool.Student.Ribbon0170"].Executable;
            rbItemImport["成績相關匯入"]["匯入學期歷程"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer    importer = new CourseGradeB.ImportExport.ImportSemesterHistory();
                CourseGradeB.ImportExport.ImportStudentV2 wizard   = new CourseGradeB.ImportExport.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };

            RibbonBarItem rbItemCourseImportExport = Course.Instance.RibbonBarItems["資料統計"];
            rbItemCourseImportExport["匯出"]["匯出課程修課學生"].Enable = User.Acl["JHSchool.Course.Ribbon0031"].Executable;
            rbItemCourseImportExport["匯出"]["匯出課程修課學生"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter           exporter = new CourseGradeB.ImportExport.Course.ExportCourseStudents("");
                CourseGradeB.ImportExport.Course.ExportStudentV2 wizard   = new CourseGradeB.ImportExport.Course.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };
            rbItemCourseImportExport["匯入"]["匯入課程修課學生"].Enable = User.Acl["JHSchool.Course.Ribbon0021"].Executable;
            rbItemCourseImportExport["匯入"]["匯入課程修課學生"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer           importer = new CourseGradeB.ImportExport.Course.ImportCourseStudents("");
                CourseGradeB.ImportExport.Course.ImportStudentV2 wizard   = new CourseGradeB.ImportExport.Course.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };

            #endregion

            #region 班級功能

            rbButton                = K12.Presentation.NLDPanels.Class.RibbonBarItems["教務"]["班級開課"];
            rbButton.Enable         = User.Acl["JHSchool.Class.Ribbon0070"].Executable;
            rbButton.Image          = Properties.Resources.organigram_refresh_64;
            rbButton["直接開課"].Click += delegate
            {
                if (Class.Instance.SelectedList.Count > 0)
                {
                    new CourseGradeB.ClassExtendControls.Ribbon.CreateCoursesDirectly();
                }
            };

            RibbonBarItem hrtConduct = JHSchool.Class.Instance.RibbonBarItems["教務"];
            hrtConduct["指標輸入"].Size   = RibbonBarButton.MenuButtonSize.Medium;
            hrtConduct["指標輸入"].Image  = Properties.Resources.exam_write_64;
            hrtConduct["指標輸入"].Enable = Framework.User.Acl["JHSchool.Class.Ribbon0070.HrtConductInputForm"].Executable;
            hrtConduct["指標輸入"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Class.SelectedSource.Count == 1)
                {
                    new CourseGradeB.ClassExtendControls.Ribbon.HrtSelectSchoolYear(K12.Presentation.NLDPanels.Class.SelectedSource[0]).ShowDialog();
                }
            };
            K12.Presentation.NLDPanels.Class.SelectedSourceChanged += delegate
            {
                hrtConduct["指標輸入"].Enable = K12.Presentation.NLDPanels.Class.SelectedSource.Count == 1 && Framework.User.Acl["JHSchool.Class.Ribbon0070.HrtConductInputForm"].Executable;
            };

            #endregion

            #region 教務作業功能
            FISCA.Presentation.RibbonBarItem eduitem1 = FISCA.Presentation.MotherForm.RibbonBarItems["教務作業", "基本設定"];
            eduitem1["對照/代碼"].Image = Properties.Resources.notepad_lock_64;
            eduitem1["對照/代碼"].Size  = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;

            FISCA.Presentation.RibbonBarItem eduitem2 = FISCA.Presentation.MotherForm.RibbonBarItems["教務作業", "批次作業/檢視"];
            eduitem2["成績作業"].Image = Properties.Resources.calc_save_64;
            eduitem2["成績作業"].Size  = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;

            eduitem2["成績作業"]["批次計算科目成績"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.SubjectScoreCalculateByGradeyear"].Executable;
            eduitem2["成績作業"]["批次計算科目成績"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.SubjectScoreCalculateByGradeyear().ShowDialog();
            };

            eduitem2["成績作業"]["歷屆GPA統計"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.GpaRefForm"].Executable;
            eduitem2["成績作業"]["歷屆GPA統計"].Click += delegate
            {
                new GpaRefForm().ShowDialog();
            };

            //產生學期歷程
            eduitem2["成績作業"]["產生學期歷程"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.SemsHistoryMaker"].Executable;

            eduitem2["成績作業"]["產生學期歷程"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.SemsHistoryMaker().ShowDialog();
            };

            //評量輸入狀況檢視
            eduitem2["成績作業"]["輸入狀況檢視(評量成績)"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.CourseScoreStatusForm"].Executable;

            eduitem2["成績作業"]["輸入狀況檢視(評量成績)"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.CourseScoreStatusForm().ShowDialog();
            };

            //Conduct輸入狀況檢視(班導師)
            eduitem2["成績作業"]["輸入狀況檢視(Conduct、StandardBase班導師)"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.HRTConductStatusForm"].Executable;

            eduitem2["成績作業"]["輸入狀況檢視(Conduct、StandardBase班導師)"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.HRTConductStatusForm().ShowDialog();
            };

            //Conduct輸入狀況檢視(授課老師)
            eduitem2["成績作業"]["輸入狀況檢視(Conduct、StandardBase授課老師)"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.SubjectConductStatusForm"].Executable;

            eduitem2["成績作業"]["輸入狀況檢視(Conduct、StandardBase授課老師)"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.SubjectConductStatusForm().ShowDialog();
            };

            RibbonBarItem eduitem3 = EduAdmin.Instance.RibbonBarItems["基本設定"];
            eduitem3["管理"].Size  = RibbonBarButton.MenuButtonSize.Large;
            eduitem3["管理"].Image = Properties.Resources.network_lock_64;

            //rbItem["管理"]["評量名稱管理"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0000"].Executable;
            //rbItem["管理"]["評量名稱管理"].Click += delegate
            //{
            //    new CourseGradeB.CourseExtendControls.Ribbon.ExamManager().ShowDialog();
            //};

            eduitem3["管理"]["科目資料管理"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon.SubjectManager"].Executable;
            eduitem3["管理"]["科目資料管理"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.SubjectManager().ShowDialog();
            };

            eduitem3["管理"]["開放時間管理"].Enable = User.Acl["CourseGradeB.EduAdminExtendControls.Ribbon.SetHoursOpeningForm"].Executable;
            eduitem3["管理"]["開放時間管理"].Click += delegate
            {
                new CourseGradeB.EduAdminExtendControls.Ribbon.SetHoursOpeningForm().ShowDialog();
            };

            //rbItem["設定"].Image = Properties.Resources.sandglass_unlock_64;
            //rbItem["設定"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["設定"]["評分樣板設定"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon.ExamTemplateManager"].Executable;
            //rbItem["設定"]["評分樣板設定"].Click += delegate
            //{
            //    new CourseGradeB.EduAdminExtendControls.Ribbon.ExamTemplateManager().ShowDialog();
            //};

            #endregion

            #region 學務作業功能
            FISCA.Presentation.RibbonBarItem stuitem1 = FISCA.Presentation.MotherForm.RibbonBarItems["學務作業", "基本設定"];
            //item3["管理"].Image = Properties.Resources.network_lock_64;
            //item3["管理"].Size = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;
            stuitem1["管理"]["指標管理"].Enable = User.Acl["JHSchool.StuAdmin.Ribbon.ConductTitleManager"].Executable;
            stuitem1["管理"]["指標管理"].Click += delegate
            {
                new CourseGradeB.StuAdminExtendControls.ConductSettingForm().ShowDialog();
            };
            #endregion

            #region 學生功能
            //註冊成績計算功能項目。
            FISCA.Presentation.RibbonBarItem student_rbitem = FISCA.Presentation.MotherForm.RibbonBarItems["學生", "教務"];
            student_rbitem["成績作業"].Size             = RibbonBarButton.MenuButtonSize.Large;
            student_rbitem["成績作業"].Image            = Properties.Resources.calc_save_64;
            student_rbitem["成績作業"]["計算科目成績"].Enable = false;
            K12.Presentation.NLDPanels.Student.SelectedSourceChanged += delegate
            {
                student_rbitem["成績作業"]["計算科目成績"].Enable = K12.Presentation.NLDPanels.Student.SelectedSource.Count > 0 && User.Acl["JHSchool.Student.SubjectScoreCalculate"].Executable;
            };

            student_rbitem["成績作業"]["計算科目成績"].Click += delegate
            {
                new CourseGradeB.StudentExtendControls.Ribbon.SubjectScoreCalculate(K12.Presentation.NLDPanels.Student.SelectedSource).ShowDialog();
            };
            #endregion

            //教師系統類別
            Tagging.Main();
            ResCourseData();
        }
示例#27
0
 /// <summary>
 /// 取得學生異動記錄資料。
 /// </summary>
 public static JHSchool.Data.JHBeforeEnrollmentRecord  GetUpdateRecords(this JHSchool.Data.JHStudentRecord studentRec)
 {
     return(BeforeInfoRec.Instance[studentRec.ID]);
 }