Example #1
0
        private void SaveNewFridgeTile_Click(object sender, EventArgs e)
        {
            // Basic Info GroupBox
            NewFridge.Manufacturer     = ManufacturerTextBox.Text.ToUpper();
            NewFridge.Name             = NameTextBox.Text;
            NewFridge.Price            = Convert.ToInt32(PriceTextBox.Text);
            NewFridge.OverallVolume    = Convert.ToInt32(OverallVolumeTextBox.Text);
            NewFridge.Weight           = Convert.ToInt32(WeightTextBox.Text);
            NewFridge.Height           = Convert.ToInt32(HeightTextBox.Text);
            NewFridge.Width            = Convert.ToInt32(WidthTextBox.Text);
            NewFridge.Depth            = Convert.ToInt32(DepthTextBox.Text);
            NewFridge.Color            = ColorTextBox.Text;
            NewFridge.ProducingCountry = ProducingCountryTextBox.Text;

            // Extra Info GroupBox
            NewFridge.InstallationMethod = (InstallationMethodType)Enum.Parse(typeof(InstallationMethodType), InstallationMethodComboBox.GetItemText(InstallationMethodComboBox.SelectedValue));
            NewFridge.ControlType        = (ControlType)Enum.Parse(typeof(ControlType), ControlTypeComboBox.GetItemText(ControlTypeComboBox.SelectedValue));
            NewFridge.EnergyClass        = (EnergyClassType)Enum.Parse(typeof(EnergyClassType), EnergyClassComboBox.GetItemText(EnergyClassComboBox.SelectedValue));
            NewFridge.NoiseLevel         = Convert.ToInt32(NoiseLevelTextBox.Text);
            NewFridge.Refrigerant        = RefrigerantTextBox.Text;

            NewFridge.Display        = DisplayYesRadioButton.Checked ? true : false;
            NewFridge.DefrostSystem  = DefrostSystemYesRadioButton.Checked ? true : false;
            NewFridge.RehangingDoors = RehangingDoorsYesRadioButton.Checked ? true : false;

            // Fridge Info GroupBox
            NewFridge.DeviceType          = (FridgeType)Enum.Parse(typeof(FridgeType), DeviceTypeComboBox.GetItemText(DeviceTypeComboBox.SelectedValue));
            NewFridge.CompressorType      = (CompressorType)Enum.Parse(typeof(CompressorType), CompressorTypeComboBox.GetItemText(CompressorTypeComboBox.SelectedValue));
            NewFridge.FreezerLocation     = (FreezerLocationType)Enum.Parse(typeof(FreezerLocationType), FreezerLocationComboBox.GetItemText(FreezerLocationComboBox.SelectedValue));
            NewFridge.CompressorsAmount   = Convert.ToInt32(CompressorsAmountTextBox.Text);
            NewFridge.FridgeUsefulVolume  = Convert.ToInt32(FridgeUsefulVolumeTextBox.Text);
            NewFridge.FreezerUsefulVolume = Convert.ToInt32(FreezerUsefulVolumeTextBox.Text);

            NewFridge.FreshnessZone = FreshnessZoneYesRadioButton.Checked ? true : false;
            NewFridge.MiniBar       = MiniBarYesRadioButton.Checked ? true : false;

            // Fridge Image
            NewFridge.DeviceImage = ImageToByteArray(UploadedImage);

            this.DialogResult = DialogResult.OK;
        }
Example #2
0
        private void SaveNewFreezerTile_Click(object sender, EventArgs e)
        {
            // Basic Info GroupBox
            NewFreezer.Manufacturer     = ManufacturerTextBox.Text.ToUpper();
            NewFreezer.Name             = NameTextBox.Text;
            NewFreezer.Price            = Convert.ToInt32(PriceTextBox.Text);
            NewFreezer.OverallVolume    = Convert.ToInt32(OverallVolumeTextBox.Text);
            NewFreezer.Weight           = Convert.ToInt32(WeightTextBox.Text);
            NewFreezer.Height           = Convert.ToInt32(HeightTextBox.Text);
            NewFreezer.Width            = Convert.ToInt32(WidthTextBox.Text);
            NewFreezer.Depth            = Convert.ToInt32(DepthTextBox.Text);
            NewFreezer.Color            = ColorTextBox.Text;
            NewFreezer.ProducingCountry = ProducingCountryTextBox.Text;
            NewFreezer.UsefulVolume     = Convert.ToInt32(UsefulVolumeTextBox.Text);

            // Extra Info GroupBox
            NewFreezer.InstallationMethod    = (InstallationMethodType)Enum.Parse(typeof(InstallationMethodType), InstallationMethodComboBox.GetItemText(InstallationMethodComboBox.SelectedValue));
            NewFreezer.EnergyClass           = (EnergyClassType)Enum.Parse(typeof(EnergyClassType), EnergyClassComboBox.GetItemText(EnergyClassComboBox.SelectedValue));
            NewFreezer.DeviceType            = (FreezerType)Enum.Parse(typeof(FreezerType), DeviceTypeComboBox.GetItemText(DeviceTypeComboBox.SelectedValue));
            NewFreezer.ControlType           = (ControlType)Enum.Parse(typeof(ControlType), ControlTypeComboBox.GetItemText(ControlTypeComboBox.SelectedValue));
            NewFreezer.FreezingPower         = Convert.ToInt32(FreezingPowerTextBox.Text);
            NewFreezer.AutonomousColdStorage = Convert.ToInt32(AutoColdStorageTextBox.Text);
            NewFreezer.ShelvesAmount         = Convert.ToInt32(ShelvesAmountTextBox.Text);
            NewFreezer.BoxesAmount           = Convert.ToInt32(BoxesAmountTextBox.Text);
            NewFreezer.NoiseLevel            = Convert.ToInt32(NoiseLevelTextBox.Text);
            NewFreezer.Refrigerant           = RefrigerantTextBox.Text;

            // Freezer Features Info GroupBox
            NewFreezer.Display        = DisplayYesRadioButton.Checked ? true : false;
            NewFreezer.DefrostSystem  = DefrostSystemYesRadioButton.Checked ? true : false;
            NewFreezer.RehangingDoors = RehangingDoorsYesRadioButton.Checked ? true : false;
            NewFreezer.IceGenerator   = IceGeneratorYesRadioButton.Checked ? true : false;
            NewFreezer.FastFreezing   = FastFreezingYesRadioButton.Checked ? true : false;
            NewFreezer.EcoMode        = EcoModeYesRadioButton.Checked ? true : false;

            // Fridge Image
            NewFreezer.DeviceImage = ImageToByteArray(UploadedImage);

            this.DialogResult = DialogResult.OK;
        }