private void InitPara(string randomGroupID) { //加载事件 client.GetRandomGroupByIDCompleted += new EventHandler<GetRandomGroupByIDCompletedEventArgs>(client_GetRandomGroupByIDCompleted); client.AddRandomGroupCompleted += new EventHandler<AddRandomGroupCompletedEventArgs>(client_AddRandomGroupCompleted); client.UpdateRandomGroupCompleted += new EventHandler<UpdateRandomGroupCompletedEventArgs>(client_UpdateRandomGroupCompleted); //窗口状态 switch ((int)FormType) { case 0://NEW RandomGroup = new T_HR_RANDOMGROUP(); RandomGroup.RANDOMGROUPID = Guid.NewGuid().ToString(); SetDescEnable(true); break; case 1://EDIT client.GetRandomGroupByIDAsync(randomGroupID); SetDescEnable(true); break; case 2: //BROWE client.GetRandomGroupByIDAsync(randomGroupID); SetDescEnable(false); break; case 3: //ADUIT break; } }
private void InitPara(string randomGroupID) { //加载事件 client.GetRandomGroupByIDCompleted += new EventHandler <GetRandomGroupByIDCompletedEventArgs>(client_GetRandomGroupByIDCompleted); client.AddRandomGroupCompleted += new EventHandler <AddRandomGroupCompletedEventArgs>(client_AddRandomGroupCompleted); client.UpdateRandomGroupCompleted += new EventHandler <UpdateRandomGroupCompletedEventArgs>(client_UpdateRandomGroupCompleted); //窗口状态 switch ((int)FormType) { case 0: //NEW RandomGroup = new T_HR_RANDOMGROUP(); RandomGroup.RANDOMGROUPID = Guid.NewGuid().ToString(); SetDescEnable(true); break; case 1: //EDIT client.GetRandomGroupByIDAsync(randomGroupID); SetDescEnable(true); break; case 2: //BROWE client.GetRandomGroupByIDAsync(randomGroupID); SetDescEnable(false); break; case 3: //ADUIT break; } }
/// <summary> /// 构造EditGroupPerson /// </summary> /// <param name="type">窗口状态</param> /// <param name="randomGroup">抽查组实体</param> public EditGroupPerson(FormTypes type, T_HR_RANDOMGROUP randomGroup) { FormType = type; this.RandomGroup = randomGroup; InitializeComponent(); InitPara(); }
/// <summary> /// 抽查组列表换行事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DtGrid_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { if (DtGrid.SelectedItem != null) { SelectedRandomGroup = (T_HR_RANDOMGROUP)DtGrid.SelectedItems[0]; } LoadGroupPersonData(); }
private void UpdateRandomGroup(T_HR_RANDOMGROUP entType, ref string strMsg) { using (RandomGroupBll bll = new RandomGroupBll()) { bll.UpdateRandomGroup(entType, ref strMsg); } }