protected void Button_newpet_Click(object sender, EventArgs e) { Pet newpet = new Pet(); newpet.Usid = this.U_usr1.user.Username; newpet.Name = "Default"; newpet.Birth = DateTime.Now; newpet.Species = 0; newpet.Gender = '2'; newpet.Image0 = "Default.png"; SqlFuns sf = new SqlFuns(); int result = sf.AddPet(newpet); if (result > 0) { Response.Write("<script language='javascript'>alert('Create Successfully.'); location.href='manager.aspx</script>"); } else { Response.Write("<script language='javascript'>alert('Failed, Please Connect System Manager.');</script>"); } }