Esempio n. 1
0
        public ActionResult GiangVienKhoa(FormCollection form)
        {
            //setDDlistNganh();
            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 nganh = form["dropdownlist"];
            var diachi = form["diachi"];
            var model  = (GiangVien)Session["ThongTinGV"];
            var gv     = db.Table_GiangViens.First(m => m.ID_GV == model.ID_GV);

            gv.HOGV  = ho;
            gv.TENGV = ten;
            bool gt = false;

            if (gioitinh == "Nam")
            {
                gt = true;
            }
            gv.GIOITINH = gt;
            gv.NGAYSINH = DateTime.Parse(ngaysinh);
            gv.SDT      = sdt;
            gv.EMAIL    = email;
            gv.DIACHI   = diachi;
            gv.HOCVI    = form["hocvi"];
            //gv.ID_CHUYENNGANH = int.Parse(nganh);
            db.SubmitChanges();
            var model2 = GiangVienDAO.getDataGV_KHOA();

            return(View(model2));
        }
Esempio n. 2
0
        public ActionResult addGiangVien(FormCollection form)
        {
            Table_GiangVien tb_gv = new Table_GiangVien();

            tb_gv.ID_GV = int.Parse(form["Add_ID"].ToString());
            tb_gv.HOGV  = form["Add_Ho"];
            tb_gv.TENGV = 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_GiangViens.InsertOnSubmit(tb_gv);
            db.SubmitChanges();
            var model2 = GiangVienDAO.getDataGV_KHOA();

            return(RedirectToAction("GiangVienKhoa", model2));
        }
Esempio n. 3
0
        public ActionResult GiangVienKhoa()
        {
            var model = GiangVienDAO.getDataGV_KHOA();

            //setDDlistNganh();
            return(View(model));
        }