Beispiel #1
0
        // GET: OrganizacjeTs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OrganizacjeT organizacjeT = db.OrganizacjeT.Find(id);

            if (organizacjeT == null)
            {
                return(HttpNotFound());
            }
            return(View(organizacjeT));
        }
Beispiel #2
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         OrganizacjeT organizacjeT = db.OrganizacjeT.Find(id);
         db.OrganizacjeT.Remove(organizacjeT);
         db.SaveChanges();
     }
     catch (RetryLimitExceededException /* dex */)
     {
         //Log the error (uncomment dex variable name and add a line here to write a log.
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator.");
     }
     return(RedirectToAction("Index"));
 }
Beispiel #3
0
        // GET: OrganizacjeTs/Delete/5
        public ActionResult Delete(int?id, bool?saveChangesErro = false)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            if (saveChangesErro.GetValueOrDefault())
            {
                ViewBag.ErrorMassage = "Delete Failed. Try again, and if the problem persist" + "see your system administrator";
            }
            OrganizacjeT organizacjeT = db.OrganizacjeT.Find(id);

            if (organizacjeT == null)
            {
                return(HttpNotFound());
            }
            return(View(organizacjeT));
        }
Beispiel #4
0
        public ActionResult Create([Bind(Include = "OrganizacjaID,Nazwa,KRS,NIP,Wojewodztwo,Powiat,Gmina,Miasto,KodPocztowy,Ulica,Telefon,TelefonKom,Email,AdresWWW,DataZalozenia,FormaPrawna,Aktywnosc")] OrganizacjeT organizacjeT)
        {
            try
            {
                if (db.OrganizacjeT.Any(x => x.KRS == organizacjeT.KRS))
                {
                    ModelState.AddModelError("KRS", "Wprowadzony numer już istnieje");
                }

                if (ModelState.IsValid)
                {
                    db.OrganizacjeT.Add(organizacjeT);
                    db.SaveChanges();
                    return(RedirectToAction("Details", "OrganizacjeTs", new { id = organizacjeT.OrganizacjaID }));;
                }
            }
            catch (DataException /* dex */)
            {
                //Log the error (uncomment dex variable name and add a line here to write a log.
                ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
            }

            return(View(organizacjeT));
        }