protected void UpdateRecord(object sender, Obout.Grid.GridRecordEventArgs e)
        {
            UCApplyTaxService.iUCApplyTaxClient ApplyTaxServie = new UCApplyTaxService.iUCApplyTaxClient();
            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                object        key     = "Save";
                if (e.Record[key].ToString() == "N")
                {
                    string ProductID = Request.QueryString["PrdID"].ToString();
                    if (ProductID == "undefined")
                    {
                        ProductID = "0";
                    }
                    long PrdID = Convert.ToInt64(ProductID);
                    List <SP_CartBeforeUpdateProductLevelTaxDetail_Result> lst = new List <SP_CartBeforeUpdateProductLevelTaxDetail_Result>();
                    // lst = ApplyTaxServie.GetCalculatedTaxListBeforeUpdate(Request.QueryString["Object"].ToString(), Session.SessionID, Convert.ToInt64(Request.QueryString["CartSeq"].ToString()), Convert.ToDecimal(lblTaxableAmount.Text), hdnTaxSelectedRec.Value.ToString(), profile.DBConnection._constr).ToList();
                    lst = ApplyTaxServie.GetCalculatedTaxListBeforeUpdate(Request.QueryString["Object"].ToString(), Session.SessionID, PrdID, Convert.ToDecimal(lblTaxableAmount.Text), hdnTaxSelectedRec.Value.ToString(), profile.DBConnection._constr).ToList();
                    ApplyTaxServie.Close();
                    GridTaxList.DataSource = lst;
                    GridTaxList.DataBind();
                }
                else if (e.Record[key].ToString() == "Save")
                {
                    string TotalTaxAmount = UpdateTaxAmount();
                    ApplyTaxServie.Close();

                    string obj = Request.QueryString["Object"].ToString();
                    if (obj == "PurchaseOrderTax")
                    {
                        BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient();
                        //iInboundClient Inbound = new iInboundClient();
                        BrilliantWMS.WMSInbound.WMS_SP_GetPartDetail_ForPO_Result PartRequest = new WMSInbound.WMS_SP_GetPartDetail_ForPO_Result();
                        //WMS_SP_GetPartDetail_ForPO_Result PartRequest = new WMS_SP_GetPartDetail_ForPO_Result();
                        PartRequest.Sequence       = Convert.ToInt64(Request.QueryString["CartSeq"].ToString());
                        PartRequest.TotalTaxAmount = Convert.ToDecimal(TotalTaxAmount);
                        decimal TtlAftrtax = Convert.ToDecimal(TotalTaxAmount) + Convert.ToDecimal(Request.QueryString["TaxableAmt"].ToString());
                        PartRequest.AmountAfterTax = TtlAftrtax;
                        //string obj = Request.QueryString["Object"].ToString();
                        // if (obj == "PurchaseOrderTax")
                        obj = "PurchaseOrder";
                        // else obj = "SalesOrderTax";
                        Inbound.UpdatePartRequest_TempData13(Session.SessionID, obj, profile.Personal.UserID.ToString(), PartRequest, profile.DBConnection._constr);
                        Inbound.Close();
                    }
                    else if (obj == "SalesOrderTax")
                    {
                        BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient();
                        BrilliantWMS.WMSOutbound.WMS_SP_GetPartDetail_ForSO_Result PartRSO = new WMSOutbound.WMS_SP_GetPartDetail_ForSO_Result();
                        PartRSO.Sequence       = Convert.ToInt64(Request.QueryString["CartSeq"].ToString());
                        PartRSO.TotalTaxAmount = Convert.ToDecimal(TotalTaxAmount);
                        decimal TtlAftrtax = Convert.ToDecimal(TotalTaxAmount) + Convert.ToDecimal(Request.QueryString["TaxableAmt"].ToString());
                        PartRSO.AmountAfterTax = TtlAftrtax;
                        obj = "SalesOrder";
                        Outbound.UpdatePartRequest_TempData13SO(Session.SessionID, obj, profile.Personal.UserID.ToString(), PartRSO, profile.DBConnection._constr);
                        Outbound.Close();
                    }
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "UCApplyTax", "UpdateRecord");
            }
            finally
            {   }
        }