Esempio n. 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);
        }
Esempio n. 2
0
        public void GetSessionData(List <IdValue> typeList, List <IdValue> categoryList, List <TaxSet> TaxList, List <IdValue> DisplayGroupList)
        {
            var typeListDataTable = productData.GetActiveProductTypes();

            foreach (DataRow dr in typeListDataTable.Rows)
            {
                IdValue idValues = new IdValue();
                idValues.Id    = dr.IsNull("Id") ? 0 : int.Parse(dr["Id"].ToString());
                idValues.Value = dr.IsNull("Type") ? "" : dr["Type"].ToString();
                typeList.Add(idValues);
            }

            var catrgoryListDataTable = productData.GetProductCategoryLookUp();

            categoryList.Add(new IdValue()
            {
                Id = null, Value = "Select"
            });
            foreach (DataRow dr in catrgoryListDataTable.Rows)
            {
                IdValue idValues = new IdValue();
                idValues.Id    = dr.IsNull("Id") ? 0 : int.Parse(dr["Id"].ToString());
                idValues.Value = dr.IsNull("Name") ? "" : dr["Name"].ToString();
                categoryList.Add(idValues);
            }
            var TaxListDataTable = productData.GetProductTaxLookUp();

            TaxList.Add(new TaxSet()
            {
                Id = null, Value = "Select"
            });
            foreach (DataRow dr in TaxListDataTable.Rows)
            {
                TaxSet idValues = new TaxSet();
                idValues.Id         = dr.IsNull("Id") ? 0 : int.Parse(dr["Id"].ToString());
                idValues.TaxId      = dr.IsNull("Id") ? 0 : int.Parse(dr["Id"].ToString());
                idValues.Value      = dr.IsNull("Name") ? "" : dr["Name"].ToString();
                idValues.TaxPercent = dr.IsNull("TaxPercent") ? 0 : decimal.Parse(dr["TaxPercent"].ToString());
                TaxList.Add(idValues);
            }

            var DisplayGroupDataTable = commonData.GetListItems((int)ListItemGroup.DisplayGroup);

            DisplayGroupList.Add(new IdValue()
            {
                Id = null, Value = "Select"
            });
            foreach (DataRow dr in DisplayGroupDataTable.Rows)
            {
                IdValue idValues = new IdValue();
                idValues.Id    = dr.IsNull("DisplayGroupId") ? 0 : int.Parse(dr["DisplayGroupId"].ToString());
                idValues.Value = dr.IsNull("DisplayGroup") ? "" : dr["DisplayGroup"].ToString();
                DisplayGroupList.Add(idValues);
            }
        }
Esempio n. 3
0
 public int InsertUpdateTax(TaxSet taxmaster)
 {
     try
     {
         return(productData.InsertUpdateTax(taxmaster));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 4
0
        public int InsertUpdateTax(TaxSet taxmaster)
        {
            int status = PTax.InsertUpdateTax(taxmaster);

            return(0);
        }