Esempio n. 1
0
        } //WorkHistorySelectById

        public void WorkHistoryUpdate(WorkHistoryUpdateRequest payload)
        {
            DataProvider.ExecuteNonQuery(GetConnection, "dbo.WorkHistory_Update"
                                         , inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@ID", payload.ID);
                paramCollection.AddWithValue("@PersonID", payload.PersonID);
                paramCollection.AddWithValue("@CompanyID", payload.CompanyID);
                paramCollection.AddWithValue("@Company", payload.Company);
                paramCollection.AddWithValue("@Title", payload.Title);
                paramCollection.AddWithValue("@Contract", payload.Contract);
                paramCollection.AddWithValue("@DateStarted", payload.DateStarted.ToShortDateString());
                if (payload.DateEnded.HasValue)
                {
                    paramCollection.AddWithValue("@DateEnded", payload.DateEnded.Value.Date);
                }
                else
                {
                    // send dbnull
                    paramCollection.AddWithValue("@DateEnded", System.DBNull.Value);
                };
                paramCollection.AddWithValue("@Description", payload.Description);
            }, returnParameters: null
                                         );
        }     //WorkHistoryUpdate
Esempio n. 2
0
        public HttpResponseMessage UpdateWorkHistory([FromUri] int id, [FromBody] WorkHistoryUpdateRequest payload)
        {
            try
            {
                SuccessResponse response = new SuccessResponse();

                _workHistoryService.WorkHistoryUpdate(payload);

                return(Request.CreateResponse(response));
            }
            catch (Exception ex)
            {
                ErrorLogService    svc   = new ErrorLogService();
                ErrorLogAddRequest error = new ErrorLogAddRequest();
                error.ErrorFunction = "Aic.Web.Controllers.Api.UpdateWorkHistory";
                error.ErrorMessage  = ex.Message;
                error.UserId        = UserService.UserSelect().PersonId;
                svc.ErrorLogInsert(error);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        } //UpdateWorkHistory