Exemple #1
0
        public ActionResult GiangVienDoanhNghiep(GiangVien giangvien)
        {
            //var ho = form["Ho"];
            //var ten = form["Ten"];
            //var gioitinh = form["gioitinh"];
            //var ngaysinh = form["ngaysinh"];
            //var sdt = form["sdt"];
            //var email = form["email"];

            //var diachi = form["diachi"];
            var model = (GiangVien)Session["ThongTinGVDoanhNghiep"];
            var gv    = db.Table_GiangVienDNs.First(m => m.ID_GVDN == model.ID_GV);

            gv.HOGVDN  = giangvien.HOGV;
            gv.TENGVDN = giangvien.TENGV;

            gv.GIOITINH = giangvien.GIOITINH;
            gv.NGAYSINH = giangvien.NGAYSINH;
            gv.SDT      = giangvien.SDT;
            gv.EMAIL    = giangvien.EMAIL;
            gv.DIACHI   = giangvien.DIACHI;
            gv.HOCVI    = giangvien.HOCVI;

            db.SubmitChanges();
            var model2 = GiangVienDAO.getDataGV_DOANHNGHIEP();

            ViewData["getGVDN"] = model2;
            return(View(giangvien));
        }
Exemple #2
0
        public ActionResult addGiangVienDoanhNghiep(FormCollection form)
        {
            Table_GiangVienDN tb_gv = new Table_GiangVienDN();

            tb_gv.ID_GVDN = int.Parse(form["Add_ID"].ToString());
            tb_gv.HOGVDN  = form["Add_Ho"];
            tb_gv.TENGVDN = form["Add_Ten"];
            var  gioitinh = form["Add_gioitinh"];
            bool gt       = false;

            if (gioitinh == "Nam")
            {
                gt = true;
            }
            tb_gv.GIOITINH = gt;
            tb_gv.NGAYSINH = DateTime.Parse(form["Add_ngaysinh"]);
            tb_gv.SDT      = form["Add_sdt"];
            tb_gv.EMAIL    = form["Add_email"];
            tb_gv.DIACHI   = form["Add_diachi"];
            tb_gv.HOCVI    = form["Add_hocvi"];
            db.Table_GiangVienDNs.InsertOnSubmit(tb_gv);
            db.SubmitChanges();
            var model2 = GiangVienDAO.getDataGV_DOANHNGHIEP();

            return(RedirectToAction("GiangVienDoanhNghiep", model2));
        }
Exemple #3
0
        //[HttpPost]
        //public JsonResult ChangeGiangVienTheoNganh(int ID_NGANH)
        //{
        //    var result = GiangVienDAO.getDataGV_KHOA_byNganh(ID_NGANH);
        //    return Json(new
        //    {
        //        status = result
        //    }, JsonRequestBehavior.AllowGet);
        //}
        #endregion



        #region
        public ActionResult GiangVienDoanhNghiep()
        {
            var model = GiangVienDAO.getDataGV_DOANHNGHIEP();

            ViewData["getGVDN"] = model;
            return(View());
        }