Beispiel #1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     if (holded)
     {
         Forms.PassRequest pass = new Forms.PassRequest();
         pass.usuario = CurrentUser.Login;
         pass.ShowDialog();
         if (pass.DialogResult == DialogResult.Yes)
         {
             pnlContent.Enabled = true;
             flpMenu.Enabled    = true;
             toolStripDropDownArchivo.Enabled = true;
             toolStripDropDownButton2.Enabled = true;
             toolStripDropDownButton1.Enabled = true;
             toolStripDropDownButton3.Enabled = true;
             toolStripDropDownButton5.Enabled = true;
             toolStripDropDownButton4.Enabled = true;
             holded = false;
         }
     }
     else
     {
         holded             = true;
         pnlContent.Enabled = false;
         flpMenu.Enabled    = false;
         toolStripDropDownArchivo.Enabled = false;
         toolStripDropDownButton2.Enabled = false;
         toolStripDropDownButton1.Enabled = false;
         toolStripDropDownButton3.Enabled = false;
         toolStripDropDownButton5.Enabled = false;
         toolStripDropDownButton4.Enabled = false;
     }
 }
        private void btnRegistrarProducto_Click(object sender, EventArgs e)
        {
            try
            {
                PassRequest pasreq = new PassRequest();
                pasreq.usuario = "Administrador";
                pasreq.ShowDialog();
                if (pasreq.DialogResult == DialogResult.Yes)
                {
                    FrmProducto producto = new FrmProducto();
                    producto.ShowDialog();
                    FillDgv_Productos(ProductoDAL.getProductos(1000));
                }
            }
            catch (Exception ex)
            {
                string folderName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Errores_" + Assembly.GetExecutingAssembly().GetName().Name + "_V_" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
                string fileName   = "Exeptions_" + Name + ".txt";

                Validation.FormManager frmManager = new Validation.FormManager();
                frmManager.writeException(folderName, fileName, ex, "Ha ocurrido un error al intentar cargar la información de este control");
                MessageBox.Show("Ha ocurrido un error al intentar cargar la información de este control, por favor comuniquese con el desarrollador al correo " + Properties.Settings.Default.developerEmail, "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }