Example #1
0
        public ActionResult PhieuGioiThieuSinhVienNgoaiTru()
        {
            if (Session["LoggedSV"] == null || Session["LoggedSV"].ToString() == "")
            {
                TempData["Login"] = "******";
                return(RedirectToAction("Index", "Home"));
            }
            try
            {
                sinhvien sv = (sinhvien)Session["LoggedSV"];
                ViewBag.sinhvien = sv.Tensv;
                DateTime date = DateTime.Now;
                phieugioithieusinhvienngoaitru gtsvnt = new phieugioithieusinhvienngoaitru();
                gtsvnt.Masv      = sv.Masv;
                gtsvnt.TrangThai = 0;
                gtsvnt.Ngaylap   = date;
                db.phieugioithieusinhvienngoaitrus.InsertOnSubmit(gtsvnt);
                db.SubmitChanges();
                TempData["message"] = "success";
            }
            catch (Exception ex)
            {
                TempData["message"] = "fail";
            }

            TempData["message2"] = "add";
            return(RedirectToAction("DanhSachPhieu"));
        }
Example #2
0
 public ActionResult DuyetPhieuGioiThieuSinhVienNgoaiTru(phieugioithieusinhvienngoaitru gtsvnt)
 {
     if (Session["LoggedAD"] == null || Session["LoggedAD"].ToString() == "")
     {
         return(RedirectToAction("Login", "Admin"));
     }
     try
     {
         phieugioithieusinhvienngoaitru gtsvntt = db.phieugioithieusinhvienngoaitrus.SingleOrDefault(n => n.Maxacnhan == gtsvnt.Maxacnhan);
         gtsvntt.Masv      = gtsvntt.Masv;
         gtsvntt.Ngaylap   = gtsvntt.Ngaylap;
         gtsvntt.Noidung   = gtsvnt.Noidung;
         gtsvntt.TrangThai = 1;
         db.SubmitChanges();
         TempData["message"] = "success";
     }
     catch (Exception e)
     {
         TempData["message"] = "fail";
     }
     TempData["message2"] = "revise";
     return(RedirectToAction("Sinhvien"));
 }