Exemplo n.º 1
0
        // POST api/userevents
        public ReturnValue Post([FromBody]UserEventCreate value)
        {
            if (value == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ReturnValue returnValue = new ReturnValue();

            try
            {
                var serializer = new JavaScriptSerializer();
                var serializedResult = serializer.Serialize(value.PhoneHash);

                returnValue.value = entity.UserEventCreate(value.UserSN, value.Catogory, value.CatogoryName, serializedResult);
                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 2
0
        // GET api/installusers?UserSN=1&UserSN_Object=2
        public ReturnValue Get(int id, int usersn_object)
        {
            IMFREEEntities entity = new IMFREEEntities();

            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            try
            {
                InstallUserGetList_Result value = new InstallUserGetList_Result();
                int result = entity.InstallUserGetInfo(id, usersn_object);

                if (result == 0)
                {
                    value.UserSN = id;
                    value.UserSN_Object = usersn_object;
                }

                returnValue.value = value;
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 3
0
        // GET api/userevents/5
        public ReturnValue Get(int id)
        {
            if (id < 0)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ReturnValue returnValue = new ReturnValue();

            try
            {
                ObjectParameter TotalCount = new ObjectParameter("TotalCount", typeof(int));
                returnValue.value = entity.UserEventGetList(id, TotalCount).ToList<UserEventGetList_Result>();

                returnValue.totalcount = (int)TotalCount.Value;
                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 4
0
        // GET api/installusers
        public ReturnValue Get()
        {
            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            return returnValue;
        }
Exemplo n.º 5
0
        // DELETE api/installusers/5
        public ReturnValue Delete(int id)
        {
            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            return returnValue;
        }
Exemplo n.º 6
0
        // GET api/users
        public ReturnValue Get()
        {
            ObjectParameter totalCount = new ObjectParameter("TotalCount", typeof(int));

            ReturnValue returnValue = new ReturnValue();

            try
            {
                returnValue.value = entity.UserGetList(totalCount).ToList<UserGetList_Result>();
                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 7
0
        // GET api/installusers/5
        public ReturnValue Get(int id)
        {
            IMFREEEntities entity = new IMFREEEntities();

            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            try
            {
                ObjectParameter TotalCount = new ObjectParameter("TotalCount", typeof(int));
                returnValue.totalcount = (int)TotalCount.Value;
                returnValue.value = entity.InstallUserGetList(id, TotalCount).ToList<InstallUserGetList_Result>();
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 8
0
        // DELETE api/users/5
        public ReturnValue Delete(int id)
        {
            if (id < 0)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ReturnValue returnValue = new ReturnValue();

            try
            {
                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 9
0
        // GET api/users/5
        public ReturnValue Get(int id)
        {
            if (id < 0)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ObjectParameter phoneHash = new  ObjectParameter("PhoneHash", typeof(string));
            ObjectParameter createDate = new ObjectParameter("CreateDate", typeof(DateTime)); ;
            ObjectParameter updateDate = new ObjectParameter("UpdateDate", typeof(DateTime)); ;
            ObjectParameter pushKey = new ObjectParameter("PushKey", typeof(string)); ;
            ObjectParameter deviceID = new ObjectParameter("DeviceID", typeof(string)); ;

            ReturnValue returnValue = new ReturnValue();

            try
            {
                entity.UserGetInfo(id, phoneHash, createDate, updateDate, pushKey, deviceID);

                returnValue.code = 0;
                returnValue.msg = "succes";

                Users users = new Users();
                users.UserSN = id;
                users.PhoneHash = (string)phoneHash.Value;
                users.CreateDate = (DateTime)createDate.Value;
                users.UpdateDate = (DateTime)updateDate.Value;
                users.PushKey = (string)pushKey.Value;
                users.DeviceID = (string)deviceID.Value;

                returnValue.value = users;
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 10
0
        // GET api/contacts/5
        /// <summary>
        /// usersn에 해당 하는 정보를 조회한다.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ReturnValue Get(int id)
        {
            if (id < 0)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ReturnValue returnValue = new ReturnValue();

            try
            {
                returnValue.value = entity.ContactGetInfo(id).ToList<ContactGetInfo_Result>();
                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 11
0
        // POST api/installusers
        public ReturnValue Post([FromBody]InstallUsers value)
        {
            if (value == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            IMFREEEntities entity = new IMFREEEntities();
            try
            {
                entity.InstallUserCreate(value.UserSN, value.UserSN_Object);
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            return returnValue;
        }
Exemplo n.º 12
0
        // PUT api/installusers/5
        public ReturnValue Put(int id, [FromBody]InstallUsers value)
        {
            if (id < 0 || value == null)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            IMFREEEntities entity = new IMFREEEntities();
            try
            {
                if (id == value.UserSN)
                {
                    entity.InstallUserUpdate(value.UserSN, value.UserSN_Object);
                }
                else
                {
                    throw new HttpResponseException(HttpStatusCode.BadRequest);
                }
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            return returnValue;
        }
Exemplo n.º 13
0
        // PUT api/users/5
        public ReturnValue Put(int id, [FromBody]Users value)
        {
            if (id < 0 || value == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            if (id != value.UserSN)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            ReturnValue returnValue = new ReturnValue();
            try
            {
                entity.UserUpdate(id, value.PhoneHash, value.PushKey, value.DeviceID);

                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 14
0
        // POST api/users
        public ReturnValue Post([FromBody]Users value)
        {
            if (value == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ReturnValue returnValue = new ReturnValue();
            try
            {
                entity.UserCreate(value.PhoneHash, value.PushKey, value.DeviceID);

                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }
Exemplo n.º 15
0
        // PUT api/userevents/5
        public ReturnValue Put(int id, [FromBody]string value)
        {
            ReturnValue returnValue = new ReturnValue();
            returnValue.code = 0;
            returnValue.msg = "succes";

            return returnValue;
        }
Exemplo n.º 16
0
        // POST api/contacts
        public ReturnValue Post([FromBody]Contacts value)
        {
            if (value == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            ReturnValue returnValue = new ReturnValue();

            try
            {
                returnValue.value = entity.ContactCreate(value.UsersSN, value.PhoneHash, value.PhoneName);
                returnValue.code = 0;
                returnValue.msg = "succes";
            }
            catch
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }

            return returnValue;
        }