public RR.TravelEndorsementOperationResponse EndorsementOperation(RR.TravelEndorsementOperation req)
 {
     try
     {
         BLO.TravelEndorsementOperation details = _mapper.Map <RR.TravelEndorsementOperation, BLO.TravelEndorsementOperation>(req);
         var result = _travelEndorsementRepository.EndorsementOperation(details);
         return(_mapper.Map <BLO.TravelEndorsementOperationResponse, RR.TravelEndorsementOperationResponse>(result));
     }
     catch (Exception ex)
     {
         return(new RR.TravelEndorsementOperationResponse()
         {
             IsTransactionDone = false,
             TransactionErrorMessage = ex.Message
         });
     }
 }
Esempio n. 2
0
        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.TravelEndorsementOperation
                {
                    TravelEndorsementID = Convert.ToInt32((row.FindControl("lblTravelEndorsementID") as Label).Text.Trim()),
                    TravelID            = Convert.ToInt32((row.FindControl("lblTravelID") 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.TravelEndorsementOperationResponse>,
                                                   BKIC.SellingPoint.DTO.RequestResponseWrappers.TravelEndorsementOperation>
                                     (BKIC.SellingPoint.DTO.Constants.TravelEndorsementURI.EndorsementOperation, details);

                if (endoResult.StatusCode == 200 && endoResult.Result.IsTransactionDone)
                {
                    ListEndorsements(service, userInfo);
                    if (type == "delete")
                    {
                        master.ShowErrorPopup("Your endorsement deleted successfully", "Travel Endorsement");
                    }
                    else if (type == "authorize")
                    {
                        master.ShowErrorPopup("Your endorsement authorized successfully", "Travel Endorsement");
                    }
                }
            }
        }