Пример #1
0
        public HttpResponseMessage Update(LMSDocResponseUpdateRequest req)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            req.UserId = User.Identity.GetId().Value;
            lmsService.Update(req);
            SuccessResponse response = new SuccessResponse();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
 public void Update(LMSDocResponseUpdateRequest req)
 {
     dataProvider.ExecuteNonQuery(
         "LmsDocumentResponses_update",
         delegate(SqlParameterCollection parameter)
     {
         parameter.AddWithValue("@id", req.Id);
         parameter.AddWithValue("@doc_id", req.DocId);
         parameter.AddWithValue("@user_id", req.UserId);
         parameter.AddWithValue("@time_spent", req.TimeSpentInSec);
         parameter.AddWithValue("@feedback", JsonConvert.SerializeObject(req.FeedBack));
         parameter.AddWithValue("@content", JsonConvert.SerializeObject(req.Content));
         parameter.AddWithValue("@date_submitted", req.DateSubmitted ?? (object)DBNull.Value);
     });
 }