public void insertDemande(Demande d) { string dt = (d.Date.Substring(0, 10)); DateTime dateValue = DateTime.Parse(dt); dt = dateValue.ToString("yyyy-MM-dd"); string req = "INSERT INTO `pharma`.`demande` (`date`, `debut`, `fin`, `remarque`, `status`, `remarqueGSB`, `idProd`, `idPharma`, `idDemande`) VALUES ('"+dt+ "', '" + d.Debut + "', '" + d.Fin + "' , '" + d.Remarque + "' , '" + d.Status + "', '" + d.RemarqueGSB + "', " + d.IdProd + "," + d.IdPharma + "," + d.IdDemande + ")"; test = req; MySqlCommand myCommand = new MySqlCommand(req); myCommand.Connection = conn; myCommand.ExecuteNonQuery(); refuserDemande(d.IdDemande, "contre offre"); }
private void button4_Click(object sender, EventArgs e) { Demande d2 = new Demande(0, tb_date.Text, tb_debut.Text,tb_fin.Text,tb_remarque.Text,"en attente","",d.IdProd,d.IdPharma,d.Id); dao.insertDemande(d2); dataGridView1.DataSource = null; DataSet donnees = dao.GetAllDemandesInDataSet(); dataGridView1.DataSource = donnees; dataGridView1.DataMember = donnees.Tables[0].ToString(); hidetb(); }
private void button1_Click(object sender, EventArgs e) { d = new Demande(Convert.ToInt16(dataGridView1.CurrentRow.Cells["id"].Value), Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value), Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value), Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value), Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value), Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value), Convert.ToString(dataGridView1.CurrentRow.Cells[6].Value), Convert.ToInt16(dataGridView1.CurrentRow.Cells[7].Value), Convert.ToInt16(dataGridView1.CurrentRow.Cells[8].Value),0); hidetb(); }