public static void AutoUpdate(string location, string user, string password) { System.Diagnostics.Process pr = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo prStart = new System.Diagnostics.ProcessStartInfo(); prStart.FileName = "AutoUpdate.exe"; prStart.Arguments = location + " " + AppDomain.CurrentDomain.FriendlyName; pr.StartInfo = prStart; System.Diagnostics.Process prAgent = ApplicationRun.RunningInstance(MesAgent); //System.Diagnostics.Process prDCT = ApplicationRun.RunningInstance(DCTServer); pr.Start(); if (prAgent != null) { prAgent.Kill(); } // Marked By Hi1/Venus.Feng on 20080908 for Hisense Version : not need to kill DCT in CS // The Updater will Kill it //if( prDCT != null) //{ // prDCT.Kill(); //} // End Marked Application.Exit(); }
public override void Execute() { BenQGuru.eMES.Client.Service.ApplicationService.Current().CloseAllMdiChildren(); ApplicationRun.GetInfoForm().Clear(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); base.Execute(); }
public override void RCardRun() { base.RCardRun(); try { string strRCard = currentRunningCard; DateTime dtStart = DateTime.Now; actionForm.ucLabEditInputID.Value = strRCard; actionForm.ucLabEditInputID_TxtboxKeyPress(actionForm.ucLabEditInputID, new KeyPressEventArgs('\r')); f.LogCostTime(dtStart, strRCard); } catch (Exception ex) { UserControl.Messages msg = new UserControl.Messages(); msg.Add(new UserControl.Message(ex)); ApplicationRun.GetInfoForm().Add(msg); } }
public MenuService(IDomainDataProvider provider) { if (provider != null) { _domainDataProvider = provider; } try { _facade = (SecurityFacade)Activator.CreateInstance(typeof(SecurityFacade), new object[] { provider }); } catch (Exception ex) { Common.Log.Error(ex.Message); ApplicationRun.GetInfoForm().Add(new UserControl.Message(ex)); _facade = new SecurityFacade(provider); } // _facade = new SecurityFacade(_domainDataProvider); }
private void f_CollectTick(object sender, EventArgs e) { if (bExecuteing == true) { return; } bExecuteing = true; try { BeforeRCardRun(); RCardRun(); AfterRCardRun(); } catch (Exception ex) { UserControl.Messages msg = new UserControl.Messages(); msg.Add(new UserControl.Message(ex)); ApplicationRun.GetInfoForm().Add(msg); } finally { bExecuteing = false; } }
private void DispathSubToolbarOnClick(object key, IMenu menu) { try { for (int i = 0; i < menu.SubMenus.Length; i++) { if (menu.SubMenus[i].Key != null) { if (menu.SubMenus[i].Key.Equals(key)) { // 检查权限 bool needCheck = true; foreach (string needlessCheckKey in this.getNeedlessCheckRightKey()) { if (key.ToString() == needlessCheckKey) { needCheck = false; break; } } if (needCheck) { if (ApplicationService.Current().UserCode == null) { ApplicationRun.GetInfoForm().Add("请先登录系统!"); return; } // 检查Resource权限 //Laws Lu,2005/08/31,修改 Admin组权限,允许Pass // ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)_domainDataProvider).PersistBroker.OpenConnection(); //2005/10/26,修改 缓解性能 object[] objUserGroup = ApplicationService.Current().LoginInfo.UserGroups; //(new BaseSetting.UserFacade(_domainDataProvider)).GetUserGroupofUser(ApplicationService.Current().UserCode); bool bIsAdmin = false; if (objUserGroup != null) { foreach (object o in objUserGroup) { if (((BenQGuru.eMES.Domain.BaseSetting.UserGroup)o).UserGroupType == "ADMIN") { bIsAdmin = true; break; } } } if (!bIsAdmin) { // if ( !this._facade.CheckResourceRight(ApplicationService.Current().UserCode, ApplicationService.Current().ResourceCode) ) // { // throw new Exception("$Error_No_Resource_Right"); // return; // } if (!this._facade.CheckAccessRight(ApplicationService.Current().UserCode, key.ToString().ToUpper())) { //throw new Exception("没有访问权限!"); ApplicationRun.GetInfoForm().Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_No_Access_Right")); return; } } // if ( ApplicationService.Current().UserCode != "ADMIN" && !this._facade.CheckAccessRight(ApplicationService.Current().UserCode, key.ToString()) ) // { // ApplicationRun.GetInfoForm().Add("没有访问权限!"); // return; // } } if (menu.SubMenus[i].Command != null) { menu.SubMenus[i].Command.Execute(); } break; } if (menu.SubMenus[i].SubMenus != null) { DispathSubToolbarOnClick(key, menu.SubMenus[i]); } } } } catch { ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)_domainDataProvider).PersistBroker.CloseConnection(); } finally { ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)_domainDataProvider).PersistBroker.CloseConnection(); } }