//inserts new competency user. public int NewCompetencyInsert(AdminCompetencyRequestModel model) { int uid = 0; string authorizedBy = HttpContext.Current.User.Identity.Name.ToString(); DataProvider.ExecuteNonQuery(GetConnection, "dbo.Competency_Users_Insert" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@UserId", model.UserId); paramCollection.AddWithValue("@CompetencyId", model.CompetencyId); paramCollection.AddWithValue("@AuthorizedBy", authorizedBy); paramCollection.AddWithValue("@Status", model.Status); paramCollection.AddWithValue("@Notes", model.Notes); paramCollection.AddWithValue("@ActivityType", model.ActivityType); SqlParameter p = new SqlParameter("@Id", System.Data.SqlDbType.Int); p.Direction = System.Data.ParameterDirection.Output; paramCollection.Add(p); }, returnParameters : delegate(SqlParameterCollection param) { int.TryParse(param["@Id"].Value.ToString(), out uid); }); return(uid); }
public HttpResponseMessage Update(AdminCompetencyRequestModel model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } SuccessResponse response = new SuccessResponse(); _CompetencyService.Update(model); return(Request.CreateResponse(response)); }
public HttpResponseMessage Insert(AdminCompetencyRequestModel model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } ItemResponse <int> response = new ItemResponse <int>(); response.Item = _CompetencyService.NewCompetencyInsert(model); return(Request.CreateResponse(response)); }
//update competency user public void Update(AdminCompetencyRequestModel model) { string authorizedBy = HttpContext.Current.User.Identity.Name.ToString(); DataProvider.ExecuteNonQuery(GetConnection, "dbo.Competency_Users_Update" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Id", model.competencyUserId); paramCollection.AddWithValue("@UserId", model.Id); paramCollection.AddWithValue("@CompetencyId", model.CompetencyId); paramCollection.AddWithValue("@AuthorizedBy", authorizedBy); paramCollection.AddWithValue("@Status", model.Status); paramCollection.AddWithValue("@Notes", model.Notes); paramCollection.AddWithValue("@ActivityType", model.ActivityType); paramCollection.AddWithValue("@Attachment", model.Attachment); }); }