Example #1
0
        Boolean guardarDatos()
        {
            try
            {
                Boolean         bolReult     = false;
                fa_TipoNota_Bus bus_tiponota = new fa_TipoNota_Bus();
                int             id           = 0;
                string          msg          = "";
                if (validarDatos())
                {
                    get_TipoNota();
                    switch (_Accion)
                    {
                    case Cl_Enumeradores.eTipo_action.grabar:
                        if (bus_tiponota.GrabarDB(info, ref id, ref msg))
                        {
                            bolReult = true;
                            // MessageBox.Show("Registro guardado exitosamente", "SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            lbl_id_tipo_nota.Text = Convert.ToString(id);
                            string smensaje = string.Format(Core.Erp.Recursos.Properties.Resources.msgDespues_Grabar, "El tipo de Nota", id);
                            MessageBox.Show(smensaje, param.Nombre_sistema);
                            //ucGe_Menu.Visible_btnGuardar = false;
                            //ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                            LimpiarDatos();
                        }
                        else
                        {
                            MessageBox.Show("Error " + msg, "SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }

                        break;

                    case Cl_Enumeradores.eTipo_action.actualizar:
                        if (bus_tiponota.ModificarDB(info, ref msg))
                        {
                            bolReult = true;
                            // MessageBox.Show("Registro modificado exitosamente", "SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            string smensaje = string.Format(Core.Erp.Recursos.Properties.Resources.msgDespues_Modificar, "El tipo de Nota", info.IdTipoNota);
                            MessageBox.Show(smensaje, param.Nombre_sistema);
                            //ucGe_Menu.Visible_btnGuardar = false;
                            //ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                            LimpiarDatos();
                        }
                        else
                        {
                            MessageBox.Show("Error " + msg, "SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }


                        break;
                    }
                }
                return(bolReult);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }