protected void DrInfoSaveButton_Click(object sender, EventArgs e)
        {
            DrInfo aDrInfo = new DrInfo();


            aDrInfo.DrName      = DrInfoNameTextBox.Text;
            aDrInfo.DrSpec      = DrInfoSpecDropDownList.SelectedValue;
            aDrInfo.DrDrg       = DrInfoDegreeTextBox.Text;
            aDrInfo.DrLoc       = DrInfoLocDropDownList.SelectedValue;
            aDrInfo.UserName    = DrInfoUsernameTextBox.Text;
            aDrInfo.DrPass      = DrInfoRePasswordTextBox.Text;
            aDrInfo.DrEmail     = DrInfoEmailTextBox.Text;
            aDrInfo.DrLatitude  = DrInfoLatitudeTextBox.Text;
            aDrInfo.DrLongitude = DrInfoLongitudeTextBox.Text;

            DrManager aDrManager = new DrManager();

            if (aDrManager.Save(aDrInfo))
            {
                Response.Write("Data save successfully.");
            }
            else
            {
                Response.Write("Data are not saved!");
            }
            Session["DrUName"] = DrInfoUsernameTextBox.Text;
            Response.Redirect("DrInfoConfirm.aspx");
        }
Exemple #2
0
        public int Save(DrInfo aDrInfo)
        {
            string     insertQuery = string.Format("INSERT INTO DrInfo1_tb(DrName,SpecId,DrDegg,LocId,DrUname,DrPass,DrEmail,DrLati,DrLongi) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')", aDrInfo.DrName, aDrInfo.DrSpec, aDrInfo.DrDrg, aDrInfo.DrLoc, aDrInfo.UserName, aDrInfo.DrPass, aDrInfo.DrEmail, aDrInfo.DrLatitude, aDrInfo.DrLongitude);
            SqlCommand com         = new SqlCommand(insertQuery, con);

            con.Open();
            int rowaffeced = com.ExecuteNonQuery();

            return(rowaffeced);
        }
Exemple #3
0
 public bool Save(DrInfo aDrInfo)
 {
     aDrGetway = new DrGetway();
     return(aDrGetway.Save(aDrInfo) > 0);
 }