Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Elearn elearn = db.Elearn.Find(id);

            db.Elearn.Remove(elearn);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ELID,LessonName,Description,Image,LessonBody,Time")] Elearn elearn)
 {
     if (ModelState.IsValid)
     {
         elearn.Date            = DateTime.Now;
         db.Entry(elearn).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("List"));
     }
     return(View(elearn));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "ELID,LessonName,Description,Image,LessonBody,Time")] Elearn elearn)
        {
            if (ModelState.IsValid)
            {
                elearn.Date = DateTime.Now;
                db.Elearn.Add(elearn);
                db.SaveChanges();
                return(RedirectToAction("List"));
            }

            return(View(elearn));
        }
Exemplo n.º 4
0
        // GET: /elearning/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Elearn elearn = db.Elearn.Find(id);

            if (elearn == null)
            {
                return(HttpNotFound());
            }
            return(View(elearn));
        }
Exemplo n.º 5
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            AddNewElearnReuest objElearnRequest = new AddNewElearnReuest();
            Elearn             objElearn        = new Elearn();

            objElearn.Tutorial_ID   = "12";
            objElearn.Tutorial_Name = TextBox1.Text;

            AdminBLL ws = new AdminBLL();

            ws.AddElearn(objElearn);

            HttpContext.Current.Items.Add("COMPLETE", "INSERT");
            Server.Transfer("..//SMSADMIN//AddNewUserComplete.aspx");
        }