private void LlenarComboCategoriaCheck(string IDCheckList) { try { CategoriaCheckList Datos = new CategoriaCheckList { IncluirSelect = true, Conexion = Comun.Conexion, IDCheckList = IDCheckList }; CategoriaCheckList_Negocio CN = new CategoriaCheckList_Negocio(); this.cmbCategoria.DataSource = CN.LlenarComboCategoriaCheck(Datos); this.cmbCategoria.DisplayMember = "Descripcion"; this.cmbCategoria.ValueMember = "IDCategoriaChe"; } catch (Exception ex) { throw ex; } }
private void btnGuardar_Click(object sender, EventArgs e) { try { this.txtMensajeError.Visible = false; List <Error> Errores = this.ValidarDatos(); if (Errores.Count == 0) { CategoriaCheckList Datos = this.ObtenerDatos(); CategoriaCheckList_Negocio cn = new CategoriaCheckList_Negocio(); cn.ABCCategoriaChecKList(Datos); if (Datos.Completado) { MessageBox.Show("Datos guardados correctamente.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); this._DatosCategoria = Datos; this.DialogResult = DialogResult.OK; } else if (Datos.Resultado == -2) { MessageBox.Show("El orden ya existe para una categoria", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("Ocurrió un error al guardar los datos.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { this.MostrarMensajeError(Errores); } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevoCategoriaCheklist ~ btnGuardar_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }