public RR.MotorEndorsementOperationResponse EndorsementOperation(RR.MotorEndorsementOperation req) { try { BLO.MotorEndorsementOperation details = _mapper.Map <RR.MotorEndorsementOperation, BLO.MotorEndorsementOperation>(req); var result = _motorEndorsementRepository.EndorsementOperation(details); return(_mapper.Map <BLO.MotorEndorsementOperationResponse, RR.MotorEndorsementOperationResponse>(result)); } catch (Exception ex) { return(new RR.MotorEndorsementOperationResponse() { IsTransactionDone = false, TransactionErrorMessage = ex.Message }); } }
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.MotorEndorsementOperation { MotorEndorsementID = Convert.ToInt32((row.FindControl("lblMotorEndorsementID") as Label).Text.Trim()), MotorID = Convert.ToInt32((row.FindControl("lblMotorID") as Label).Text.Trim()), Agency = userInfo.Agency, AgentCode = userInfo.AgentCode, Type = type, UpdatedBy = Convert.ToInt32(userInfo.ID) }; var endoResult = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsementOperationResponse>, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsementOperation> (BKIC.SellingPoint.DTO.Constants.MotorEndorsementURI.EndorsementOperation, details); if (endoResult.StatusCode == 200 && endoResult.Result.IsTransactionDone) { ListEndorsements(service, userInfo); btnOK.Text = "OK"; btnYes.Visible = false; if (type == "delete") { modalBodyText.InnerText = "Your endorsement deleted successfully"; } else if (type == "authorize") { modalBodyText.InnerText = "Your endorsement authorized successfully"; } ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "ShowMessage();", true); } } }