protected virtual void OnValueChanged(SamsaraEntityChooserValueChangedEventArgs <T> e) { switch (this.controlType) { case SamsaraEntityChooserControlTypeEnum.Single: if (e.NewValue != null) { this.suceEntities.Value = EntitiesUtil.GetPrimaryKeyPropertyValue <T>(e.NewValue); } else { this.suceEntities.Value = -1; } break; case SamsaraEntityChooserControlTypeEnum.Multiple: this.suceEntities.Value = null; break; default: throw new NotImplementedException(); } if (this.ValueChanged != null) { this.ValueChanged(this, e); } }
private void sctcServerComputerType_ValueChanged(object sender, SamsaraEntityChooserValueChangedEventArgs <ServerComputerType> e) { this.ctlServerConsultingOldServerComputers.rtcRackType.Value = null; this.ctlServerConsultingOldServerComputers.rtcRackType.ReadOnly = e.NewValue == null || e.NewValue.ServerComputerTypeId != (int)ServerComputerTypeEnum.Rack; }
private void cipccCustomerInfrastructurePrinterClassification_ValueChanged(object sender, SamsaraEntityChooserValueChangedEventArgs <CustomerInfrastructurePrinterClassification> e) { if (e.NewValue != null) { bool isUnique = (CustomerInfrastructurePrinterClassificationEnum) e.NewValue.CustomerInfrastructurePrinterClassificationId == CustomerInfrastructurePrinterClassificationEnum.Unique; this.controlCustomerInfrastructurePrinters.steQuantity.Visible = !isUnique; this.controlCustomerInfrastructurePrinters.ulblQuantity.Visible = !isUnique; this.controlCustomerInfrastructurePrinters.txtlSerialNumber.Visible = isUnique; this.controlCustomerInfrastructurePrinters.lblSerialNumber.Visible = isUnique; } }