Esempio n. 1
0
 public tbl_ParkingReasons POST([FromBody] tbl_ParkingReasons parkingReasons)
 {
     using (ClaimyWebServies_dbEntities2 entity = new ClaimyWebServies_dbEntities2())
     {
         entity.Configuration.ProxyCreationEnabled = false;
         entity.tbl_ParkingReasons.Add(parkingReasons);
         entity.SaveChanges();
         return(parkingReasons);
     }
 }
Esempio n. 2
0
 public tbl_Status POST([FromBody] tbl_Status status)
 {
     using (ClaimyWebServies_dbEntities2 entity = new ClaimyWebServies_dbEntities2())
     {
         entity.Configuration.ProxyCreationEnabled = false;
         entity.tbl_Status.Add(status);
         entity.SaveChanges();
         return(status);
     }
 }
Esempio n. 3
0
 public tbl_LoginType POST([FromBody] tbl_LoginType loginType)
 {
     using (ClaimyWebServies_dbEntities2 entity = new ClaimyWebServies_dbEntities2())
     {
         entity.Configuration.ProxyCreationEnabled = false;
         entity.tbl_LoginType.Add(loginType);
         entity.SaveChanges();
         return(loginType);
     }
 }
Esempio n. 4
0
 public tbl_ClaimHistory POST([FromBody] tbl_ClaimHistory claimHistory)
 {
     using (ClaimyWebServies_dbEntities2 entity = new ClaimyWebServies_dbEntities2())
     {
         entity.Configuration.ProxyCreationEnabled = false;
         entity.tbl_ClaimHistory.Add(claimHistory);
         entity.SaveChanges();
         return(claimHistory);
     }
 }
Esempio n. 5
0
        public HttpResponseMessage Put(string emailAddress, [FromBody] tbl_Users user)
        {
            try
            {
                using (ClaimyWebServies_dbEntities2 entity = new ClaimyWebServies_dbEntities2())
                {
                    var entites = entity.tbl_Users.FirstOrDefault(e => e.fld_Email == emailAddress);


                    if (entites == null)
                    {
                        return(Request.CreateResponse(HttpStatusCode.NotFound, "User with email = " + emailAddress + " not found "));
                    }
                    else
                    {
                        //We just Keep the fld_UserID + fld_TypeID
                        entites.fld_Title        = user.fld_Title;
                        entites.fld_Fullname     = user.fld_Fullname;
                        entites.fld_Email        = user.fld_Email;
                        entites.fld_AuthKey      = user.fld_AuthKey;
                        entites.fld_PasswordHash = user.fld_PasswordHash;
                        //entites.fld_SignupTime = user.fld_SignupTime;
                        //entites.fld_LastAction = user.fld_LastAction;
                        entites.fld_CustomerAddress = user.fld_CustomerAddress;
                        entites.fld_CustomerCountry = user.fld_CustomerCountry;
                        entites.Avtive = user.Avtive;

                        entity.SaveChanges();
                        return(Request.CreateResponse(HttpStatusCode.OK, entites));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }