Exemplo n.º 1
0
        /// <summary>
        /// Inserts the jurisdiction record.
        /// </summary>
        /// <param name="jurisdiction">A jurisdiction dto.</param>
        /// <returns></returns>
        public static int InsertJurisdiction(JurisdictionDto jurisdiction)
        {
            DataCommand cmd = TaxImporterDataHelper.CreateDataCommand();

            cmd.CommandText = TaxImporterDataHelper.CreateInsertStoredProcedureName("Jurisdiction");
            cmd.Parameters  = new DataParameters();
            DataParameter jurisdictionId = new DataParameter("JurisdictionId", jurisdiction.JurisdictionId);

            jurisdictionId.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(jurisdictionId);
            cmd.Parameters.Add(new DataParameter("DisplayName", jurisdiction.DisplayName));
            cmd.Parameters.Add(new DataParameter("StateProvinceCode", jurisdiction.StateProvinceCode));
            cmd.Parameters.Add(new DataParameter("CountryCode", jurisdiction.CountryCode));
            cmd.Parameters.Add(new DataParameter("JurisdictionType", jurisdiction.JurisdictionType));
            cmd.Parameters.Add(new DataParameter("ZipPostalCodeStart", jurisdiction.ZipPostalCodeStart));
            cmd.Parameters.Add(new DataParameter("ZipPostalCodeEnd", jurisdiction.ZipPostalCodeEnd));
            cmd.Parameters.Add(new DataParameter("City", jurisdiction.City));
            cmd.Parameters.Add(new DataParameter("District", jurisdiction.District));
            cmd.Parameters.Add(new DataParameter("County", jurisdiction.County));
            cmd.Parameters.Add(new DataParameter("GeoCode", jurisdiction.GeoCode));
            cmd.Parameters.Add(new DataParameter("ApplicationId", jurisdiction.ApplicationId));
            cmd.Parameters.Add(new DataParameter("Code", jurisdiction.Code));

            DataResult result = DataService.ExecuteNonExec(cmd);

            // return JurisdictionId
            return(int.Parse(jurisdictionId.Value.ToString()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Inserts the jurisdiction relation record.
        /// </summary>
        /// <param name="jurisdictionRelation">A jurisdiction relation dto.</param>
        public static void InsertJurisdictionRelation(JurisdictionRelationDto jurisdictionRelation)
        {
            DataCommand cmd = TaxImporterDataHelper.CreateDataCommand();

            cmd.CommandText = TaxImporterDataHelper.CreateInsertStoredProcedureName("JurisdictionRelation");
            cmd.Parameters  = new DataParameters();
            cmd.Parameters.Add(new DataParameter("JurisdictionId", jurisdictionRelation.JurisdictionId));
            cmd.Parameters.Add(new DataParameter("JurisdictionGroupId", jurisdictionRelation.JurisdictionGroupId));
            DataService.ExecuteNonExec(cmd);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Inserts the tax language record.
        /// </summary>
        /// <param name="taxLanguage">A tax language dto.</param>
        /// <returns></returns>
        public static int InsertTaxLanguage(TaxLanguageDto taxLanguage)
        {
            DataCommand cmd = TaxImporterDataHelper.CreateDataCommand();

            cmd.CommandText = TaxImporterDataHelper.CreateInsertStoredProcedureName("TaxLanguage");
            cmd.Parameters  = new DataParameters();
            DataParameter taxLanguageId = new DataParameter("TaxLanguageId", taxLanguage.TaxLanguageId);

            taxLanguageId.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(taxLanguageId);
            cmd.Parameters.Add(new DataParameter("DisplayName", taxLanguage.DisplayName));
            cmd.Parameters.Add(new DataParameter("LanguageCode", taxLanguage.LanguageCode));
            cmd.Parameters.Add(new DataParameter("TaxId", taxLanguage.TaxId));

            DataResult result = DataService.ExecuteNonExec(cmd);

            // return TaxLanguageId
            return(int.Parse(taxLanguageId.Value.ToString()));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Inserts the jurisdiction group record.
        /// </summary>
        /// <param name="jurisdictionGroup">A jurisdiction group dto.</param>
        /// <returns></returns>
        public static int InsertJurisdictionGroup(JurisdictionGroupDto jurisdictionGroup)
        {
            DataCommand cmd = TaxImporterDataHelper.CreateDataCommand();

            cmd.CommandText = TaxImporterDataHelper.CreateInsertStoredProcedureName("JurisdictionGroup");
            cmd.Parameters  = new DataParameters();
            DataParameter jurisdictionGroupId = new DataParameter("JurisdictionGroupId", jurisdictionGroup.JurisdictionGroupId);

            jurisdictionGroupId.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(jurisdictionGroupId);
            cmd.Parameters.Add(new DataParameter("ApplicationId", jurisdictionGroup.ApplicationId));
            cmd.Parameters.Add(new DataParameter("DisplayName", jurisdictionGroup.DisplayName));
            cmd.Parameters.Add(new DataParameter("JurisdictionType", jurisdictionGroup.JurisdictionType));
            cmd.Parameters.Add(new DataParameter("Code", jurisdictionGroup.Code));

            DataResult result = DataService.ExecuteNonExec(cmd);

            // return JurisdictionGroupId
            return(int.Parse(jurisdictionGroupId.Value.ToString()));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Inserts the tax record.
        /// </summary>
        /// <param name="tax">A tax dto.</param>
        /// <returns></returns>
        public static int InsertTax(TaxDto tax)
        {
            DataCommand cmd = TaxImporterDataHelper.CreateDataCommand();

            cmd.CommandText = TaxImporterDataHelper.CreateInsertStoredProcedureName("Tax");
            cmd.Parameters  = new DataParameters();
            DataParameter taxId = new DataParameter("TaxId", tax.TaxId);

            taxId.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(taxId);
            cmd.Parameters.Add(new DataParameter("TaxType", tax.TaxType));
            cmd.Parameters.Add(new DataParameter("Name", tax.Name));
            cmd.Parameters.Add(new DataParameter("SortOrder", tax.SortOrder));
            cmd.Parameters.Add(new DataParameter("ApplicationId", tax.ApplicationId));

            DataResult result = DataService.ExecuteNonExec(cmd);

            // return TaxId
            return(int.Parse(taxId.Value.ToString()));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Inserts the tax value record.
        /// </summary>
        /// <param name="taxValue">A tax value dto.</param>
        /// <returns></returns>
        public static int InsertTaxValue(TaxValueDto taxValue)
        {
            DataCommand cmd = TaxImporterDataHelper.CreateDataCommand();

            cmd.CommandText = TaxImporterDataHelper.CreateInsertStoredProcedureName("TaxValue");
            cmd.Parameters  = new DataParameters();
            DataParameter taxValueId = new DataParameter("TaxValueId", taxValue.TaxValueId);

            taxValueId.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(taxValueId);
            cmd.Parameters.Add(new DataParameter("Percentage", taxValue.Percentage));
            cmd.Parameters.Add(new DataParameter("TaxId", taxValue.TaxId));
            cmd.Parameters.Add(new DataParameter("TaxCategory", taxValue.TaxCategory));
            cmd.Parameters.Add(new DataParameter("JurisdictionGroupId", taxValue.JurisdictionGroupId));
            cmd.Parameters.Add(new DataParameter("SiteId", taxValue.SiteId));
            cmd.Parameters.Add(new DataParameter("AffectiveDate", taxValue.AffectiveDate));

            DataResult result = DataService.ExecuteNonExec(cmd);

            // return TaxValueId
            return(int.Parse(taxValueId.Value.ToString()));
        }