protected void btnJoin_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <int> memberList = CustomGroupingHelper.GetMemberList(this.GetMemberQuery());
     if (memberList != null)
     {
         CustomGroupingHelper.AddCustomGroupingUser(memberList, this.currentGroupId);
         this.ShowMsgAndReUrl("添加成功!", true, "/Admin/member/CustomDistributorDetail.aspx?GroupId=" + this.currentGroupId);
         return;
     }
     this.ShowMsg("未找到符合条件的会员,请重新选择条件!", false);
 }
Example #2
0
        protected void BtnAddMembers_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtUserNames.Text.Trim()))
            {
                this.ShowMsg("请输入用户名", false);
                return;
            }
            System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>();
            string text = this.txtUserNames.Text.Trim().Replace("\r\n", "\n").Replace("\n", ",");

            string[] array = text.Split(new char[]
            {
                ','
            });
            for (int i = 0; i < array.Length; i++)
            {
                string username = array[i];
                int    memberIdByUserNameOrNiChen = MemberHelper.GetMemberIdByUserNameOrNiChen(username, "");
                if (memberIdByUserNameOrNiChen > 0)
                {
                    list.Add(memberIdByUserNameOrNiChen);
                }
            }
            this.txtUserNames.Text = "";
            if (list.Count > 0)
            {
                string text2 = CustomGroupingHelper.AddCustomGroupingUser(list, this.currentGroupId);
                if (string.IsNullOrEmpty(text2))
                {
                    this.ShowMsg("添加成功!", true);
                }
                else
                {
                    this.ShowMsg(text2, false);
                }
                this.BindData();
                return;
            }
            this.ShowMsg("未找到会员", false);
        }
 protected void BtnAddMembers_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.txtUserNames.Text.Trim()))
     {
         this.ShowMsg("请输入用户名", false);
     }
     else
     {
         IList <int> userIdList = new List <int>();
         foreach (string str2 in this.txtUserNames.Text.Trim().Replace("\r\n", "\n").Replace("\n", ",").Split(new char[] { ',' }))
         {
             int memberIdByUserNameOrNiChen = MemberHelper.GetMemberIdByUserNameOrNiChen(str2, "");
             if (memberIdByUserNameOrNiChen > 0)
             {
                 userIdList.Add(memberIdByUserNameOrNiChen);
             }
         }
         this.txtUserNames.Text = "";
         if (userIdList.Count > 0)
         {
             string str3 = CustomGroupingHelper.AddCustomGroupingUser(userIdList, this.currentGroupId);
             if (string.IsNullOrEmpty(str3))
             {
                 this.ShowMsg("添加成功!", true);
             }
             else
             {
                 this.ShowMsg(str3, false);
             }
             this.BindData();
         }
         else
         {
             this.ShowMsg("未找到会员", false);
         }
     }
 }