Пример #1
0
        protected void Edit_Data(object sender, EventArgs e)
        {
            db = new SQLDatabase();
            db.Connect();
            list_users = db.ListUsers();
            string sex  = "";
            string type = "";

            if (!male.Checked && !female.Checked)
            {
                sex = list_users.ElementAt(id_i).sex;
            }
            else
            {
                if (male.Checked)
                {
                    sex = "male";
                }
                else
                {
                    sex = "female";
                }
            }
            if (!volounteer.Checked && !needy.Checked)
            {
                type = list_users.ElementAt(id_i).type;
            }
            else
            {
                if (volounteer.Checked)
                {
                    type = "volounteer";
                }
                else
                {
                    type = "needy";
                }
            }
            if (birthDate.Value == "")
            {
                birthDate.Value = list_users.ElementAt(id_i).birth_date.ToString("yyyy-MM-dd");
            }

            db.EditAccount(id, nickname.Value, pesel.Value, inputEmail.Value, telephone.Value, name.Value, surname.Value, birthDate.Value, sex, type);

            if (!inputEmail.Value.Equals(email))
            {
                Session.RemoveAll();
                Response.Redirect("Login.aspx");
            }
            else
            {
                Response.Redirect("MyAccount.aspx");
            }
            db.Disconnect();
        }
Пример #2
0
 protected void Form_Data(object sender, EventArgs e)
 {
     data_form.Visible     = true;
     password_form.Visible = false;
     db = new SQLDatabase();
     db.Connect();
     list_users       = db.ListUsers();
     nickname.Value   = list_users.ElementAt(id_i).nickname;
     inputEmail.Value = list_users.ElementAt(id_i).email;
     name.Value       = list_users.ElementAt(id_i).name;
     surname.Value    = list_users.ElementAt(id_i).surname;
     telephone.Value  = list_users.ElementAt(id_i).telephone;
     pesel.Value      = list_users.ElementAt(id_i).pesel;
     db.Disconnect();
 }
Пример #3
0
        protected void Prepare_Email(object sender, EventArgs e)
        {
            db = new SQLDatabase();
            db.Connect();
            List <String> lists_email = new List <string>();

            list_users = db.ListUsers();

            if (volounteers.Checked)
            {
                for (int i = 0; i < list_users.Count(); i++)
                {
                    if (list_users.ElementAt(i).type.Equals("volounteer"))
                    {
                        lists_email.Add(list_users.ElementAt(i).email);
                    }
                }
            }
            if (needies.Checked)
            {
                for (int i = 0; i < list_users.Count(); i++)
                {
                    if (list_users.ElementAt(i).type.Equals("needy"))
                    {
                        lists_email.Add(list_users.ElementAt(i).email);
                    }
                }
            }
            if (all.Checked)
            {
                for (int i = 0; i < list_users.Count(); i++)
                {
                    lists_email.Add(list_users.ElementAt(i).email);
                }
            }

            for (int i = 0; i < lists_email.Count(); i++)
            {
                Send_Email(lists_email.ElementAt(i), db.getNickname_email(lists_email.ElementAt(i)), subject.Value, TextArea1.Text);
            }

            db.Disconnect();
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id_e"] != null)
            {
                id_e = int.Parse(Request.QueryString["id_e"]);
            }
            db   = new SQLDatabase();
            html = new StringBuilder();
            db.Connect();
            list_users = db.ListUsers();

            html.Append("<table border = '1' align='center'>");

            html.Append("<tr>");
            html.Append("<th>Id</th><th>Imię</th><th>Nazwisko</th><th>Nickname</th><th>E-mail</th><th>Płeć</th><th>Telefon</th>");
            html.Append("</tr>");

            for (int i = 0; i < list_users.Count; i++)
            {
                if (list_users.ElementAt(i).type.Equals("volounteer"))
                {
                    html.Append("<tr>");
                    html.Append("<td>" + list_users.ElementAt(i).id + "</td>");
                    html.Append("<td>" + list_users.ElementAt(i).name + "</td>");
                    html.Append("<td>" + list_users.ElementAt(i).surname + "</td>");
                    html.Append("<td>" + list_users.ElementAt(i).nickname + "</td>");
                    html.Append("<td>" + list_users.ElementAt(i).email + "</td>");
                    html.Append("<td>" + list_users.ElementAt(i).sex + "</td>");
                    html.Append("<td>" + list_users.ElementAt(i).telephone + "</td>");
                    html.Append("<td><a href=\"Invite.aspx?id_u=" + list_users.ElementAt(i).id + "&id_e=" + id_e + "\">Zaproś</a></td>");
                    html.Append("</tr>");
                }
            }

            html.Append("</table>");
            html.Append("<br/><br/>");
            PlaceHolder1.Controls.Add(new Literal {
                Text = html.ToString()
            });

            db.Disconnect();
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            db   = new SQLDatabase();
            html = new StringBuilder();
            db.Connect();
            list_users = db.ListUsers();
            id         = db.getId((string)Session["id"]);
            html.Append("<table border = '1' align='center'>");

            for (int i = 0; i < list_users.Count; i++)
            {
                if (list_users.ElementAt(i).id.Equals(id))
                {
                    html.Append("<tr><td>Id</td> <td>" + list_users.ElementAt(i).id + "</td></tr>");
                    html.Append("<tr><td>Imię</td> <td>" + list_users.ElementAt(i).name + "</td></tr>");
                    html.Append("<tr><td>Nazwisko</td> <td>" + list_users.ElementAt(i).surname + "</td></tr>");
                    html.Append("<tr><td>Nickname</td> <td>" + list_users.ElementAt(i).nickname + "</td></tr>");
                    html.Append("<tr><td>E-mail</td> <td>" + list_users.ElementAt(i).email + "</td></tr>");
                    html.Append("<tr><td>Płeć</td> <td>" + list_users.ElementAt(i).sex + "</td></tr>");
                    html.Append("<tr><td>Telefon</td> <td>" + list_users.ElementAt(i).telephone + "</td></tr>");
                    html.Append("<tr><td>Data urodzenia</td> <td>" + list_users.ElementAt(i).birth_date.ToString("yyyy-MM-dd") + "</td></tr>");
                    html.Append("<tr><td>Typ użytkownika</td> <td>" + list_users.ElementAt(i).type + "</td></tr>");
                    html.Append("<tr><td>Pesel</td> <td>" + list_users.ElementAt(i).pesel + "</td></tr>");
                    email = list_users.ElementAt(i).email;
                    pass  = list_users.ElementAt(i).password;
                    id_i  = i;
                }
            }

            html.Append("</table>");
            html.Append("<br/><br/>");
            PlaceHolder1.Controls.Add(new Literal {
                Text = html.ToString()
            });

            db.Disconnect();
        }