示例#1
0
        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"));
        }
示例#2
0
        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);
        }
示例#3
0
 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));
 }
示例#4
0
        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);
        }
示例#5
0
        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));
        }
示例#6
0
        // 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));
        }
示例#7
0
        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);
        }