public void EndorsementOperation(object sender, string type) { using (GridViewRow row = (GridViewRow)((LinkButton)sender).Parent.Parent) { master.IsSessionAvailable(); var userInfo = CommonMethods.GetUserDetails(); var service = CommonMethods.GetLogedInService(); var details = new BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsementOperation(); details.HomeEndorsementID = Convert.ToInt32((row.FindControl("lblHomeEndorsementID") as Label).Text.Trim()); details.HomeID = Convert.ToInt32((row.FindControl("lblHomeID") as Label).Text.Trim()); details.Agency = userInfo.Agency; details.AgentCode = userInfo.AgentCode; details.Type = type; details.UpdatedBy = Convert.ToInt32(userInfo.ID); var endoResult = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsementOperationResponse>, BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsementOperation> (BKIC.SellingPoint.DTO.Constants.HomeEndorsementURI.EndorsementOperation, details); if (endoResult.StatusCode == 200 && endoResult.Result.IsTransactionDone) { ListEndorsements(service, userInfo); if (type == "delete") { master.ShowErrorPopup("Your endorsement deleted successfully", "Home Endorsement"); } else if (type == "authorize") { master.ShowErrorPopup("Your endorsement authorized successfully", "Home Endorsement"); } } } }
public RR.HomeEndorsementOperationResponse EndorsementOperation(RR.HomeEndorsementOperation req) { try { BLO.HomeEndorsementOperation details = _mapper.Map <RR.HomeEndorsementOperation, BLO.HomeEndorsementOperation>(req); var result = _homeEndorsementRepository.EndorsementOperation(details); return(_mapper.Map <BLO.HomeEndorsementOperationResponse, RR.HomeEndorsementOperationResponse>(result)); } catch (Exception ex) { return(new RR.HomeEndorsementOperationResponse() { IsTransactionDone = false, TransactionErrorMessage = ex.Message }); } }