Exemple #1
0
        public ActionResult Create(string zipcode)
        {
            var zip = DbUtil.Db.Zips.SingleOrDefault(mz => mz.ZipCode == zipcode);
            if (zip != null)
                return Content(Util.EndShowMessage("Zipcode already exists", "/MetroZips", "Go back"));

            var m = new Zip { ZipCode = zipcode };
            DbUtil.Db.Zips.InsertOnSubmit(m);
            DbUtil.Db.SubmitChanges();
            return Redirect("/MetroZips/");
        }
 public ActionResult Create(string zipcode)
 {
     var zip = DbUtil.Db.Zips.SingleOrDefault(mz => mz.ZipCode == zipcode);
     if (zip == null)
     {
         var m = new Zip { ZipCode = zipcode };
         DbUtil.Db.Zips.InsertOnSubmit(m);
         DbUtil.Db.SubmitChanges();
     }
     return Redirect($"/MetroZips/#{zipcode}");
 }
Exemple #3
0
 private void detach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = null;
 }
Exemple #4
0
 private void attach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = this;
 }
Exemple #5
0
 private void detach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = null;
 }
Exemple #6
0
 private void attach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = this;
 }