Example #1
0
        protected void saveBTTN_ServerClick(object sender, EventArgs e)
        {
            TourGuide ist  = new TourGuide();
            string    nric = Session["Nric"].ToString();


            if (FileUpload1.HasFiles)
            {
                //string s1 =Path.GetFileName(FileUpload1.FileName);
                //string path = Server.MapPath("images") + "/" + s1;
                //FileUpload1.SaveAs(path);


                HttpPostedFile postedfile   = FileUpload1.PostedFile;
                Stream         stream       = postedfile.InputStream;
                BinaryReader   binaryReader = new BinaryReader(stream);
                byte[]         bytes        = binaryReader.ReadBytes((int)stream.Length);
                //string s1 = Convert.ToBase64String(bytes);

                int picresult = ist.InsertProfilePic(bytes, nric);
            }



            int re = ist.Update(Convert.ToInt32(salarytb.Text), nric);

            if (bonusamttb.Text != "")
            {
                int result = ist.InsertTest(Convert.ToInt32(bonusamttb.Text), Commentstb.Text, nric);
            }

            Response.Redirect("PaymentSimulation.aspx");
        }
        protected void Button1_ServerClick(object sender, EventArgs e)
        {
            TourGuide  ist    = new TourGuide();
            HtmlButton btn    = (HtmlButton)sender;
            string     name   = btn.Attributes["Name"];
            string     nric   = btn.Attributes["Nric"];
            int        phone  = Convert.ToInt32(btn.Attributes["Phone"]);
            string     email  = btn.Attributes["Email"];
            int        salary = Convert.ToInt32(btn.Attributes["Salary"]);


            Session["NAME"]   = name;
            Session["NRIC"]   = nric;
            Session["PHONE"]  = phone;
            Session["EMAIL"]  = email;
            Session["SALARY"] = salary;

            Response.Redirect("Bonus.aspx");

            int re = ist.Update(Convert.ToInt32("9787978"), nric);
        }