Пример #1
0
        protected void SendGroup(object sender, EventArgs e)
        {
            HttpCookie userCookie;
            userCookie = Request.Cookies["UserID"];
            user = new User_Class();
            user = user.getUser(userCookie.Value);
            user.getFriends();

            Party_Class newParty = new Party_Class();
            newParty.Name = TextBox1.Text;

            Label3.Text = ListBox2.Items.Count.ToString();
            int indice=0;

            newParty.Users.Add(user);

            foreach (ListItem li in ListBox2.Items)
            {
                indice = Int32.Parse(li.Value);
                newParty.Users.Add(user.Friends[indice]);
            }

            if (ListBox2.Items.Count == 0 || TextBox1.Text == "")
            {
                Label3.Text = "Add users and set Name.";
            }
            else
            {
                if (newParty.createParty())
                    Response.Redirect("..//Asp_forms/Groups.aspx");
                else
                    Label3.Text = "error";
            }
        }