Ejemplo n.º 1
0
        private void JHAssessmentSetup_AfterInsert(object sender, K12.Data.DataChangedEventArgs e)
        {
            if (e.PrimaryKeys.Count > 0)
            {
                if (cboExistTemplates.Enabled == true && cboExistTemplates.SelectedItem is JHAssessmentSetupRecord)
                {
                    JHAssessmentSetupRecord source = cboExistTemplates.SelectedItem as JHAssessmentSetupRecord;
                    bool executeRequired           = false;

                    List <JHAEIncludeRecord> aeincludes = new List <JHAEIncludeRecord>();
                    foreach (JHAEIncludeRecord each in JHAEInclude.SelectByAssessmentSetupID(source.ID))
                    {
                        JHAEIncludeRecord aeNew = new JHAEIncludeRecord();
                        aeNew.RefAssessmentSetupID = e.PrimaryKeys[0];
                        aeNew.RefExamID            = each.RefExamID;
                        aeNew.UseScore             = each.UseScore;
                        aeNew.UseText   = each.UseText;
                        aeNew.UseEffort = each.UseEffort;
                        aeNew.Weight    = each.Weight;
                        aeNew.StartTime = each.StartTime;
                        aeNew.EndTime   = each.EndTime;

                        aeincludes.Add(aeNew);
                        executeRequired = true;
                    }
                    if (executeRequired)
                    {
                        JHAEInclude.Insert(aeincludes);
                    }
                }
            }
            JHAssessmentSetup.AfterInsert -= new EventHandler <K12.Data.DataChangedEventArgs>(JHAssessmentSetup_AfterInsert);
        }
 private void JHAssessmentSetup_AfterChanged(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (e.PrimaryKeys.Count > 0)
     {
         RefreshItemPanel(e.PrimaryKeys[0]);
     }
 }
 private void JHClass_AfterChange(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (e.PrimaryKeys.Contains(PrimaryKey))
     {
         OnPrimaryKeyChanged(EventArgs.Empty);
     }
 }
Ejemplo n.º 4
0
        void JHTagConfig_AfterInsert(object sender, K12.Data.DataChangedEventArgs e)
        {
            foreach (string each in e.PrimaryKeys)
            {
                JHTagConfigRecord rec = JHTagConfig.SelectByID(each);

                if (rec != null)
                {
                    if (Editors.ContainsKey(each))
                    {
                        Editors[each] = rec;
                    }
                    else
                    {
                        Editors.Add(each, rec);
                    }
                }
                else
                {
                    if (Editors.ContainsKey(each))
                    {
                        Editors.Remove(each);
                    }
                    else
                    {
                        throw new ArgumentException(string.Format("Tag 錯誤,編號:{0}", each));
                    }
                }
            }

            RefreshTagData();
        }
 private void JHProgramPlan_AfterChanged(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (e.PrimaryKeys.Count > 0)
     {
         cboProgramPlan.SuspendLayout();
         cboProgramPlan.Items.Clear();
         InitialProgramPlanList();
         OnPrimaryKeyChanged(EventArgs.Empty);
         cboProgramPlan.ResumeLayout();
     }
 }
Ejemplo n.º 6
0
 private void JHCourse_AfterChange(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (InvokeRequired)
     {
         this.Invoke(courseChangedEventHandler, new object[] { sender, e });
     }
     else
     {
         if (e.PrimaryKeys.Contains(PrimaryKey))
         {
             OnPrimaryKeyChanged(EventArgs.Empty);
         }
     }
 }
Ejemplo n.º 7
0
 void JHClass_AfterChange(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new Action <object, K12.Data.DataChangedEventArgs>(JHClass_AfterChange), sender, e);
     }
     else
     {
         if (PrimaryKey != "")
         {
             if (!_BGWorker.IsBusy)
             {
                 _BGWorker.RunWorkerAsync();
             }
         }
     }
 }
Ejemplo n.º 8
0
 void JHBeforeEnrollment_AfterUpdate(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new Action <object, K12.Data.DataChangedEventArgs>(JHBeforeEnrollment_AfterUpdate), sender, e);
     }
     else
     {
         if (PrimaryKey != "")
         {
             if (!_worker.IsBusy)
             {
                 _worker.RunWorkerAsync();
             }
         }
     }
 }
Ejemplo n.º 9
0
 void JHSemesterHistory_AfterUpdate(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new Action <object, K12.Data.DataChangedEventArgs>(JHSemesterHistory_AfterUpdate), sender, e);
     }
     else
     {
         if (PrimaryKey != "")
         {
             if (!BGWorker.IsBusy)
             {
                 BGWorker.RunWorkerAsync();
             }
         }
     }
 }
Ejemplo n.º 10
0
 void JHPhone_AfterUpdate(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new Action <object, K12.Data.DataChangedEventArgs>(JHPhone_AfterUpdate), sender, e);
     }
     else
     {
         if (PrimaryKey != "")
         {
             if (!_bwWork.IsBusy)
             {
                 _bwWork.RunWorkerAsync();
             }
         }
     }
 }
Ejemplo n.º 11
0
 void JHStudent_AfterChange(object sender, K12.Data.DataChangedEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new Action <object, K12.Data.DataChangedEventArgs>(JHStudent_AfterChange), sender, e);
     }
     else
     {
         if (this.PrimaryKey != "")
         {
             if (!BGWork.IsBusy)
             {
                 BGWork.RunWorkerAsync();
             }
         }
     }
 }
Ejemplo n.º 12
0
 void SHUpdateRecord_AfterChange(object sender, K12.Data.DataChangedEventArgs e)
 {
     ReloadData();
 }
Ejemplo n.º 13
0
 void JHTeacher_AfterDelete(object sender, K12.Data.DataChangedEventArgs e)
 {
     Teacher.Instance.SyncAllBackground();
 }
Ejemplo n.º 14
0
 void JHStudent_AfterDelete(object sender, K12.Data.DataChangedEventArgs e)
 {
     JHSchool.Student.Instance.SyncAllBackground();
 }