public void Save()
 {
     if (EditorStatus != EditorStatus.NoChanged)
     {
         EditScoreCalcRule.SaveScoreCalcRuleRecordEditor(new ScoreCalcRuleRecordEditor[] { this });
     }
 }
 private void btn_update_Click(object sender, EventArgs e)
 {
     if (this.scoreCalcRuleEditor1.IsValidated)
     {
         EditScoreCalcRule.Update((_SelectItem.Tag as ScoreCalcRuleInfo).ID, (_SelectItem.Tag as ScoreCalcRuleInfo).Name, this.scoreCalcRuleEditor1.GetSource());
         ScoreCalcRule.ScoreCalcRule.Instance.Invok_ScoreCalcRuleUpdated();
     }
 }
Esempio n. 3
0
        private void frm_SaveEvent(object sender, FrmReviseRuleName.ReviseRuleNameEventArgs e)
        {
            if (_SelectItem == null)
            {
                return;
            }

            if (e.IsSame == true)
            {
                return;
            }

            EditScoreCalcRule.Update(_SelectItem.Name, e.NewFullName, this.scoreCalcRuleEditor1.GetSource(e.NewSchoolYear));
            SetAdvTreeExpandStatus(e.NewSchoolYear, true);
            ScoreCalcRule.ScoreCalcRule.Instance.Invok_ScoreCalcRuleUpdated();
        }
Esempio n. 4
0
 private void btn_update_Click(object sender, EventArgs e)
 {
     if (_SelectItem == null)
     {
         return;
     }
     if (this.scoreCalcRuleEditor1.IsValidated)
     {
         SaveAdvTreeExpandStatus();
         string schoolYear = _SelectItem.Parent.TagString;
         string id         = _SelectItem.Name;
         string name       = schoolYear + (_SelectItem.Tag as ScoreCalcRuleInfo).TrimName;
         EditScoreCalcRule.Update(id, name, this.scoreCalcRuleEditor1.GetSource(schoolYear));
         ScoreCalcRule.ScoreCalcRule.Instance.Invok_ScoreCalcRuleUpdated();
     }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool allPass = true;

            foreach (IMoralConductInstance var in _Instances)
            {
                allPass &= var.IsValidate;
            }
            if (allPass)
            {
                foreach (IMoralConductInstance var in _Instances)
                {
                    XmlElement element    = (XmlElement)_MoralConductElement.SelectSingleNode(var.XPath);
                    XmlElement newelement = var.GetSource();
                    if (element != null)
                    {
                        if (element.OwnerDocument != newelement.OwnerDocument)
                        {
                            newelement = (XmlElement)element.OwnerDocument.ImportNode(newelement, true);
                        }

                        _MoralConductElement.ReplaceChild(newelement, element);
                    }
                    else
                    {
                        _MoralConductElement.AppendChild(_MoralConductElement.OwnerDocument.ImportNode(newelement, true));
                    }
                }
                EditScoreCalcRule.SetMoralConductCalcRule(_MoralConductElement);

                foreach (IMoralConductInstance var in _Instances)
                {
                    var.SetDependenceData();
                }
                MotherForm.SetStatusBarMessage("德行成績規則儲存完成。");
                OnActive();
            }
            else
            {
                MsgBox.Show("資料有誤,無法儲存。\n請檢查輸入資料。");
            }
        }
 public static void SaveAllEditors(this IEnumerable <ScoreCalcRuleRecordEditor> editors)
 {
     EditScoreCalcRule.SaveScoreCalcRuleRecordEditor(editors);
 }