Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void btnLOU_Click(object sender, EventArgs e)
- {
- this.purge();
- using (SqlConnection connection = new SqlConnection(GetConnectionInfo()))
- {
- SqlCommand command;
- SqlCommand command2;
- SqlCommand command3;
- update = false;
- connection.Open();
- using (command3 = new SqlCommand("SELECT Fraction FROM ReserveNumbers", connection))
- {
- this.cbInitialReservesRequested.Items.Clear();
- this.cbInitialReservesRequested.Items.Add(" ");
- SqlDataReader reader = command3.ExecuteReader();
- while (reader.Read())
- {
- this.cbInitialReservesRequested.Items.Add(reader.GetValue(0).ToString());
- }
- reader.Close();
- }
- using (command = new SqlCommand("SELECT MAX(RecordNumber) FROM LossOfUnit", connection))
- {
- SqlDataReader reader = command.ExecuteReader();
- while (reader.Read())
- {
- recordID = int.Parse(reader.GetValue(0).ToString()) + 1;
- }
- reader.Close();
- }
- if (!base.IsPostBack)
- {
- using (command2 = command = new SqlCommand(string.Format("DELETE FROM ReserveRecords WHERE AssociatedLossOfUnitRecord={0}", recordID), connection))
- {
- command.ExecuteNonQuery();
- }
- }
- this.FTMSGV.SelectCommand = string.Format("SELECT [Participant], [Fraction], convert(CHAR(5), ReqTime, 8) AS ReqTime, [FMPP], [FPL], [GVL], [JEA], [HST], [NSB], [PEF], [RCI], [SEC], [TEC], [TAL], [FRCC], [FRSG], [RecordNumber] FROM [ReserveRecords] WHERE [AssociatedLossOfUnitRecord] = {0}", recordID);
- this.FTMSGV.DataBind();
- this.gvReserveRecords.DataBind();
- }
- this.pnlForm.Visible = true;
- this.txtSubmit.Visible = true;
- this.pnlGrid.Visible = false;
- this.lblError.Visible = false;
- this.lblError.Text = null;
- this.lblInitialReservesRequested.Text = null;
- this.lblInitialReservesRequested.Visible = false;
- this.cbInitialReservesRequested.Visible = true;
- }
Add Comment
Please, Sign In to add comment