private bool TestConnection() { bool flag = false; this.Cursor = Cursors.WaitCursor; if (!this.chk_LocalDB.Checked) { object[] text = new object[] { this.DataSource.Text, this.Catalog.Text, this.chk_Security.Checked, this.UserID.Text, this.Pwd1.Text }; this.connectionString = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info={2};User ID={3};Password={4}", text); } else { this.connectionString = "C3Sentinel"; } VMGlobal.SetTestConnection(this.connectionString); try { using (RPM_Account rPMAccount = new RPM_Account()) { rPMAccount.AccountCount(); flag = true; } } catch (Exception exception) { } this.Cursor = Cursors.Default; return(flag); }
public bool method_0() { bool flag = false; if (File.Exists(Path.Combine(VMGlobal.ProfilePath, VMGlobal.ProfileFile))) { VMGlobal.GetDBConnection(); flag = true; } else if ((new RegDB()).ShowDialog() == DialogResult.OK) { flag = true; } return(flag); }
public ActionResult Index() { HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName]; FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);//解密 string[] userData = authTicket.UserData.Split(new string[] { ",spt," }, StringSplitOptions.None); var user = UserLogic.GetUserWhenLogin(userData[0], userData[1]); if (user == null) { return(RedirectToAction("Login", "Account")); } var modules = UserLogic.ModuleProcessOfUser(user.ID); var jsconvert = new JavaScriptSerializer(); ViewData["PoweredBrands"] = jsconvert.Serialize(VMGlobal.GetPoweredBrands(user)); ViewData["CurrentUser"] = jsconvert.Serialize(user); return(View(ConstructModules(modules))); }
private void menuRefresh_Click(object sender, RadRoutedEventArgs e) { VMGlobal.Refresh(); }