public Int16 InsertMunicipalityTaxesDetails([FromBody] MunicipalityTaxes taxes)
        {
            Int16 Num = 0;

            try
            {
                List <MunicipalityTaxes> municipalityTaxes = new List <MunicipalityTaxes>();
                DataSet ds = new DataSet();
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Taxes"].ToString()))
                {
                    SqlCommand sqlComm = new SqlCommand("FetchTaxesDetails", conn);
                    sqlComm.Parameters.AddWithValue("@Action_Type", 'I');
                    sqlComm.Parameters.AddWithValue("@Munc_Name", taxes.MunicipalityName);
                    sqlComm.Parameters.AddWithValue("@Start_Date", taxes.StartDate);
                    sqlComm.Parameters.AddWithValue("@End_Date", taxes.EndDate);
                    sqlComm.Parameters.AddWithValue("@Tax_Amt", taxes.TaxAmount);
                    sqlComm.Parameters.AddWithValue("@Tax_Type", taxes.TaxType);

                    sqlComm.CommandType = CommandType.StoredProcedure;
                    conn.Open();
                    Num = (Int16)sqlComm.ExecuteNonQuery();
                }
                return(Num);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
 public MunicipalityTaxesRepository()
 {
     if (_MunicipalityTaxes == null)
     {
         _MunicipalityTaxes = new MunicipalityTaxes();
     }
 }
        public decimal GetMunicipalityTaxesDetails([FromBody] MunicipalityTaxes taxes)
        {
            decimal taxAmt = 0;

            try
            {
                List <MunicipalityTaxes> municipalityTaxes = new List <MunicipalityTaxes>();
                DataSet ds = new DataSet();
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Taxes"].ToString()))
                {
                    SqlCommand sqlComm = new SqlCommand("FetchTaxesDetails", conn);
                    sqlComm.Parameters.AddWithValue("@Action_Type", 'G');
                    sqlComm.Parameters.AddWithValue("@Munc_Name", taxes.MunicipalityName);
                    sqlComm.Parameters.AddWithValue("@date", taxes.checkDate);

                    sqlComm.CommandType = CommandType.StoredProcedure;
                    conn.Open();
                    taxAmt = (Decimal)sqlComm.ExecuteScalar();
                }
                return(taxAmt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }