예제 #1
0
        public List <CurrencyCountry> GetCurrencyCountry(string fieldName, string fieldName2, string fieldValue, string connectionName)
        {
            Database  db        = DatabaseFactory.CreateDatabase(connectionName);
            DbCommand dbCommand = db.GetStoredProcCommand(Resources.CurrencyCountryResource.SP_GetCurrencyCountry);

            db.AddInParameter(dbCommand, Resources.CurrencyCountryResource.PARAM_QUERY, DbType.String, fieldName);
            db.AddInParameter(dbCommand, Resources.CurrencyCountryResource.PARAM_QUERY2, DbType.String, fieldName2);
            db.AddInParameter(dbCommand, Resources.CurrencyCountryResource.PARAM_VALUE, DbType.String, fieldValue);

            List <CurrencyCountry> listCurrencyCountry = new List <CurrencyCountry>();

            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                int _currencycode = dr.GetOrdinal(Resources.CurrencyCountryResource.PARAM_CURRENCYCODE);
                int _currencyname = dr.GetOrdinal(Resources.CurrencyCountryResource.PARAM_CURRENCYNAME);
                int _countryid    = dr.GetOrdinal(Resources.CurrencyCountryResource.PARAM_COUNTRYID);
                int _countryname  = dr.GetOrdinal(Resources.CurrencyCountryResource.PARAM_COUNTRYNAME);
                while (dr.Read())
                {
                    CurrencyCountry item = new CurrencyCountry();
                    item.CurrencyCode = dr.GetString(_currencycode);
                    item.CurrencyName = dr.GetString(_currencyname);
                    item.CountryID    = dr.GetString(_countryid);
                    item.CountryName  = dr.GetString(_countryname);
                    listCurrencyCountry.Add(item);
                }
            }

            return(listCurrencyCountry);
        }
        private void dgvCodeCurrency_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e)
        {
            CurrencyCountry currencyCountry = (CurrencyCountry)dgvCodeCurrency.SelectedRows[0].DataBoundItem;
            UpdateEventArgs updateeventargs = new UpdateEventArgs(currencyCountry.CountryID);

            CurrencyCountryUpdate(this, updateeventargs);
            this.Close();
        }
예제 #3
0
        protected void lbAddCountry_Click(object sender, EventArgs e)
        {
            var item = new CurrencyCountry
            {
                CountryId  = Convert.ToInt32(ddlCountry.SelectedValue),
                CurrencyId = QueryId
            };

            UtilityService.InsertCurrencyCountry(item);
            LoadCurrencyCountries();
        }
예제 #4
0
 public int InsertCurrencyCountry(CurrencyCountry currencyCountry)
 {
     return(_currencyCountryRepository.Create(currencyCountry));
 }
예제 #5
0
 public int InsertCurrencyCountry(CurrencyCountry item)
 {
     return(_currencyService.InsertCurrencyCountry(item));
 }