Ejemplo n.º 1
0
        private void EditSelectedAnalogue()
        {
            int       id = 0;
            SpareView b  = null;

            if (dgAnalogues.SelectedItem != null)
            {
                object sel = dgAnalogues.SelectedItem;
                b  = (SpareView)(sel);
                id = b.id;
                string spareName1 = this._oldName;
                string spareName2 = b.name;
                if (id > 0)
                {
                    SpareAnalogueEditView v  = new SpareAnalogueEditView();
                    DataAccess            da = new DataAccess();
                    spare_analogue        sp = da.getSpareAnalogue(spareName1, spareName2);
                    v._id                 = sp.id;
                    v._spareId1           = _id;
                    v._spareId2           = b.id;;
                    v.edtIsBoth.IsChecked = sp.is_equal > 0 ? true : false;
                    v.result              = b;
                    v.ShowDialog();
                    loadAnalogues(this._id);
                }
            }
        }
Ejemplo n.º 2
0
        private void CreateAnalogue()
        {
            SpareAnalogueEditView v = new SpareAnalogueEditView();

            v._id       = -1;
            v._spareId1 = this._id;
            v.ShowDialog();
            loadAnalogues(this._id);
        }
Ejemplo n.º 3
0
 private void EditSelectedAnalogue()
 {
     int id = 0;
     SpareView b = null;
     if (dgAnalogues.SelectedItem != null)
     {
         object sel = dgAnalogues.SelectedItem;
         b = (SpareView)(sel);
         id = b.id;
         string spareName1 = this._oldName;
         string spareName2 = b.name;
         if (id > 0)
         {
             SpareAnalogueEditView v = new SpareAnalogueEditView();
             DataAccess da = new DataAccess();
             spare_analogue sp = da.getSpareAnalogue(spareName1, spareName2);
             v._id = sp.id;
             v._spareId1 = _id;
             v._spareId2 = b.id; ;
             v.edtIsBoth.IsChecked = sp.is_equal > 0 ? true : false;
             v.result = b;
             v.ShowDialog();
             loadAnalogues(this._id);
         }
     }
 }
Ejemplo n.º 4
0
 private void CreateAnalogue()
 {
     SpareAnalogueEditView v = new SpareAnalogueEditView();
     v._id = -1;
     v._spareId1 = this._id;
     v.ShowDialog();
     loadAnalogues(this._id);
 }