Exemplo n.º 1
0
        /// <summary>
        /// 条件组员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            frmUserSearch frm = new frmUserSearch();

            frm.ShowDialog();
            List <TB_User> user = frm.mUser;

            if (user != null)
            {
                //warp.Children.Clear();
                for (int i = 0; i < user.Count; i++)
                {
                    uc_user uc = new uc_user(user[i]);
                    for (int j = 0; j < warp.Children.Count; j++)
                    {
                        if (((warp.Children[j] as uc_user).txtName.Tag as TB_User).Id == user[i].Id)
                        {
                            MessageHelper.ShowMessage(user[i].USER_NAME + "已存在,不可添加重复组员");
                            continue;
                        }
                    }
                    if (user[i].Id != (txtleder.Tag as TB_User).Id)
                    {
                        uc.txtName.Text = user[i].USER_NAME;
                        warp.Children.Add(uc);
                        uc.DelSelectUser += uc_DelSelectUser;
                    }
                    else
                    {
                        MessageHelper.ShowMessage("组员不能与负责人一致");
                        continue;
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加项目负责人
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLeader_Click(object sender, RoutedEventArgs e)
        {
            frmUserSearch frm = new frmUserSearch();

            frm.ShowDialog();
            if (frm.mUser != null)
            {
                TB_User user = frm.mUser[0];
                this.txtleder.Text = user.USER_NAME;
                this.txtleder.Tag  = user;
            }
        }