Ejemplo n.º 1
0
        private void initForm(CarTypeInfo info)
        {
            if (info != null)
            {
                DBModelBase.Clone<CarTypeInfo>(info, ref newCarTypeInfo);
                carTypeInfo = info;
            }

            this.Text += IsNew ? "-新增" : "-修改";
            this.Btn_OK.Click += Btn_OK_Click;

            cbCarBrand.Properties.Items.AddRange(GlobalCaches.Instance.ConstantInfos.Where(e => e.TypeValue == (int)BasicConstantType.CarBrand).ToArray());
            txtCarType.DataBindings.Add("Text", newCarTypeInfo, "Name");
            txtDesc.DataBindings.Add("Text", newCarTypeInfo, "Desc");
            cbCarBrand.SelectedItem = GlobalCaches.Instance.ConstantInfos.FirstOrDefault(e => e.TypeValue == newCarTypeInfo.BrandId);
        }
Ejemplo n.º 2
0
 public FmCarTypeInfo(CarTypeInfo info = null)
 {
     InitializeComponent();
     initForm(info);
 }