public async Task <StatusData <long> > InsertAwardAndHonor(AddAwardAndHonorRequest request, SystemSession session) { var serviceRequest = new AwardAndHonor { UserId = session.UserId, Username = session.UserName, Title = request.Title, Issuer = request.Issuer, Date = request.Date.ToString(), Description = request.Description, AwardAndHonorId = 0, Mode = (byte)SystemDbStatus.Inserted, UserIdOrName = session.UserName }; var response = await Task.Factory.StartNew(() => Client.UserService.upsertAwardAndHonor(serviceRequest, session.GetSession())).ConfigureAwait(false); var result = new StatusData <long> { Status = (SystemDbStatus)response.DbStatus.DbStatusCode, Message = response.DbStatus.DbStatusMsg, SubStatus = response.DbStatus.DbSubStatusCode }; if (result.Status.IsOperationSuccessful()) { result.Data = response.AwardAndHonorId; } return(result); }
public async Task <StatusData <string> > DeleteAwardAndHonor(SingleData <long> request, SystemSession session) { var serviceRequest = new AwardAndHonor { UserId = session.UserId, Username = session.UserName, AwardAndHonorId = request.Data, Mode = (byte)SystemDbStatus.Deleted }; var response = await Task.Factory.StartNew(() => Client.UserService.upsertAwardAndHonor(serviceRequest, session.GetSession())).ConfigureAwait(false); var result = new StatusData <string> { Status = (SystemDbStatus)response.DbStatus.DbStatusCode, Message = response.DbStatus.DbStatusMsg, SubStatus = response.DbStatus.DbSubStatusCode }; return(result); }