示例#1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            String dataforblock = String.Empty;
            String combinedata  = "00200";

            string        strConnString = ConfigurationManager.ConnectionStrings["DRSNdatabase"].ConnectionString;
            SqlConnection sqlcon        = new SqlConnection(strConnString);

            try
            {
                sqlcon.Open();
                SqlCommand sqlcmd = new SqlCommand("ack", sqlcon);
                sqlcmd.CommandType = System.Data.CommandType.StoredProcedure;
                String acc = Session["accountid"].ToString();
                sqlcmd.Parameters.AddWithValue("@accountid", acc);
                sqlcmd.Parameters.AddWithValue("@requestid", TextBox1.Text);
                sqlcmd.ExecuteNonQuery();


                dataforblock = acc + combinedata + TextBox1.Text + "Accepting a request";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            sqlcon.Close();

            Business_Application.startblockchain sb = new Business_Application.startblockchain();
            sb.startb(dataforblock);


            Response.Redirect("Dashboard.aspx");
        }
        protected void Button4_Click1(object sender, EventArgs e)
        {
            String        dataforblock = String.Empty;
            String        combinedata  = "00200";
            String        connection   = ConfigurationManager.ConnectionStrings["DRSNdatabase"].ConnectionString;
            SqlConnection sqlcon       = new SqlConnection(connection);

            try
            {
                sqlcon.Open();
                SqlCommand sqlcmd = new SqlCommand("newsupdate", sqlcon);
                sqlcmd.CommandType = System.Data.CommandType.StoredProcedure;
                String acc = Session["accountid"].ToString();

                sqlcmd.Parameters.AddWithValue("@accountid", acc);
                sqlcmd.Parameters.AddWithValue("@disastername", form34.Value);
                sqlcmd.Parameters.AddWithValue("@impacts", form29.Value);
                sqlcmd.Parameters.AddWithValue("@participants", form32.Value);
                sqlcmd.Parameters.AddWithValue("@rescue", form8.Value);



                sqlcmd.ExecuteNonQuery();

                dataforblock = acc + combinedata + form34.Value + combinedata + form29.Value + combinedata +
                               form32.Value + combinedata + form8.Value + "News";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            sqlcon.Close();



            Business_Application.startblockchain sb = new Business_Application.startblockchain();
            sb.startb(dataforblock);



            Response.Redirect("Dashboard.aspx");
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            String dataforblock = String.Empty;
            String combinedata  = "00200";

            String        connection = ConfigurationManager.ConnectionStrings["DRSNdatabase"].ConnectionString;
            SqlConnection sqlcon     = new SqlConnection(connection);

            try
            {
                sqlcon.Open();
                SqlCommand sqlcmd = new SqlCommand("servicerequest", sqlcon);
                sqlcmd.CommandType = System.Data.CommandType.StoredProcedure;
                String acc = Session["accountid"].ToString();

                sqlcmd.Parameters.AddWithValue("@accountid", acc);
                sqlcmd.Parameters.AddWithValue("@requestid", randomstring());
                sqlcmd.Parameters.AddWithValue("@service", form34.Value);
                sqlcmd.Parameters.AddWithValue("@acknowledger", "null");
                sqlcmd.Parameters.AddWithValue("@requestdescription", form8.Value);
                sqlcmd.Parameters.AddWithValue("@contactnumber", form32.Value);
                sqlcmd.Parameters.AddWithValue("@emailid", form29.Value);



                sqlcmd.ExecuteNonQuery();

                dataforblock = acc + combinedata + form34.Value + combinedata + form8.Value + combinedata +
                               form32.Value + combinedata + form29.Value + combinedata + "requesting a service";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            sqlcon.Close();

            Business_Application.startblockchain sb = new Business_Application.startblockchain();
            sb.startb(dataforblock);


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