public Student_Parent() { InitializeComponent(); Group = "緊急聯絡人資料"; _StudParentRec = new ParentRecord(); _ParentType = ParentType.Guardian; _DataListener_Guardian = new ChangeListen(); _DataListener_Guardian.StatusChanged += new EventHandler<ChangeEventArgs>(_DataListener_Guardian_StatusChanged); // 加入緊急聯絡人 Listener _DataListener_Guardian.Add(new TextBoxSource(txtParentName)); _DataListener_Guardian.Add(new TextBoxSource(txtParentPhone)); //_DataListener_Guardian.Add(new ComboBoxSource(cboRelationship, ComboBoxSource.ListenAttribute.Text)); K12.Data.Parent.AfterUpdate += new EventHandler<K12.Data.DataChangedEventArgs>(JHParent_AfterUpdate); BGWorker = new BackgroundWorker(); BGWorker.DoWork += new DoWorkEventHandler(BGWorker_DoWork); BGWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGWorker_RunWorkerCompleted); Disposed += new EventHandler(ParentInfoPalmerwormItem_Disposed); }
void _BGWork_DoWork(object sender, DoWorkEventArgs e) { // 取得資料 _ParentRecord = K12.Data.Parent.SelectByStudentID(PrimaryKey); _AddressRecord = Address.SelectByStudentID(PrimaryKey); }
void BGWorker_DoWork(object sender, DoWorkEventArgs e) { _StudParentRec = K12.Data.Parent.SelectByStudentID(PrimaryKey); }