Beispiel #1
0
        public MasterTax GetAllTaxes()
        {
            DataTable           Taxset           = productData.GetTaxSet();
            DataTable           TaxStructure     = productData.GetTaxStructure();
            MasterTax           taxlist          = new MasterTax();
            List <TaxSet>       taxsetlist       = new List <TaxSet>();
            List <TaxStructure> taxstructurelist = new List <TaxStructure>();

            foreach (DataRow dr in Taxset.Rows)
            {
                TaxSet tmodel = new TaxSet();
                tmodel.TaxId      = dr.IsNull("TaxId") ? 0 : int.Parse(dr["TaxId"].ToString());
                tmodel.TaxName    = dr.IsNull("TaxName") ? "" : (dr["TaxName"].ToString());
                tmodel.TaxPercent = dr.IsNull("TaxPercent") ? 0 : decimal.Parse(dr["TaxPercent"].ToString());
                tmodel.ActiveFlag = dr.IsNull("ActiveFlag") ? false : bool.Parse(dr["ActiveFlag"].ToString());
                taxlist.Taxset.Add(tmodel);
            }

            foreach (DataRow dr in TaxStructure.Rows)
            {
                TaxStructure tsmodel = new TaxStructure();
                tsmodel.TaxId                  = dr.IsNull("TaxId") ? 0 : int.Parse(dr["TaxId"].ToString());
                tsmodel.TaxStructureId         = dr.IsNull("TaxStructureId") ? 0 : int.Parse(dr["TaxStructureId"].ToString());
                tsmodel.TaxStructureName       = dr.IsNull("TaxStructureName") ? "" : (dr["TaxStructureName"].ToString());
                tsmodel.TaxStructurePercentage = dr.IsNull("TaxStructurePercentage") ? 0 : decimal.Parse(dr["TaxStructurePercentage"].ToString());
                taxlist.Taxstructure.Add(tsmodel);
            }
            return(taxlist);
        }
Beispiel #2
0
 public int InsertUpdateTax(TaxStructure taxstructure)
 {
     try
     {
         return(productData.InsertUpdateTax(taxstructure));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Beispiel #3
0
        public int InsertUpdateTaxStructure(TaxStructure taxstructure)
        {
            int status = PTax.InsertUpdateTax(taxstructure);

            return(status);
        }