// UPDATE SALDO DO SETOR LOCAL //------------------------------------------------------------------------------------------------------------ public static void SetorSaldoLocalUpdate(int IDSetor, decimal Valor) { try { // --- Ampulheta ON Cursor.Current = Cursors.WaitCursor; // execute frmPrincipal principal = Application.OpenForms.OfType <frmPrincipal>().First(); objSetor setor = principal.propSetorPadrao; if (setor.IDSetor == IDSetor) { setor.SetorSaldo += Valor; } } catch (Exception ex) { AbrirDialog("Uma exceção ocorreu ao ALTERAR o saldo do SETOR local..." + "\n" + ex.Message, "Exceção", DialogType.OK, DialogIcon.Exclamation); throw ex; } finally { // --- Ampulheta OFF Cursor.Current = Cursors.Default; } }
//--- OCULTAR E REVELAR O MENU PRINCIPAL public static void OcultaMenuPrincipal() { frmPrincipal frm = Application.OpenForms.OfType <frmPrincipal>().First(); frm.mnuPrincipal.Visible = false; frm.pnlTop.BackColor = Color.Gainsboro; frm.btnConfig.Enabled = false; }
//--- REVELA MENU PRINCIPAL public static void MostraMenuPrincipal() { frmPrincipal frm = Application.OpenForms.OfType <frmPrincipal>().First(); frm.mnuPrincipal.Visible = true; frm.mnuPrincipal.Enabled = true; frm.pnlTop.BackColor = Color.SlateGray; frm.btnConfig.Enabled = true; }
// GET DATE PADRAO //------------------------------------------------------------------------------------------------------------ public static DateTime DataPadrao() { frmPrincipal principal = Application.OpenForms.OfType <frmPrincipal>().First(); return(principal.propDataPadrao); }
// GET SETOR PADRAO //------------------------------------------------------------------------------------------------------------ public static objSetor SetorPadrao() { frmPrincipal principal = Application.OpenForms.OfType <frmPrincipal>().First(); return(principal.propSetorPadrao.ShallowCopy()); }