Esempio n. 1
0
        } //Channel_Insert

        public void Channel_InsertUserId(UserChannelRequest c)
        {
            DataProvider.Instance.ExecuteNonQuery(
                GetConnection,
                "dbo.UserChannel_Insert",
                inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@UserId", c.UserId);
                paramCollection.AddWithValue("@ChannelId", c.ChannelId);

                SqlParameter param = new SqlParameter("@Id", SqlDbType.Int);
                param.Direction    = ParameterDirection.Output;
                paramCollection.Add(param);
            }
                );
        } //Channel_Insert
Esempio n. 2
0
        public HttpResponseMessage AddSubscribe(UserChannelRequest channel, int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            UserService userSrv = new UserService();

            channel.UserId = userSrv.GetCurrentUserId();
            if (id == 0)
            {
                id = 4;
            }
            channel.ChannelId = id;
            ChannelService svc = new ChannelService();

            svc.Channel_InsertUserId(channel);

            return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse()));
        }