Esempio n. 1
0
        public ActionResult KundenBearbeiten(int?id)  //(endl)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblKunde idk = db.tblKunde.Find(id);

            if (idk == null)
            {
                return(HttpNotFound());
            }

            KundeEditModel kem = new KundeEditModel();

            kem.idkunde  = idk.IDKunde;
            kem.Vorname  = idk.Vorname;
            kem.Nachname = idk.Nachname;
            kem.Straße   = idk.Strasse;
            kem.Plz      = idk.tblPLZOrt.PLZ;
            kem.Ort      = idk.tblPLZOrt.Ort;
            kem.Email    = idk.tblLogin.Email;
            kem.Telefon  = idk.Telefon;
            kem.PassNr   = idk.ReisepassNr;
            kem.GebDat   = idk.GebDatum;

            return(View(kem));
        }
Esempio n. 2
0
 public ActionResult Edit()
 {
     if (System.Web.HttpContext.Current.Session["IDUser"] != null)
     {
         tblKunde k = db.tblKunde.Find((int)System.Web.HttpContext.Current.Session["IDUser"]);
         if (k == null)
         {
             return(HttpNotFound());
         }
         return(View(k));
     }
     else
     {
         return(RedirectToAction("Index", "Home", null));
     }
 }
Esempio n. 3
0
        public ActionResult Edit([Bind(Include = "IDKunde,Vorname,Nachname,Strasse,Telefon,Anrede,ReisepassNr,GebDatum")] tblKunde k, string plz, string ort, string password, string newPassword)
        {
            if (ModelState.IsValid)
            {
                if (password != "" && newPassword != "")
                {
                    password    = Logic.Helpers.HashPassword(password);
                    newPassword = Logic.Helpers.HashPassword(newPassword);
                }

                var result      = db.pEditCustumer(k.IDKunde, k.Vorname, k.Nachname, k.Strasse, k.Telefon, k.Anrede, k.GebDatum, k.ReisepassNr, plz, ort, password, newPassword);
                int resultValue = result.SingleOrDefault().Value;


                TempData["editResult"] = resultValue;
                return(RedirectToAction("Edit"));
            }
            return(View(k));
        }