Пример #1
0
        public void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        {
            if (e.CommandName.Equals("call"))
            {

                DataListItem item = (DataListItem)(((Button)(e.CommandSource)).NamingContainer);
                text = ((TextBox)item.FindControl("TextBox1")).Text;
                Response.Write(text+"text1");
            }

            UploadAttribute.WebService1 S1 = new UploadAttribute.WebService1();
            S1.Credentials = System.Net.CredentialCache.DefaultCredentials;

            String a;

            a = S1.deleteTable(text);

            string imgurl = Server.MapPath("~/storage/"+text + "");
            System.IO.File.Delete(imgurl);

            if (a.Equals("Bought"))
            {

                Response.Write("Delete Successful");
                Response.Write(text);
            }
            else
                Response.Write("Delete UnSuccessful");
        }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var fName = FileUpload1.FileName;
            var usrName = TextBox3.Text;
            var sessionVar = "" + usrName +"-"+ fName+"";
            var notes = TextBox1.Text;
            var location = TextBox2.Text;

            //            FileUpload1.SaveAs(Server.MapPath("storage\\"+usrName+"-" + FileUpload1.FileName + ""));
            FileUpload1.SaveAs(Server.MapPath("storage\\"+ sessionVar + ""));

            UploadAttribute.WebService1 S1 = new UploadAttribute.WebService1();
            S1.Credentials = System.Net.CredentialCache.DefaultCredentials;

            String a;

            a = S1.insertTable(usrName, sessionVar, notes, location);

            if (a.Equals("Success insert"))
            {

                Response.Write("Upload Successful");

            }
            else
                Response.Write("Upload not Successful");
        }