public IHttpActionResult Putsecure(int id, secure secure)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != secure.secID)
            {
                return(BadRequest());
            }

            db.Entry(secure).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!secureExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
 public ZoneObserver(string name, source source = source.All, secure secure = secure.Either, target target = target.Anonymous)
 {
     this.src  = source;
     this.trgt = target;
     this.sec  = secure;
     this.zone = name;
 }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            secure secure = db.secures.Find(id);

            db.secures.Remove(secure);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "secID,Name,Date,Topic,Details")] secure secure)
 {
     if (ModelState.IsValid)
     {
         db.Entry(secure).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(secure));
 }
Example #5
0
        public ActionResult Create([Bind(Include = "secID,Name,Date,Topic,Details")] secure secure)
        {
            if (ModelState.IsValid)
            {
                db.secures.Add(secure);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(secure));
        }
        public IHttpActionResult Postsecure(secure secure)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.secures.Add(secure);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = secure.secID }, secure));
        }
Example #7
0
        static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials)
        {
            secure       secure   = new secure();
            settingClass settings = secure.get_settings();

            if (settings.debug == "true")
            {
                Console.WriteLine("CxSDKWebService called: {0}", settings.CxSDKWebService);
            }
            serviceEndpoint.Address =
                new System.ServiceModel.EndpointAddress(new System.Uri(settings.CxSDKWebService),
                                                        new System.ServiceModel.DnsEndpointIdentity(""));
        }
        public IHttpActionResult Deletesecure(int id)
        {
            secure secure = db.secures.Find(id);

            if (secure == null)
            {
                return(NotFound());
            }

            db.secures.Remove(secure);
            db.SaveChanges();

            return(Ok(secure));
        }
Example #9
0
        // GET: secures/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            secure secure = db.secures.Find(id);

            if (secure == null)
            {
                return(HttpNotFound());
            }
            return(View(secure));
        }
Example #10
0
        static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials)
        {
            secure       secure   = new secure();
            settingClass settings = secure.get_settings();

            Console.WriteLine("CxSDKWebService called: {0}", settings.CxSDKWebService);
            Console.WriteLine("CxSDKWebService called: {0}", _options.token.user_name);
            serviceEndpoint.Address =
                new System.ServiceModel.EndpointAddress(new System.Uri(settings.CxSDKWebService),
                                                        new System.ServiceModel.DnsEndpointIdentity(""));

            System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
            binding.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None;
            serviceEndpoint.Binding = binding;
        }
        public async Task <IHttpActionResult> GetSecure(int id)
        {
            secure s = await db.secures.FindAsync(id);

            if (s == null)
            {
                return(NotFound());
            }

            secureDTO secure = new secureDTO
            {
                secID   = s.secID,
                Name    = s.Name,
                Date    = s.Date,
                Topic   = s.Topic,
                Details = s.Details
            };

            return(Ok(secure));
        }