/// <summary> /// Metodo para modificar los clientes de la base de datos /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnModificar_Click(object sender, EventArgs e) { IBLLCliente _BLLCliente = new BLLCliente(); erpErrores.Clear(); try { if (string.IsNullOrEmpty(txtNombreMod.Text)) { erpErrores.SetError(txtNombre, "Debe contener un valor"); } else { if (string.IsNullOrEmpty(txtApellidoMod.Text)) { erpErrores.SetError(txtApellido, "Debe contener un valor"); } else { if (string.IsNullOrEmpty(mskTelefonoMod.Text)) { erpErrores.SetError(mskTelefonoMod, "Debe contener un valor"); } else { if (string.IsNullOrEmpty(txtCorreoMod.Text)) { erpErrores.SetError(txtCorreoMod, "Debe contener un valor"); } else { if (string.IsNullOrEmpty(rctDireccionMod.Text)) { erpErrores.SetError(rctDireccionMod, "Debe contener un valor"); } else { bool activo = false; activo = (rbActivoSiMod.Checked) ? true : false; _BLLCliente.ModificarCliente(FactoryCliente.ConstruirCliente(mskNumeroCedulaMod.Text, txtNombreMod.Text, txtApellidoMod.Text, mskTelefonoMod.Text, txtCorreoMod.Text, Convert.ToString(cboProvinciasMod.SelectedItem), rctDireccionMod.Text, activo)); MessageBox.Show("Se modificó con éxito"); EspaciosBlancoMod(); } } } } } } catch (Exception er) { StringBuilder msg = new StringBuilder(); msg.AppendFormat("Message {0}\n", er.Message); msg.AppendFormat("Source {0}\n", er.Source); msg.AppendFormat("InnerException {0}\n", er.InnerException); msg.AppendFormat("StackTrace {0}\n", er.StackTrace); msg.AppendFormat("TargetSite {0}\n", er.TargetSite); _MyLogControlEventos.ErrorFormat("Error {0}", msg.ToString()); MessageBox.Show("Se ha producido el siguiente error " + er.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Controlador() { this.factoryCliente = new FactoryConcretoCliente(); this.factoryServicio = new FactoryConcretoServicio(); this.factoryIEscritor = new ArrayList(); this.factoryIEscritor.Add(new FactoryConcretoBitacora().crearBitacora("BitacoraCSV")); this.factoryIEscritor.Add(new FactoryConcretoBitacora().crearBitacora("BitacoraXML")); }