// POST: Admin/TSql_Chat/Delete/5
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            TSql_Chat tSql_Chat = await db.TSql_Chat.FindAsync(id);

            db.TSql_Chat.Remove(tSql_Chat);
            await db.SaveChangesAsync();

            Session["countChat"] = Int32.Parse(Session["countChat"].ToString()) - 1;
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Feedback(TSql_Chat fb)
 {
     if (ModelState.IsValid)
     {
         TSql_Informations info = (TSql_Informations)Session["flag"];
         fb.IDUser   = info.IDInfo;
         fb.DateChat = DateTime.Now;
         db.TSql_Chat.Add(fb);
         db.SaveChanges();
     }
     return(Redirect(Request.UrlReferrer.ToString()));
 }
        public async Task <ActionResult> Edit([Bind(Include = "IDChat,Chat,DateChat,IDUser")] TSql_Chat tSql_Chat)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tSql_Chat).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.IDUser = new SelectList(db.TSql_Informations, "IDInfo", "DisplayName", tSql_Chat.IDUser);
            return(View(tSql_Chat));
        }
        // GET: Admin/TSql_Chat/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TSql_Chat tSql_Chat = await db.TSql_Chat.FindAsync(id);

            if (tSql_Chat == null)
            {
                return(HttpNotFound());
            }
            return(View(tSql_Chat));
        }
        // GET: Admin/TSql_Chat/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TSql_Chat tSql_Chat = await db.TSql_Chat.FindAsync(id);

            if (tSql_Chat == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IDUser = new SelectList(db.TSql_Informations, "IDInfo", "DisplayName", tSql_Chat.IDUser);
            return(View(tSql_Chat));
        }