Exemple #1
0
        public ActionResult Create(countrycode countrycode)
        {
            countrycodes.Insert(countrycode);
            countrycodes.Commit();

            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult Edit(countrycode countrycode)
        {
            countrycodes.Update(countrycode);
            countrycodes.Commit();

            return(RedirectToAction("Index"));
        }
        // GET: /Edit/5
        public ActionResult EditCountry(string id)
        {
            countrycode countrycode = countrycodes.GetById(id);

            if (countrycode == null)
            {
                return(HttpNotFound());
            }
            return(View(countrycode));
        }
Exemple #4
0
        // GET: /Delete/5
        public ActionResult Delete(int id)
        {
            countrycode countrycode = countrycodes.GetById(id);

            if (countrycode == null)
            {
                return(HttpNotFound());
            }
            return(View(countrycode));
        }
        public ActionResult EditCountry(countrycode countrycode)
        {
            var _country = countrycodes.GetById(countrycode.code);

            _country.code       = countrycode.code;
            _country.name       = countrycode.name;
            _country.lastUpdate = DateTime.Now;
            countrycodes.Update(_country);
            countrycodes.Commit();

            return(RedirectToAction("Index"));
        }
        public ActionResult CreateCountry(countrycode countrycode)
        {
            //validation check
            var code1 = countrycodes.GetAll().Where(s => s.code.ToUpper().Contains(countrycode.code.ToUpper())).ToList();
            var name1 = countrycodes.GetAll().Where(s => s.name.ToUpper().Contains(countrycode.name.ToUpper())).ToList();

            var _country = new countrycode();

            _country.code       = countrycode.code;
            _country.name       = countrycode.name;
            _country.createDate = DateTime.Now;
            _country.lastUpdate = DateTime.Now;

            //code and name validation

            if (_country.code == null)
            {
                return(RedirectToAction("ErrorMessage"));
            }
            else if (_country.code.Trim().Length > 3)
            {
                return(RedirectToAction("ErrorMessage"));
            }
            else if (code1.Count() > 0)
            {
                return(RedirectToAction("ErrorMessage"));
            }
            else if (_country.name == null)
            {
                return(RedirectToAction("ErrorMessage"));
            }
            else if (_country.name.Trim().Length > 50)
            {
                return(RedirectToAction("ErrorMessage"));
            }
            else if (name1.Count() > 0)
            {
                return(RedirectToAction("ErrorMessage"));
            }

            countrycodes.Insert(_country);
            countrycodes.Commit();

            return(RedirectToAction("Index"));
        }
Exemple #7
0
        // GET: /Create
        public ActionResult Create()
        {
            var countrycode = new countrycode();

            return(View(countrycode));
        }
 public CommandRouter(dbi298845_prangersEntities database, countrycode countrycode)
 {
     _allCommand  = new Dictionary <string, Command>();
     _database    = database;
     _countrycode = countrycode;
 }
 public Importer(dbi298845_prangersEntities database, countrycode countrycode)
 {
     this.database    = database;
     this.countrycode = countrycode;
 }
Exemple #10
0
 protected abstract Importer <T> CreateImporter(dbi298845_prangersEntities database, countrycode countrycode);
Exemple #11
0
 public PostalCodeImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
 public IngredientImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
 protected override Importer <store> CreateImporter(dbi298845_prangersEntities database, countrycode countrycode)
 {
     return(new StoreImporter(database, countrycode));
 }
 public ProductIngredientImport(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
     this.productImporter = new ProductImporter(database, countrycode);
 }
Exemple #15
0
 public override void Initialize(dbi298845_prangersEntities database, countrycode countrycode)
 {
     _database = database;
 }
Exemple #16
0
 protected override Importer <postalcode> CreateImporter(dbi298845_prangersEntities database, countrycode countrycode)
 {
     return(new PostalCodeImporter(database, countrycode));
 }
Exemple #17
0
 public abstract void Initialize(dbi298845_prangersEntities database, countrycode countrycode);
Exemple #18
0
 protected override Importer <product> CreateImporter(dbi298845_prangersEntities database, countrycode countrycode)
 {
     return(new ProductImporter(database, countrycode));
 }
 protected override Importer <bottom> CreateImporter(dbi298845_prangersEntities database, countrycode countrycode)
 {
     return(new BottomImporter(database, countrycode));
 }
Exemple #20
0
 public BottomImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
Exemple #21
0
 protected override Importer <ingredient> CreateImporter(dbi298845_prangersEntities database, countrycode countrycode)
 {
     return(new IngredientImporter(database, countrycode));
 }
Exemple #22
0
 public override void Initialize(dbi298845_prangersEntities database, countrycode countrycode)
 {
     _importer = CreateImporter(database, countrycode);
 }