public void SetGear(String name, int value) { if (Gears.ContainsKey(name)) { Gears[name] = value; } else { Gears.Add(name, value); } }
private void Add(object value) { if (DevicesIsSelected == true) { SelectedDevice = new DeviceDiagnoseClass() { Name = "新建设备" }; Devices.Add(SelectedDevice); } else if (ShaftsIsSelected == true) { SelectedShaft = new ShaftClass() { Name = "新建轴" }; Shafts.Add(SelectedShaft); } else if (BearingsIsSelected == true) { SelectedBearing = new BearingClass() { Name = "新建轴承" }; Bearings.Add(SelectedBearing); } else if (BeltsIsSelected == true) { SelectedBelt = new BeltClass() { Name = "新建皮带" }; Belts.Add(SelectedBelt); } else if (GearsIsSelected == true) { SelectedGear = new GearClass() { Name = "新建齿轮" }; Gears.Add(SelectedGear); } else if (ImpellersIsSelected == true) { SelectedImpeller = new ImpellerClass() { Name = "新建叶轮" }; Impellers.Add(SelectedImpeller); } else if (MotorsIsSelected == true) { SelectedMotor = new MotorClass() { Name = "新建电机" }; Motors.Add(SelectedMotor); } ShowWin(); //立即更新到服务器 }