Esempio n. 1
0
        // GET: Instances/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Instance instance = instanceService.GetInstance(id);

            if (instance == null)
            {
                return(HttpNotFound());
            }
            return(View(instance));
        }
Esempio n. 2
0
        private bool connectToServer()
        {
            try
            {
                connection              = new QueryableConnection();
                connection.ServerName   = txtServer.Text;
                connection.DatabaseName = txtSecurity.Text;


                var password = new SecureString();
                foreach (char x in txtPassword.Text)
                {
                    password.AppendChar(x);
                }
                password.MakeReadOnly();

                if (!chkWindAuth.Checked)
                {
                    connection.SqlCredential = new SqlCredential(txtUsername.Text, password);
                }

                instanceService = new InstanceService();
                instance        = instanceService.GetInstance(connection);
                return(true);
            }
            catch
            {
                return(false);
            }
        }