Пример #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/");
        }
Пример #2
0
 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}");
 }
Пример #3
0
 private void detach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = null;
 }
Пример #4
0
 private void attach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = this;
 }
Пример #5
0
 private void detach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = null;
 }
Пример #6
0
 private void attach_Zips(Zip entity)
 {
     this.SendPropertyChanging();
     entity.ResidentCode = this;
 }