Exemplo n.º 1
0
 private void AddExt_Click(object sender, EventArgs e)
 {
     if (txtExtName.Text != string.Empty && txtExtValue.Text != string.Empty)
     {
         PlantDTO plant = VpnManagerDal.GetPlant(cmbCustomer.Text);
         bool     mustUpdateExtensionObj = false; //added refresh of ext objs if needed
         if (rdPlant.Checked)
         {
             if (plant.Id > 0)
             {
                 mustUpdateExtensionObj = VpnManagerDal.AddExtensionObject(plant.Id, (int)TargetTable.Plant, txtExtName.Text, txtExtValue.Text);
             }
         }
         else
         {
             if (_machineID > 0)
             {
                 mustUpdateExtensionObj = VpnManagerDal.AddExtensionObject(_machineID, (int)TargetTable.Machine, txtExtName.Text, txtExtValue.Text);
             }
         }
         if (mustUpdateExtensionObj)
         {
             extensionObjectDTOBindingSource.DataSource = VpnManagerDal.GetExtensionObjects(_plant, (int)TargetTable.Plant);
         }
     }
 }
Exemplo n.º 2
0
 private void cmdAdd_Click(object sender, EventArgs e)
 {
     VpnManagerDal.AddExtensionObject(IDConection, VpnManagerDAL.DTO.TargetTable.VpnType, txtName.Text, txtValue.Text);
 }