public IActionResult RejectRequest(PostedTravelVoucherViewModel vmObj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var obj = _mapper.Map <postedtravelvouchercard>(vmObj);
                    PostedTravelVoucherCard.Update updateObj = new PostedTravelVoucherCard.Update
                    {
                        postedtravelvouchercard = obj
                    };

                    var result = Postedtravelvouchercard_PortClientService()
                                 .UpdateAsync(updateObj)
                                 .GetAwaiter()
                                 .GetResult()
                                 .postedtravelvouchercard;

                    if (result != null)
                    {
                        var postResult = Hrmgt_PortClientService()
                                         .RejecttravelvoucherwebAsync(result.Travel_Order_Form_No)
                                         .GetAwaiter()
                                         .GetResult()
                                         .return_value;

                        if (postResult == 200)
                        {
                            TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                                title = "Reject Travel Settlement", text = "Travel settlement rejected successfully.", type = "success"
                            });
                            return(RedirectToAction(nameof(Index)));
                        }
                        else
                        {
                            TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                                title = "Reject Travel Settlement", text = "Reject details saved but posting rejection failed.", type = "error"
                            });
                        }
                    }
                    else
                    {
                        TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                            title = "Reject Travel Settlement", text = "Posting reject details failed.", type = "error"
                        });
                    }
                }
                else
                {
                    TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                        title = "Reject Travel Settlement", text = "Validation Error. Try Again.", type = "error"
                    });
                }
            }
            catch (Exception ex)
            {
                TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                    title = "Exception Error", text = ex.Message, type = "error"
                });
            }
            return(RedirectToAction(nameof(RejectRequest), new { travelOrderNo = vmObj.Travel_Order_Form_No }));
        }
        public IActionResult VerifyRequest(PostedTravelVoucherViewModel vmObj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var obj = _mapper.Map <postedtravelvouchercard>(vmObj);
                    obj.Approved_Travel_ExpensesSpecified  = true;
                    obj.Approved_Driver_AllowanceSpecified = true;
                    obj.Approved_Fuel_ExpensesSpecified    = true;
                    obj.Approved_Guest_ExpensesSpecified   = true;

                    PostedTravelVoucherCard.Update updateObj = new PostedTravelVoucherCard.Update
                    {
                        postedtravelvouchercard = obj
                    };

                    var result = Postedtravelvouchercard_PortClientService()
                                 .UpdateAsync(updateObj)
                                 .GetAwaiter()
                                 .GetResult()
                                 .postedtravelvouchercard;

                    if (result != null)
                    {
                        var postResult = Hrmgt_PortClientService()
                                         .VerifytravelvoucherwebAsync(result.Travel_Order_Form_No)
                                         .GetAwaiter()
                                         .GetResult()
                                         .return_value;

                        if (postResult == 200)
                        {
                            TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                                title = "Verify Travel Settlement", text = "Travel Settlement verified successfully.", type = "success"
                            });
                            return(RedirectToAction(nameof(Index)));
                        }
                        else
                        {
                            TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                                title = "Verify Travel Settlement", text = "Updating travel settlement succeeded but posting verification failed.", type = "error"
                            });
                        }
                    }
                    else
                    {
                        TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                            title = "Verify Travel Settlement", text = "Updating travel settlement fields failed.", type = "error"
                        });
                    }
                }
                else
                {
                    TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                        title = "Verify Travel Settlement", text = "Validation Error. Try Again.", type = "error"
                    });
                }
            }
            catch (Exception ex)
            {
                TempData["Notify"] = JsonConvert.SerializeObject(new Notify {
                    title = "Exception Error", text = ex.Message, type = "error"
                });
            }
            return(RedirectToAction(nameof(VerifyRequest), new { travelOrderNo = vmObj.Travel_Order_Form_No }));
        }