public ActionResult Create(Profesori profesori)
 {
     profesori.CreatedOn = DateTime.Now;
     if (ProfesoratDAL.Insert(profesori))
     {
         return(Redirect("Index"));
     }
     return(Redirect("Index"));
 }
Esempio n. 2
0
 public ActionResult Delete(int id, Rezervimet rezervimet)
 {
     try
     {
         // TODO: Add delete logic here
         ProfesoratDAL.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Delete(int id, Profesori profesori)
 {
     try
     {
         //if (ModelState.IsValid)
         //{
         ProfesoratDAL.Delete(id);
         return(RedirectToAction("Index", profesori));
         // }
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
        public ActionResult Edit(int id, Profesori collection)
        {
            try
            {
                // TODO: Add update logic here

                if (ModelState.IsValid)
                {
                    ProfesoratDAL.Update(collection, id);
                    return(RedirectToAction("Index"));
                }
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View("Index"));
            }
        }
 // GET: Profesori/Delete/5
 public ActionResult Delete(int id)
 {
     return(View(ProfesoratDAL.Read(id)));
 }
        // GET: Profesori/Details/5
        public ActionResult Details(int id)
        {
            Profesori profesori = ProfesoratDAL.Read(id);

            return(View("Details", profesori));
        }