Exemple #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (KahnLib.updateCoordinateDetails(currentuser.coodinateid, Convert.ToDouble(txtLongitude.Text), Convert.ToDouble(txtLatitude.Text)) > 0)
            {
                Label5.Text = "Successfully Updated!";

                Response.Redirect("Login.aspx");
            }

            if (KahnLib.UpdateUserDetails(currentuser.userid, TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text) > 0)
            {
            }
            else
            {
                Label5.Text = "Update not successful!";
            }
            Label5.Visible = true;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            FileUpload img = (FileUpload)imgUpload;

            if (img.HasFile && img.PostedFile != null)
            {
                //if has file
                HttpPostedFile File = imgUpload.PostedFile;

                if (KahnLib.UpdateRestaurantDetails(currentuser.restaurantno, TextBox1.Text, TextBox2.Text, File) > 0 && KahnLib.updateCoordinateDetails(currentRestaurant.coodinateid, Convert.ToDouble(TextBox4.Text), Convert.ToDouble(TextBox3.Text)) > 0)
                {
                    Label5.Text = "Successfully Updated!";
                }
                else
                {
                    Label5.Text = "Update not successful!";
                }
                Label5.Visible = true;
            }
            else
            {
                //if has no file
                if (KahnLib.UpdateRestaurantDetails(currentuser.restaurantno, TextBox1.Text, TextBox2.Text) > 0 && KahnLib.updateCoordinateDetails(currentRestaurant.coodinateid, Convert.ToDouble(TextBox4.Text), Convert.ToDouble(TextBox3.Text)) > 0)
                {
                    Label5.Text = "Successfully Updated!";
                }
                else
                {
                    Label5.Text = "Update not successful!";
                }
                Label5.Visible = true;
            }
        }