Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnactualizar_Click(object sender, EventArgs e)
- {
- int resp;
- asignarDatosObjeto();
- resp = CATCAD.Actualizar(CATCRN);
- if (resp == 1)
- {
- UpdateDGV();
- }
- else
- {
- MessageBox.Show("Imposible conectarse a la base de datos: " + CATCAD.error,
- "Fallo la conexion", MessageBoxButtons.OK, MessageBoxIcon.Error);
- this.Close();
- }
- }
- public int Actualizar(CatalogoCRN dispObj)
- {
- SqlCommand UpdateCad;
- string comandoSql;
- try
- {
- comandoSql = string.Format("Call SP_ACTUALIZAR('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}')",
- dispObj.numFactura, dispObj.nameClient, dispObj.numPart, dispObj.tipMaterial, dispObj.DescriptionESp,
- dispObj.DescriptionUSA,dispObj.quantity,dispObj.UnitPrice, dispObj.numPallet, dispObj.date,dispObj.observations,dispObj.country);
- connectionSql.Open();
- UpdateCad = new SqlCommand(comandoSql, connectionSql);
- UpdateCad.ExecuteNonQuery();
- connectionSql.Close();
- return 1;
- }
- catch (Exception ex)
- {
- error = ex.Message;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement