protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Process") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index]; string s = row.Cells[4].Text; Exam_Board eb1 = new Exam_Board(s); s = eb1.m_OrganisationFriendlyName; string series = row.Cells[2].Text; if (ProcessFile(eb1, series, ref s)) { s = "success"; Label_message.Text = "Success! "; } else { Label_message.Text = s; } Encode en = new Encode(); Exam_Entry_CountbyBoardList el1 = new Exam_Entry_CountbyBoardList(); el1.Load(SeasonCode.ToString(), Year.ToString(), "4", false); //ie NOT sent if (el1.m_list.Count > 0) //ie entries to send { SqlDataSource1.SelectCommand = GetSummaryString(); SqlDataSource1.ConnectionString = en.GetDbConnection(); SqlDataSource1.DataBind(); } else { Label_message.Text = "All Entries sent!"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetMasterValues(); //are there any entries not sent Encode en = new Encode(); Exam_Entry_CountbyBoardList el1 = new Exam_Entry_CountbyBoardList(); el1.Load_NotSent(SeasonCode.ToString(), Year.ToString()); //ie NOT sent if (el1.m_list.Count > 0) //ie entries to send { SqlDataSource1.SelectCommand = GetSummaryString(); SqlDataSource1.ConnectionString = en.GetDbConnection(); SqlDataSource1.DataBind(); } else { Label_message.Text = "No Entries to Send"; } } }