private void btnGuardar_Click(object sender, EventArgs e) { cls_Estados_BLL Obj_Estados_BLL = new cls_Estados_BLL(); if ((string.IsNullOrEmpty(txt_ID_Estados.Text)) || (string.IsNullOrEmpty(txt_Descripcion.Text))) { MessageBox.Show("No se pueden guardar datos vacios", "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { string sMsjError = string.Empty; Obj_DAL_Estados.cIdEstado = Convert.ToChar(txt_ID_Estados.Text.Trim()); Obj_DAL_Estados.sDescripcion = txt_Descripcion.Text.Trim(); if (Obj_DAL_Estados.cBandAX == 'I') { Obj_Estados_BLL.Insertar_Estados(ref sMsjError, ref Obj_DAL_Estados); if (sMsjError == string.Empty) { MessageBox.Show("Se han ingresado los datos correctamente", "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information); lb_Guardar.Text = "Modificar"; } else { MessageBox.Show("Hubo un error al ingresar los datos a la base de datos:" + "[" + sMsjError + "]", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if ((Obj_DAL_Estados.cIdEstado == 'U') || (Obj_DAL_Estados != null)) { Obj_Estados_BLL.Modificar_Estados(ref sMsjError, ref Obj_DAL_Estados); if (sMsjError == string.Empty) { MessageBox.Show("Se han ingresado los datos correctamente", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Hubo un error al ingresar los datos a la base de datos:" + "[" + sMsjError + "]", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }