Exemple #1
0
        public virtual AdminDeployment GetDeployment(string deploymentId)
        {
            try
            {
                string stm    = string.Format("SELECT * FROM Deployments WHERE Id ='{0}'", deploymentId);
                var    broker = ServicesManager.Instance.ExecuteQuery <AdminDeployment>(stm, (rdr, list) =>
                {
                    AdminDeployment deployment = new AdminDeployment
                    {
                        FriendlyName        = rdr["Name"].ToString(),
                        Id                  = rdr["Id"].ToString(),
                        RDSConnectionBroker = rdr["FQDN"].ToString(),
                        name                = rdr["FQDN"].ToString(),
                        displayName         = rdr["FQDN"].ToString(),
                        status              = "Available",
                        Description         = rdr["Description"] == null ? string.Empty : rdr["Description"].ToString()
                    };
                    list.Add(deployment);
                }).FirstOrDefault();

                // Get Audit location
                broker.AuditLocation = string.Empty;    // TODO: populate real data when this feature is ready

                return(broker);
            }
            catch (Exception ex)
            {
                ErrorHelper.SendExcepToDB(ex, " GetDeployment", deploymentId);
                throw ex;
            }
        }
Exemple #2
0
 public virtual List <AdminDeployment> GetList(string subscriptionId = "")
 {
     return(ServicesManager.Instance.ExecuteQuery <AdminDeployment>("SELECT * FROM Deployments", (rdr, list) =>
     {
         var deployment = new AdminDeployment();
         deployment.Id = rdr["Id"].ToString();
         deployment.defaultNavigationId = rdr["Id"].ToString();
         deployment.FriendlyName = rdr["Name"].ToString();
         deployment.RDSConnectionBroker = rdr["FQDN"].ToString();
         deployment.Description = rdr["Description"] == null ? string.Empty : rdr["Description"].ToString();
         deployment.name = rdr["FQDN"].ToString();
         deployment.displayName = rdr["FQDN"].ToString();
         deployment.status = "Available";
         list.Add(deployment);
     }));
 }