Beispiel #1
0
        public void AddCounty(string Code, string Name, string country)
        {
            DictionaryCounty current = new DictionaryCounty();

            current.DictionaryCountyName = Name;
            current.DictionaryCountyCode = Code;
            current.DictionaryCountryId  = Int32.Parse(country);
            this._dbContext.DictionaryCounty.Add(current);
            this._dbContext.SaveChanges();
        }
Beispiel #2
0
        public DictionaryCountyModel GetCounty(int id)
        {
            DictionaryCounty      county       = _dbContext.DictionaryCounty.Where(a => a.DictionaryCountyId == id).FirstOrDefault();
            DictionaryCountyModel countrModels = new DictionaryCountyModel();

            countrModels.DictionaryCountyId   = county.DictionaryCountyId;
            countrModels.DictionaryCountyName = county.DictionaryCountyName;
            countrModels.Code = county.DictionaryCountyCode;
            return(countrModels);
        }
        public void InsertCounty(CountyModel county)
        {
            var County = new DictionaryCounty()
            {
                DictionaryCountyId = county.CountyId,
                CountyName         = county.CountyName,
                CountryId          = county.CountryId
            };

            _untoldContext.DictionaryCounty.Add(County);
            _untoldContext.SaveChanges();
        }