コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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;
 }
コード例 #3
0
        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;
            }
        }