protected override void InitializeCommonControlBinding() { base.InitializeCommonControlBinding(); this.bindingCode = this.textexCode.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Code), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingName = this.textexName.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingTitle = this.textexTitle.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Title), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingBirthday = this.dateTimexBirthday.DataBindings.Add("Value", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Birthday), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingTelephone = this.textexTelephone.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Telephone), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingAddress = this.textexAddress.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Address), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckLocation1 = this.CheckLocation1.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation1), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckLocation2 = this.CheckLocation2.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation2), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckLocation3 = this.CheckLocation3.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation3), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckLocation4 = this.CheckLocation4.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation4), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckRole1 = this.CheckRole1.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckRole1), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckRole2 = this.CheckRole2.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckRole2), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCheckRole3 = this.CheckRole3.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckRole3), true, DataSourceUpdateMode.OnPropertyChanged); TeamAPIs teamAPIs = new TeamAPIs(CommonNinject.Kernel.Get <ITeamAPIRepository>()); this.combexTeamID.DataSource = teamAPIs.GetTeamBases(); this.combexTeamID.DisplayMember = CommonExpressions.PropertyName <TeamBase>(p => p.Name); this.combexTeamID.ValueMember = CommonExpressions.PropertyName <TeamBase>(p => p.TeamID); this.bindingTeamID = this.combexTeamID.DataBindings.Add("SelectedValue", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeViewModel>(p => p.TeamID), true, DataSourceUpdateMode.OnPropertyChanged); this.bindingCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingTitle.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingBirthday.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingTelephone.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingAddress.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckLocation1.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckLocation2.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckLocation3.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckLocation4.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckRole1.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckRole2.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingCheckRole3.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.bindingTeamID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete); this.fastEmployeeIndex.AboutToCreateGroups += fastEmployeeIndex_AboutToCreateGroups; this.fastEmployeeIndex.ShowGroups = true; this.olvInActive.Renderer = new MappedImageRenderer(new Object[] { 1, Resources.Void_16 }); }
public Teams() : base() { InitializeComponent(); this.toolstripChild = this.toolStripChildForm; this.fastListIndex = this.fastTeamIndex; this.teamAPIs = new TeamAPIs(CommonNinject.Kernel.Get <ITeamAPIRepository>()); this.teamViewModel = CommonNinject.Kernel.Get <TeamViewModel>(); this.teamViewModel.PropertyChanged += new PropertyChangedEventHandler(ModelDTO_PropertyChanged); this.baseDTO = this.teamViewModel; }