Exemplo n.º 1
0
 public GroupModel(ConnextBusinessLayer.Bdd.GROUP objBdd) : base(objBdd)
 {
     listUser = new List <UserBaseModel>();
     foreach (var userBdd in objBdd.USERs)
     {
         listUser.Add(new UserBaseModel(userBdd));
     }
 }
Exemplo n.º 2
0
        public void add(GROUP group)
        {
            try
            {
                var Context = new connext_dbEntities();
                Context.GROUPs.Add(group);
                Context.SaveChanges();
            }
            catch (Exception ex)
            {
            #if DEBUG
                throw new Exception("Impossible d'ajouter la groupe." + Environment.NewLine + ex.StackTrace);
            #else
                throw new Exception("Impossible d'ajouter la groupe.");

            #endif
            }
        }
Exemplo n.º 3
0
 // POST api/values
 public HttpResponseMessage Post(GroupModel model)
 {
     if (HttpContext.Current.Request.Headers["Authorization"] == null)
     {
         throw new HttpResponseException(HttpStatusCode.Unauthorized);
     }
     string token = HttpContext.Current.Request.Headers["Authorization"];
     GROUP objBdd = new GROUP();
     objBdd.LABEL = model.Label;
     manager.add(objBdd);
     return new HttpResponseMessage()
     {
         Content = new JsonContent(new
         {
             Success = true, //error
             Message = "Success" //return exception
         })
     };
 }
Exemplo n.º 4
0
 public GroupLiteModel(ConnextBusinessLayer.Bdd.GROUP objBdd)
 {
     Id    = objBdd.ID_GROUP;
     Label = objBdd.LABEL;
 }