public ActionResult DeleteConfirmed(int id) { GROUP_CONTENT gROUP_CONTENT = db.GROUP_CONTENT.Find(id); db.GROUP_CONTENT.Remove(gROUP_CONTENT); db.SaveChanges(); return(RedirectToAction("Index")); }
private void _postContentfromGroup(OOPEZZ_DBEntities db, BotMessageReceivedRequest mess) { char[] spa = { '_' }; String gcontent = mess.postback.payload.Split(spa)[1]; int gcontent_pk = int.Parse(gcontent); GROUP_CONTENT groupcontent = db.GROUP_CONTENT.Where(x => x.PK_SEQ == gcontent_pk).First(); List <CONTENT> lcontent = db.CONTENT.Where(x => x.GROUP_CONTENT_FK == groupcontent.PK_SEQ).OrderBy(x => x.STT).ToList(); _postContentList(db, lcontent, mess.sender.id); }
public ActionResult Edit([Bind(Include = "PK_SEQ,LESSION_FK,NAME,DESCRIPTION")] GROUP_CONTENT gROUP_CONTENT) { if (ModelState.IsValid) { db.Entry(gROUP_CONTENT).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gROUP_CONTENT)); }
private void _postLession(OOPEZZ_DBEntities db, BotMessageReceivedRequest mess) { char[] spa = { '_' }; String lesson = mess.postback.payload.Split(spa)[1]; int lessonpkseq = int.Parse(lesson); LESSION lession = db.LESSION.Where(x => x.PK_SEQ == lessonpkseq).FirstOrDefault(); GROUP_CONTENT gcontent = db.GROUP_CONTENT.Where(x => x.LESSION_FK == lession.PK_SEQ).OrderBy(x => x.PK_SEQ).First(); _postContentfromGroup(db, mess, gcontent); }
public ActionResult Create([Bind(Include = "PK_SEQ,LESSION_FK,NAME,DESCRIPTION")] GROUP_CONTENT gROUP_CONTENT) { if (ModelState.IsValid) { db.GROUP_CONTENT.Add(gROUP_CONTENT); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gROUP_CONTENT)); }
// GET: GROUP_CONTENT/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GROUP_CONTENT gROUP_CONTENT = db.GROUP_CONTENT.Find(id); if (gROUP_CONTENT == null) { return(HttpNotFound()); } return(View(gROUP_CONTENT)); }
private void _postContentfromGroup(OOPEZZ_DBEntities db, BotMessageReceivedRequest mess, GROUP_CONTENT gcontetn) { List <CONTENT> lcontent = db.CONTENT.Where(x => x.GROUP_CONTENT_FK == gcontetn.PK_SEQ).OrderBy(x => x.STT).ToList(); _postContentList(db, lcontent, mess.sender.id); }