Ejemplo n.º 1
0
 public void UpdateKey(CMSTemplateKeyUpdateRequest model)
 {
     DataProvider.ExecuteNonQuery(GetConnection, "dbo.CMSTemplateKeys_UpdateByID"
        , inputParamMapper: delegate(SqlParameterCollection paramCollection)
        {
            paramCollection.AddWithValue("@Id", model.Id);
            paramCollection.AddWithValue("@Type", model.Type);
            paramCollection.AddWithValue("@KeyName", model.KeyName);
            paramCollection.AddWithValue("@TemplateId", model.TemplateId);
        });
 }
        public HttpResponseMessage UpdateTemplate(CMSTemplateKeyUpdateRequest model)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            SuccessResponse response = new SuccessResponse();

            _cmsService.UpdateKey(model);

            return Request.CreateResponse(response);
        }