File manager - Edit - G:/PleskVhosts/indiaminerals.in/vgm.INFOFIXDEVELOPERS.COM/admin/PendingObserve.aspx.cs
Back
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WebApp.LIBS; namespace WebApp { public partial class PendingObserve : BasePageClass { protected void Page_Load(object sender, EventArgs e) { string connectionString = ConfigurationManager.ConnectionStrings["gav"].ConnectionString; // SQL query to retrieve data based on your conditions, joining registration and observation tables string query = "SELECT r.tag_no, r.animal_category, r.animal_arrived FROM registration r WHERE (r.status = 'Own' or r.status = 'Admitted') AND NOT EXISTS(SELECT 1 FROM observation o WHERE o.Tag_no = r.tag_no AND o.Date = @TodayDate);"; using (SqlConnection con = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand(query, con)) { // Set the parameter for today's date cmd.Parameters.AddWithValue("@TodayDate", DateTime.Now.Date); // Open the connection con.Open(); // Execute the query and get the results SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); // Bind the data to the GridView Gridview1.DataSource = dt; Gridview1.DataBind(); } } } protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Observe") { int rowIndex = Convert.ToInt32(e.CommandArgument); GridViewRow row = Gridview1.Rows[rowIndex]; // Get the Tag_no from the clicked row string tagNo = row.Cells[1].Text; // Assuming Tag_no is the second column // Store the Tag_no in Session for use on the Observation page Session["ObservationTag"] = tagNo; // Redirect to the Observation page Response.Redirect($"Observation.aspx?Tag_no={tagNo}"); } } } }
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.08 |
proxy
|
phpinfo
|
Settings