Esempio n. 1
0
 private void onSendToDatabase(object sender, EventArgs e)
 {
     try
     {
         FormSetItemName form = new FormSetItemName()
         {
             ItemName = ItemName
         };
         if (DialogResult.OK == form.ShowDialog())
         {
             PLMPackServiceClient client = WCFClientSingleton.Instance.Client;
             client.CreateNewCylinder(new DCSBCylinder()
             {
                 Name        = form.ItemName,
                 Description = ItemDescription,
                 UnitSystem  = (int)UnitsManager.CurrentUnitSystem,
                 RadiusOuter = RadiusOuter,
                 RadiusInner = RadiusInner,
                 Height      = CylinderHeight,
                 Weight      = Weight,
                 NetWeight   = this.NetWeight.Activated ? this.NetWeight.Value : new Nullable <double>(),
                 ColorOuter  = ColorWallOuter.ToArgb(),
                 ColorInner  = ColorWallInner.ToArgb(),
                 ColorTop    = ColorTop.ToArgb(),
                 AutoInsert  = false
             }
                                      );
             Close();
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex.Message);
     }
 }
Esempio n. 2
0
 private void OnSendToDatabase(object sender, EventArgs e)
 {
     try
     {
         FormSetItemName form = new FormSetItemName()
         {
             ItemName = ItemName
         };
         if (DialogResult.OK == form.ShowDialog())
         {
             using (WCFClient wcfClient = new WCFClient())
             {
                 wcfClient.Client?.CreateNewCylinder(new DCSBCylinder()
                 {
                     Name        = form.ItemName,
                     Description = ItemDescription,
                     UnitSystem  = (int)UnitsManager.CurrentUnitSystem,
                     RadiusOuter = RadiusOuter,
                     RadiusInner = RadiusInner,
                     Height      = CylinderHeight,
                     Weight      = Weight,
                     NetWeight   = NetWeight.Activated ? NetWeight.Value : new double?(),
                     ColorOuter  = ColorWallOuter.ToArgb(),
                     ColorInner  = ColorWallInner.ToArgb(),
                     ColorTop    = ColorTop.ToArgb(),
                     AutoInsert  = false
                 }
                                                     );
             }
             Close();
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex.Message);
     }
 }