Ejemplo n.º 1
0
        private void WindowBase_Loaded(object sender, RoutedEventArgs e)
        {
            this.Available.ItemsSource     = YesOrNoType.Yes.ToArrayList();
            this.Position.ItemsSource      = BerthPositionType.Top.ToArrayList();
            this.cmbFFMState.ItemsSource   = PLCStateType.Working.ToArrayList();
            this.cmbCreateType.ItemsSource = CreateControlType.Stove.ToArrayList();

            if (this.Model != null)
            {
                YesOrNoType yesOrNo = (YesOrNoType)Convert.ToInt32(Model.FFMIsAvailable);
                Available.Text = yesOrNo.FetchDescription();

                BerthPositionType BerthPosition = (BerthPositionType)Convert.ToInt32(Model.FFMBerthPosition);
                Position.Text = BerthPosition.FetchDescription();

                PLCStateType plcState = (PLCStateType)Convert.ToInt32(Model.FFMState);
                cmbFFMState.Text = plcState.FetchDescription();

                CreateControlType createType = (CreateControlType)Convert.ToInt32(Model.FFMCreateType);
                cmbCreateType.Text = createType.FetchDescription();

                this.Title = "修改信息";
            }
            else
            {
                this.Title = "添加信息";
                this.Model = new FixtureFurnaceMainEntity();
            }
            this.DataContext = this.Model;
        }
Ejemplo n.º 2
0
        private void WindowBase_Loaded(object sender, RoutedEventArgs e)
        {
            // IEnumerable<FixtureFurnaceMainEntity> Main = (new FixtureFurnaceMainDB()).GetAllData();


            this.Accomplish.ItemsSource  = YesOrNoType.Yes.ToArrayList();
            this.cmbFFDState.ItemsSource = FFDState.NoFixtureOpen.ToArrayList();
            this.cmbCAI.ItemsSource      = (new ChuckingApplianceInfoDB()).GetAll().ToList().OrderBy(x => x.CAId);

            if (operateType == 1)
            {
                this.Title = "添加信息";
            }
            else
            {
                YesOrNoType yesOrNo = (YesOrNoType)Convert.ToInt32(Model.FFDIsAccomplish);
                Accomplish.Text = yesOrNo.FetchDescription();


                FFDState FFDState = (FFDState)Convert.ToInt32(Model.FFDState);
                cmbFFDState.Text = FFDState.FetchDescription();


                this.Title = "修改信息";
                // this.Model = new FixtureFurnaceDetaiViewModel();
            }
            this.DataContext = this.Model;
        }
Ejemplo n.º 3
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null)
     {
         //value = (bool) value == false ? 0 : 1;
         YesOrNoType yesOrNo = (YesOrNoType)(int)value;
         return(yesOrNo.FetchDescription());
     }
     return(string.Empty);
 }