public IActionResult SaveTdsSectionNo(TdsSectionDTO tdsSectionNo)
        {
            bool isSaved = false;

            try
            {
                isSaved = obReferralAdvocate.SaveTdsSectionNo(tdsSectionNo, Con);
            }
            catch (Exception ex)
            {
                throw new FieldAccessException(ex.ToString());
            }
            return(Ok(isSaved));
        }
        //public bool saveRelationShip(RelationShipDTO objRelation, string connectionString)
        //{
        //    try
        //    {
        //        return NPGSqlHelper.ExecuteNonQuery(connectionString, CommandType.Text, "") > 0 ? true : false;
        //    }
        //    catch (Exception)
        //    {
        //        throw;
        //    }
        //}



        #region GetTdsSectionNo

        public List <TdsSectionDTO> getTdsSectionNo(string ConnectionString)
        {
            lstTdsSectionDetails = new List <TdsSectionDTO>();
            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select recordid,tdssection,coalesce( tdspercentage,0) tdspercentage from tblmsttdssections where statusid=" + Convert.ToInt32(Status.Active) + "  order by tdssection;"))
                {
                    while (dr.Read())
                    {
                        TdsSectionDTO objTdsSectionDetails = new TdsSectionDTO();
                        objTdsSectionDetails.pRecordid      = Convert.ToInt64(dr["recordid"]);
                        objTdsSectionDetails.pTdsSection    = Convert.ToString(dr["tdssection"]);
                        objTdsSectionDetails.pTdsPercentage = Convert.ToDecimal(dr["tdspercentage"]);
                        lstTdsSectionDetails.Add(objTdsSectionDetails);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstTdsSectionDetails);
        }
        public async Task <List <TdsSectionDTO> > getTdsSectionsbyPartyid(long ppartyid, string ConnectionString)
        {
            await Task.Run(() =>
            {
                lstTdsSectionDetails = new List <TdsSectionDTO>();
                string query         = "";
                try
                {
                    if (Convert.ToBoolean(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstparty t1 join  tblmstpartytaxdetails  t2 on t1.partiid =t2.partiid where istdsapplicable =true and  contactid =" + ppartyid + "; ")))
                    {
                        query = "select distinct istdsapplicable,tdssectionname tdssection,coalesce( tdspercentage,0) tdspercentage from tblmstparty t1 join tblmstpartytaxdetails  t2 on t1.partiid=t2.partiid join tblmsttdssections t3 on t2.tdssectionname=t3.tdssection where t1.contactid =" + ppartyid;
                    }
                    else
                    {
                        query = "select distinct tdssection,false as istdsapplicable ,coalesce( tdspercentage,0) tdspercentage from tblmsttdssections where statusid=" + Convert.ToInt32(Status.Active) + "  order by tdssection;";
                    }
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, query))
                    {
                        while (dr.Read())
                        {
                            TdsSectionDTO objTdsSectionDetails = new TdsSectionDTO();

                            objTdsSectionDetails.pTdsSection     = Convert.ToString(dr["tdssection"]);
                            objTdsSectionDetails.pTdsPercentage  = Convert.ToDecimal(dr["tdspercentage"]);
                            objTdsSectionDetails.istdsapplicable = Convert.ToBoolean(dr["istdsapplicable"]);
                            lstTdsSectionDetails.Add(objTdsSectionDetails);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstTdsSectionDetails);
        }