1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| protected void GvTA_SelectedIndexChanged(object sender, EventArgs e)
{
string ID_Ticket = GvTA.SelectedRow.Cells[1].Text;
string TicketTypeCode = GvTA.SelectedRow.Cells[2].Text;
string DateValueA = GvTA.SelectedRow.Cells[4].Text;
string ID_Demandeur = GvTA.SelectedRow.Cells[5].Text;
string Poste = GvTA.SelectedRow.Cells[8].Text;
string Sous_Poste = GvTA.SelectedRow.Cells[9].Text;
string Email = GvTA.SelectedRow.Cells[13].Text;
string connectionString = GetConnectionString();
using (SqlConnection connection = new SqlConnection())
{
connection.ConnectionString = connectionString;
connection.Open();
string strqr = "INSERT INTO [WBDT_MNT_TICKET] (ID_DT_Ticket, TicketTypeCode, 'DateValueA', DateValueI, EventCode, AssignedUserID, DTStatus, SessionUserID, WorkBench, WorkBenchDiv, EmailFollowing, WorkerCount) VALUES ('" + Convert.ToInt32(ID_Ticket) + "', '" + Convert.ToInt32(TicketTypeCode) + "', '" + Convert.ToDateTime(DateValueA) + "', '" + Convert.ToDateTime(Time.Text) + "', '009', '" + ddlInterv.Text + "', '001', 'ID_Demandeur', 'Poste', 'Sous_Poste', '" + Convert.ToInt32(Email) + "', '1')";
SqlCommand myCm = new SqlCommand(strqr, connection);
int numrw = myCm.ExecuteNonQuery();
connection.Close();
}
} |
Partager