void BeforeExitwfCapture(object sender) { Global.ACSGlobal.TipoCaptura = 0; if (ACSGlobal.UsuarioLogado.USR_FLAGDIGITALIZACAO == 1) { ACSConfig.SystemAction = ModeSystem.Scan; } if (ACSGlobal.UsuarioLogado.USR_FLAGIMPORTACAO == 1) { ACSConfig.SystemAction = ACSConfig.SystemAction | ModeSystem.Import; } if (ACSGlobal.UsuarioLogado.USR_FLAGPROCESSAMENTO == 1 || ACSConfig.GetApp().User == ModeUser.Mono) { ACSConfig.SystemAction = ACSConfig.SystemAction | ModeSystem.Process; } if (((ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Import | ModeSystem.Process))) && ACSGlobal.UsuarioLogado.USR_NIVELASSINA > 1 ) { var wfTA = new WFTipoAcao(); wfTA.btnEscanear.Visible = true; // wfTA.btnEscanear.Visible = ((ACSConfig.SystemAction & (ModeSystem.Scan)) == ModeSystem.Scan); wfTA.btnImportar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Import)) == ModeSystem.Import); wfTA.btnProcessar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Process)) == ModeSystem.Process) && (ACSConfig.GetApp().User == ModeUser.Multi); wfTA.MdiParent = this; wfTA.WindowState = FormWindowState.Normal; wfTA.BeforeExitEvent += BeforeExitTipoAcao; wfTA.Dock = DockStyle.Fill; wfTA.Show(); } else if (ACSGlobal.UsuarioLogado.USR_NIVELASSINA > 1) { var wfTAs = new WFAssinaNivel2(); wfTAs.MdiParent = this; wfTAs.WindowState = FormWindowState.Normal; wfTAs.Dock = DockStyle.Fill; wfTAs.BeforeExitEvent += BeforeExitwfAssinatura; wfTAs.Show(); } else if ((ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Import | ModeSystem.Process))) { var wfTA = new WFTipoAcao(); wfTA.btnAssinar.Visible = false; wfTA.btnEscanear.Visible = ((ACSConfig.SystemAction & (ModeSystem.Scan)) == ModeSystem.Scan); wfTA.btnImportar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Import)) == ModeSystem.Import); wfTA.btnProcessar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Process)) == ModeSystem.Process) && (ACSConfig.GetApp().User == ModeUser.Multi); wfTA.MdiParent = this; wfTA.WindowState = FormWindowState.Normal; wfTA.BeforeExitEvent += BeforeExitTipoAcao; wfTA.Dock = DockStyle.Fill; if (!ACSConfig.GetScanner().Driver.ToUpper().Contains("FUJITSU") && !ACSConfig.GetScanner().Driver.ToUpper().Contains("SP-1120")) { Application.DoEvents(); } wfTA.Show(); } }
void BeforeExitLogin(object sender) { //teste nova tela assinador 05012016 (sender as WFLogin).Hide(); if (ACSGlobal.UsuarioLogado == null || ACSGlobal.UsuarioLogado.USR_IDUSUARIO == 0) { Application.Exit(); } else { int iQntAcao = 0; if (ACSGlobal.UsuarioLogado.USR_FLAGDIGITALIZACAO == 1) { ACSConfig.SystemAction = ModeSystem.Scan; iQntAcao++; } if (ACSGlobal.UsuarioLogado.USR_FLAGIMPORTACAO == 1) { ACSConfig.SystemAction = ACSConfig.SystemAction | ModeSystem.Import; iQntAcao++; } if (ACSGlobal.UsuarioLogado.USR_FLAGPROCESSAMENTO == 1 || ACSConfig.GetApp().User == ModeUser.Mono) { ACSConfig.SystemAction = ACSConfig.SystemAction | ModeSystem.Process; } if (((ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Import | ModeSystem.Process))) && ACSGlobal.UsuarioLogado.USR_NIVELASSINA > 1 ) { iQntAcao++; var wfTA = new WFTipoAcao(); wfTA.btnEscanear.Visible = true; // wfTA.btnEscanear.Visible = ((ACSConfig.SystemAction & (ModeSystem.Scan)) == ModeSystem.Scan); wfTA.btnImportar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Import)) == ModeSystem.Import); wfTA.btnProcessar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Process)) == ModeSystem.Process) && (ACSConfig.GetApp().User == ModeUser.Multi); wfTA.btnAssinar.Visible = true; wfTA.MdiParent = this; wfTA.WindowState = FormWindowState.Normal; wfTA.BeforeExitEvent += BeforeExitTipoAcao; wfTA.Dock = DockStyle.Fill; if (iQntAcao > 1) { wfTA.Show(); } else { if (ACSGlobal.UsuarioLogado.USR_FLAGDIGITALIZACAO == 1) { changeScanOneAction(); attrAreas(); BeforeExitTipoAcao(sender); } if (ACSGlobal.UsuarioLogado.USR_FLAGIMPORTACAO == 1) { ACSConfig.SystemAction = ModeSystem.Import; Global.ACSGlobal.TipoCaptura = 2; if (ACSConfig.GetApp().User == ModeUser.Mono) { ACSConfig.SystemAction = ACSConfig.SystemAction | ModeSystem.Process; } attrAreas(); BeforeExitTipoAcao(sender); } } } else if (ACSGlobal.UsuarioLogado.USR_NIVELASSINA > 1) { var wfTAs = new WFAssinaNivel2(); wfTAs.MdiParent = this; wfTAs.WindowState = FormWindowState.Normal; wfTAs.Dock = DockStyle.Fill; wfTAs.BeforeExitEvent += BeforeExitwfAssinatura; wfTAs.Show(); } else if ((ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Import)) || (ACSConfig.SystemAction == (ModeSystem.Scan | ModeSystem.Process)) || (ACSConfig.SystemAction == (ModeSystem.Import | ModeSystem.Process))) { var wfTA = new WFTipoAcao(); wfTA.btnAssinar.Visible = false; wfTA.btnEscanear.Visible = ((ACSConfig.SystemAction & (ModeSystem.Scan)) == ModeSystem.Scan); wfTA.btnImportar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Import)) == ModeSystem.Import); wfTA.btnProcessar.Visible = ((ACSConfig.SystemAction & (ModeSystem.Process)) == ModeSystem.Process) && (ACSConfig.GetApp().User == ModeUser.Multi); wfTA.MdiParent = this; wfTA.WindowState = FormWindowState.Normal; wfTA.BeforeExitEvent += BeforeExitTipoAcao; wfTA.Dock = DockStyle.Fill; if (!ACSConfig.GetScanner().Driver.ToUpper().Contains("FUJITSU") && !ACSConfig.GetScanner().Driver.ToUpper().Contains("SP-1120")) { Application.DoEvents(); } if (iQntAcao > 1) { wfTA.Show(); } else { if (ACSGlobal.UsuarioLogado.USR_FLAGDIGITALIZACAO == 1) { changeScanOneAction(); attrAreas(); BeforeExitTipoAcao(sender); } if (ACSGlobal.UsuarioLogado.USR_FLAGIMPORTACAO == 1) { ACSConfig.SystemAction = ModeSystem.Import; Global.ACSGlobal.TipoCaptura = 2; if (ACSConfig.GetApp().User == ModeUser.Mono) { ACSConfig.SystemAction = ACSConfig.SystemAction | ModeSystem.Process; } attrAreas(); BeforeExitTipoAcao(sender); } } } else { WFMessageBox.Show("Usuário sem Acesso!", MessageBoxButtons.OK, MessageBoxIcon.Information); ACSDataBase.StopSession(); Application.ExitThread(); } } }