Example #1
0
 void _data_Changed(object sender, DataBaseEventArgs args)
 {
     if (!lblReceptName.Text.Equals(_data.Name))
     {
         lblReceptName.Text = _data.Name;
     }
     if (!rtbProcess.Text.Equals(_data.process))
     {
         rtbProcess.Text = _data.process;
     }
     //throw new Exception("The method or operation is not implemented.");
 }
Example #2
0
 void _data_Changed(object sender, DataBaseEventArgs args)
 {
     if (!lblReceptName.Text.Equals(_data.Name))
     {
         lblReceptName.Text = _data.Name;
     }
     if (!rtbFactor.Text.Equals(_data.MicroBiology))
     {
         //rtbFactor.Text = _data.MicroBiology;
     }
     //throw new Exception("The method or operation is not implemented.");
 }
Example #3
0
 protected virtual void OnChanged(DataBaseEventArgs args)
 {
     if (!onUpdate)
     {
         m_isChanged = true;
         if (Changed != null)
         {
             Changed(this, args);
         }
         if (myParent != null)
         {
             myParent.Update(args);
         }
     }
 }
Example #4
0
 void curData_Changed(object sender, DataBaseEventArgs e)
 {
     foreach (TreeNode curNode in tvBook.Nodes)
     {
         UpdateTreeNode(curNode, e.IsMainDataChanged);
     }
     if (e.IsMainDataChanged)
     {
         TreeNode selectedNode = tvBook.SelectedNode;
         tvBook.Sort();
         if (selectedNode != null)
         {
             tvBook.SelectedNode = selectedNode;
         }
     }
 }
Example #5
0
        void _data_Changed(object sender, DataBaseEventArgs args)
        {
            if (!lblReceptName.Text.Equals(_data.Name))
            {
                lblReceptName.Text = _data.Name;
            }
            switch (_mode)
            {
            case ViewMode.ReceptView:
                if (!richTextBox1.Text.Equals(_data.extView))
                {
                    richTextBox1.Text = _data.extView;
                }
                break;

            case ViewMode.ReceptColor:
                if (!richTextBox1.Text.Equals(_data.color))
                {
                    richTextBox1.Text = _data.color;
                }
                break;

            case ViewMode.ReceptConsistence:
                if (!richTextBox1.Text.Equals(_data.consistence))
                {
                    richTextBox1.Text = _data.consistence;
                }
                break;

            case ViewMode.ReceptTaste:
                if (!richTextBox1.Text.Equals(_data.taste))
                {
                    richTextBox1.Text = _data.taste;
                }
                break;

            case ViewMode.ReceptDesign:
                if (!richTextBox1.Text.Equals(_data.design))
                {
                    richTextBox1.Text = _data.design;
                }
                break;

            case ViewMode.ReceptDelivery:
                if (!richTextBox1.Text.Equals(_data.delivery))
                {
                    richTextBox1.Text = _data.delivery;
                }
                break;

            case ViewMode.ReceptSale:
                if (!richTextBox1.Text.Equals(_data.sale))
                {
                    richTextBox1.Text = _data.sale;
                }
                break;

            case ViewMode.ReceptStorage:
                if (!richTextBox1.Text.Equals(_data.storage))
                {
                    richTextBox1.Text = _data.storage;
                }
                break;

            case ViewMode.ReceptProcess:
                if (!richTextBox1.Text.Equals(_data.process))
                {
                    richTextBox1.Text = _data.process;
                }
                break;

            case ViewMode.ReceptFactors:
                throw new NotImplementedException("Убрать цепочку приводящую к этому вызову");

            case ViewMode.None:
                break;

            default:
                throw new NotImplementedException("The method or operation is not implemented.");
            }
            //throw new Exception("The method or operation is not implemented.");
        }
Example #6
0
 /// <summary>
 /// запуск события обновления
 /// </summary>
 public void Update(DataBaseEventArgs args)
 {
     OnChanged(args);
 }
Example #7
0
 void DataBook_Changed(object sender, DataBaseEventArgs e)
 {
     //isChanged = true;
     SetFormName();
     //throw new Exception("The method or operation is not implemented.");
 }
Example #8
0
 void _data_Changed(object sender, DataBaseEventArgs args)
 {
     myData.Changed -= new EventHandler <DataBaseEventArgs> (_data_Changed);
     if (!tbName.Text.Equals(myData.Name))
     {
         this.tbName.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbName.Text              = myData.Name;
         this.tbName.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (!tbNum.Text.Equals(myData.Id.ToString(CultureInfo.CurrentCulture)))
     {
         this.tbNum.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbNum.Text              = myData.Id.ToString(CultureInfo.CurrentCulture);
         this.tbNum.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (!tbWater.Text.Equals(myData.water.ToString(CultureInfo.CurrentCulture)))
     {
         this.tbWater.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbWater.Text              = myData.water.ToString(CultureInfo.CurrentCulture);
         this.tbWater.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (!tbAcidity.Text.Equals(myData.Acidity.ToString(CultureInfo.CurrentCulture)))
     {
         tbAcidity.Text = myData.Acidity.ToString(CultureInfo.CurrentCulture);
     }
     if (!tbWaterPlus.Text.Equals(myData.waterPlus.ToString(CultureInfo.CurrentCulture)))
     {
         this.tbWaterPlus.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbWaterPlus.Text              = myData.waterPlus.ToString(CultureInfo.CurrentCulture);
         this.tbWaterPlus.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (!tbWaterMinus.Text.Equals(myData.waterMinus.ToString(CultureInfo.CurrentCulture)))
     {
         this.tbWaterMinus.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbWaterMinus.Text              = myData.waterMinus.ToString(CultureInfo.CurrentCulture);
         this.tbWaterMinus.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     tbTotalExit.Text = myData.TotalExit.ToString(CultureInfo.CurrentCulture);
     tbCountExit.Text = myData.CountExit.ToString(CultureInfo.CurrentCulture);
     if (!tbSource.Text.Equals(myData.source))
     {
         this.tbSource.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbSource.Text              = myData.source;
         this.tbSource.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (!tbPreview.Text.Equals(myData.preview))
     {
         this.tbPreview.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbPreview.Text              = myData.preview;
         this.tbPreview.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (!tbNormativDoc.Text.Equals(myData.normativDoc))
     {
         this.tbNormativDoc.TextChanged -= new System.EventHandler(this.tbTextChanged);
         tbNormativDoc.Text              = myData.normativDoc;
         this.tbNormativDoc.TextChanged += new System.EventHandler(this.tbTextChanged);
     }
     if (myData.totalLoss != null && cbTotalLoss.SelectedIndex != myData.totalLoss.TotalLossNum)
     {
         this.cbTotalLoss.TextChanged -= new System.EventHandler(this.cbTextChanged);
         cbTotalLoss.SelectedIndex     = myData.totalLoss.TotalLossNum;
         this.cbTotalLoss.TextChanged += new System.EventHandler(this.cbTextChanged);
     }
     if (!rbCalcExit.Checked.Equals(myData.isCalcExit))
     {
         this.rbCalcExit.CheckedChanged -= new System.EventHandler(this.RbCheckedChanged);
         rbCalcExit.Checked              = myData.isCalcExit;
         this.rbCalcExit.CheckedChanged += new System.EventHandler(this.RbCheckedChanged);
     }
     if (!rbCalcWater.Checked.Equals(myData.isCalcWater))
     {
         this.rbCalcWater.CheckedChanged -= new System.EventHandler(this.RbCheckedChanged);
         rbCalcWater.Checked              = myData.isCalcWater;
         this.rbCalcWater.CheckedChanged += new System.EventHandler(this.RbCheckedChanged);
     }
     if (!rbSetWater.Checked.Equals(myData.isSetWater))
     {
         this.rbSetWater.CheckedChanged -= new System.EventHandler(this.RbCheckedChanged);
         rbSetWater.Checked              = myData.isSetWater;
         this.rbSetWater.CheckedChanged += new System.EventHandler(this.RbCheckedChanged);
     }
     // проверка данных таблицы
     dgvRawList.CellValueChanged -= new DataGridViewCellEventHandler(dgvRawList_CellValueChanged);
     // удаление и обновление существующих
     CheckReceptData(dgvRawList.Nodes, myData);
     dgvRawList.CellValueChanged += new DataGridViewCellEventHandler(dgvRawList_CellValueChanged);
     myData.Changed += new EventHandler <DataBaseEventArgs> (_data_Changed);
 }