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; } }