예제 #1
0
        protected void Edit_Click(object sender, EventArgs e)
        {
            int       id = int.Parse(Request.QueryString["id"]);
            DataTable dt = acc.getUserById(id + "");

            if (FileUpload1.FileName != null || FileUpload1.FileName != "")
            {
                imageBackup = FileUpload1.FileName;
            }
            imageBackup = dt.Rows[0][5].ToString();
            int result = acc.updateUser(id, txtPassword.Text, txtFullname.Text, txtPhone.Text,
                                        imageBackup, txtEmail.Text, int.Parse(DropDownList4.SelectedValue.ToString()),
                                        int.Parse(DropDownList3.SelectedValue.ToString()), int.Parse(DropDownList2.SelectedValue.ToString()),
                                        int.Parse(DropDownList1.SelectedValue.ToString()), String.Format("{0}", Request.Form["datepicker"]));

            if (result > 0)
            {
                Response.Write("<script>alert('Success')</script>");
                Response.Redirect("Manage.aspx");
            }
            else
            {
                Response.Write("<script>alert('Fail!')</script>");
            }
        }