protected void Page_Load(object sender, EventArgs e)
    {
        LopHoc lh = new LopHoc();

        if (Request.QueryString["action"] == "nhapdiem")
        {
            string action = Request.QueryString["nhapdiem"];
            string malop  = Request.QueryString["malop"];
            Session["malop"] = malop;

            lh.MaLop = Session["malop"].ToString();
        }

        if (Request.QueryString["action"] == "nhapdiem1")
        {
            string action = Request.QueryString["nhapdiem1"];
            string mahs   = Request.QueryString["mahs"];
            Session["mahs"] = mahs;
            lophoc          = Session["malop"].ToString();
            lbMaHS.Text     = mahs;
        }
        Session["malop"] = lophoc;
        lh.MaLop         = Session["malop"].ToString();
        GiaoVien gv   = new GiaoVien();
        int      magv = int.Parse(Session["MaGV"].ToString());

        gv.MaGV = magv;

        DSHocSinh.DataBind();
    }
 public AddClassViewModel()
 {
     this.class_   = new LopHoc();
     this.grades   = DataProvider.Instance.DB.Khois.ToList();
     this.teachers = DataProvider.Instance.DB.GiaoViens.ToList();
     InitCommand();
 }
예제 #3
0
        public bool Update(LopHoc entity)
        {
            try
            {
                var lh = db.LopHocs.Find(entity.ID);
                lh.tenLopHoc = entity.tenLopHoc;
                if (!string.IsNullOrEmpty(entity.hinh))
                {
                    lh.hinh = entity.hinh;
                }
                lh.mota = entity.mota;

                lh.soluong = entity.soluong;
                if (!string.IsNullOrEmpty(entity.soBuoi.ToString()))
                {
                    lh.soBuoi = entity.soBuoi;
                }
                lh.trangThai = entity.trangThai;
                lh.yeucau    = entity.yeucau;

                db.SaveChanges();
                return(true);
            }catch (Exception ex)
            {
                return(false);
            }
        }
예제 #4
0
        public List <LopHoc> DanhSach(string maKhoa)
        {
            List <LopHoc> dsLop = new List <LopHoc>();

            getConnection();
            string     sqlSELECT = "SELECT * FROM Lop WHERE MaKhoa=@makhoa";
            SqlCommand cmd       = new SqlCommand(sqlSELECT, conn);

            cmd.Parameters.AddWithValue("makhoa", maKhoa);
            SqlDataReader data = cmd.ExecuteReader();

            while (data.Read())
            {
                LopHoc lop = new LopHoc(data["MaLop"].ToString(),
                                        data["TenLop"].ToString(),
                                        int.Parse(data["SiSo"].ToString()),
                                        data["MaKhoa"].ToString());
                dsLop.Add(lop);
            }

            data.Close();

            closeConnection();

            return(dsLop);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        LopHoc lh = new LopHoc();
        if (Request.QueryString["action"] == "nhapdiem")
        {
            string action = Request.QueryString["nhapdiem"];
            string malop = Request.QueryString["malop"];
            Session["malop"] = malop;
            
            lh.MaLop = Session["malop"].ToString();
            
        }

        if (Request.QueryString["action"] == "nhapdiem1")
        {
            string action = Request.QueryString["nhapdiem1"];
            string mahs = Request.QueryString["mahs"];
            Session["mahs"] = mahs;
            lophoc = Session["malop"].ToString();
            lbMaHS.Text = mahs;
        }
        Session["malop"] = lophoc;
        lh.MaLop = Session["malop"].ToString();
        GiaoVien gv = new GiaoVien();
        int magv = int.Parse(Session["MaGV"].ToString());
        gv.MaGV = magv;
      
        DSHocSinh.DataBind();
       
    }
        private void btnLuuThongTin_Click(object sender, EventArgs e)
        {
            try
            {
                ValidateLuu();

                if (isInsert)
                {
                    LopHoc.Insert(LoadLopHoc());

                    MessageBox.Show("Thêm lớp thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    LopHoc.Update(LoadLopHoc());

                    MessageBox.Show("Sửa lớp thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                this.Close();
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #7
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            try
            {
                ValidateSearch();

                thLop = new Thread(() =>
                {
                    object source = LopHoc.Select(txtMaLop.Text);

                    gridLop.Invoke((MethodInvoker) delegate
                    {
                        gridLop.DataSource = source;
                    });
                });

                thLop.Start();
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #8
0
        public List <LopHoc> LayDanhSachLopHoc()
        {
            List <LopHoc> dsLopHoc = new List <LopHoc>();

            OpenConnection();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from lopHoc";
            cmd.Connection  = conn;

            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                LopHoc lh = new LopHoc();
                lh.MaLop  = reader.GetString(0);
                lh.TenLop = reader.GetString(1);
                lh.SiSo   = reader.GetInt32(2);
                lh.MaKhoi = reader.GetString(3);
                dsLopHoc.Add(lh);
            }
            reader.Close();
            return(dsLopHoc);
        }
예제 #9
0
 private void Button2_Click(object sender, EventArgs e)
 {
     dslh = LopHoc.GetListLopHoc(cb_khoihoc.SelectedItem.ToString(), cb_namhoc.SelectedItem.ToString());
     if (!txtmalop.Text.Equals("") && !txttenlop.Text.Equals("") && !txtphonghoc.Text.Equals(""))
     {
         LopHoc a = new LopHoc();
         foreach (LopHoc i in dslh)
         {
             if (!i.MaLH.Equals(txtmalop.Text))
             {
                 a = new LopHoc
                 {
                     MaLH     = txtmalop.Text,
                     TenLH    = txttenlop.Text,
                     PhongHoc = txtphonghoc.Text,
                     KhoiHoc  = cb_khoihoc.SelectedItem.ToString(),
                     NamHoc   = cb_namhoc.SelectedItem.ToString()
                 };
             }
             else
             {
                 MessageBox.Show("Mã lớp đã tồn tại!");
                 break;
             }
         }
         LopHoc.ThemLH(a);
         MessageBox.Show("Đã thêm lớp: " + txttenlop.Text);
         DialogResult = DialogResult.OK;
     }
     else
     {
         MessageBox.Show("Các trường không được để trống");
     }
 }
        public IHttpActionResult PutLopHoc(int id, LopHoc lopHoc)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != lopHoc.MaLop)
            {
                return(BadRequest());
            }

            db.Entry(lopHoc).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LopHocExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PostLopHoc(LopHoc lopHoc)
        {
            db.LopHocs.Add(lopHoc);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = lopHoc.MaLop }, lopHoc));
        }
예제 #12
0
        private void InitGradeClass()
        {
            Grades = DataProvider.Instance.DB.Khois.ToList <Khoi>();

            if (HocSinh.LopHocs != null && HocSinh.LopHocs.Count > 0)
            {
                foreach (Khoi khoi in Grades)
                {
                    if (khoi.Id == HocSinh.LopHocs.Last().Khoi.Id)
                    {
                        gradeSelected = khoi;
                        OnPropertyChanged("gradeSelected");
                    }
                }
            }

            if (gradeSelected != null)
            {
                classes = DataProvider.Instance.DB.LopHocs.ToList();
                classes = classes.Where <LopHoc>((p) => p.IdKhoi == gradeSelected.Id).ToList();
                foreach (LopHoc lopHoc in classes)
                {
                    if (lopHoc.Id == HocSinh.LopHocs.Last().Id)
                    {
                        classSelected = lopHoc;
                        OnPropertyChanged("classSelected");
                    }
                }
            }
        }
예제 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LopHoc lh = new LopHoc();
            if (Request.QueryString["action"] == "nhapdiem")
            {
                string action = Request.QueryString["nhapdiem"];
                string malop = Request.QueryString["malop"];
                Session["malop"] = malop;

                lh.MaLop = Session["malop"].ToString();

            }
            lh.MaLop = Session["malop"].ToString();
            GiaoVien gv = new GiaoVien();
            int magv = int.Parse(Session["magv"].ToString());
            monhoc = gvDAL.GetMaMonHoc(magv, lh.MaLop);   
            gv.MaGV = magv;           
            DSHocSinh.DataSource = gvDAL.GetDanhSachHSLopNhapDiem(Session["malop"].ToString(), magv,monhoc);
            DSHocSinh.DataBind();
            kiemtratb();
        }
        lbTenLop.Text = gvDAL.LayTenLop(Session["malop"].ToString());
        lbMonHoc.Text=gvDAL.LayTenMonHoc(monhoc);

    }
예제 #14
0
        public async Task <ActionResult <LopHoc> > PostLopHoc(LopHoc lopHoc)
        {
            _context.LopHocs.Add(lopHoc);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLopHoc", new { id = lopHoc.id }, lopHoc));
        }
예제 #15
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            if (dgvHienThiKH.SelectedRows.Count == 1)
            {
                btnThemLHP.Text    = "Sửa";
                pnThongTin.Visible = true;
                pnChucNang.Visible = false;
                string malh = dgvHienThiKH.SelectedRows[0].Cells["MaLH"].Value.ToString();
                string mamh = dgvHienThiKH.SelectedRows[0].Cells["MaMH"].Value.ToString();
                // set dữ liệu lên form
                LopHoc lh = BLL_LopHocPhan.Instance.GetLHbyMaLH(malh);
                txtTenLop.Text    = lh.TenLop;
                txtTenLop.Enabled = false;

                MonHoc mh = BLL_LopHocPhan.Instance.GetMHbyMaMH(mamh);
                cboMonHoc.Text       = mh.TenMon;
                cboGiaoVien.Text     = mh.GiaoVien.HoTen;
                txtThoiGianHoc.Text  = mh.ThoiGianHoc;
                dtpNgayBatDau.Value  = mh.NgayBatDau.Value;
                dtpNgayKetThuc.Value = mh.NgayKetThuc.Value;
            }
            else
            {
                MessageBox.Show("Chọn 1 row để sửa", "Sửa Lớp Học Phần", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #16
0
        private void btnXacNhan_Click(object sender, EventArgs e)
        {
            string ten      = txtTenMoi.Text;
            string gioitinh = cbGioiTinhMoi.Text;
            string ngaysinh = dtpNgaySinhMoi.Text;
            LopHoc lh       = cbTenLop.SelectedValue as LopHoc;

            if (ckbNgaySinh.Checked == false)
            {
                ngaysinh = "";
            }
            else
            {
                ngaysinh = String.Format("{0:yyyy/MM/dd}", ngaysinh);
            }
            if (kiemTra(ten, gioitinh, ngaysinh))
            {
                int ketQua = 0;
                ketQua = HocSinhControl.suaThongTin(id, ten, ngaysinh, gioitinh, lh.MaLH);
                if (ketQua > 0)
                {
                    MessageBox.Show("thay đổi thành công");
                    this.Close();
                }
            }
        }
예제 #17
0
        public static MonHoc exportMonHoc(HtmlDocument doc)
        {
            MonHoc   monHoc   = new MonHoc();
            HtmlNode nodeInfo = doc.DocumentNode.SelectSingleNode("/div/div/h4");

            String[] infoStr = nodeInfo.InnerText.Split('-');
            monHoc.maSoMonHoc = infoStr[0].Trim(listTrim).Trim();
            monHoc.tenMonHoc  = infoStr[1].Trim(listTrim).Trim();

            List <LopHoc> listLopHoc = new List <LopHoc>();

            HtmlNodeCollection list = doc.DocumentNode.SelectNodes("/div/div/div/div/table/*");

            for (int i = 2; i < list.Count; i += 3)
            {
                HtmlNode nodeLopHoc = list[i];
                LopHoc   lop        = getLopHocInfo(nodeLopHoc);

                HtmlNode  nodeBuoiHoc = list[i + 1];
                BuoiHoc[] listBH      = getDSBuoiHoc(nodeBuoiHoc);
                lop.buoiHoc = listBH;
                listLopHoc.Add(lop);
            }
            monHoc.lopHoc = listLopHoc.ToArray();
            return(monHoc);
        }
예제 #18
0
        public ActionResult Edit(int id)
        {
            string        connectString = ConfigurationManager.ConnectionStrings["QLSV"].ConnectionString;
            SqlConnection conn          = new SqlConnection(connectString);
            string        query         = "select * from class where cID=@cID";

            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlCommand   cmd   = new SqlCommand(query, conn);
            SqlParameter param = new SqlParameter("@cID", id);

            cmd.Parameters.Add(param);
            cmd.CommandType = System.Data.CommandType.Text;
            SqlDataReader dr = cmd.ExecuteReader();
            LopHoc        lh = new LopHoc();

            while (dr.Read())
            {
                lh.CID   = Convert.ToInt32(dr["CID"].ToString());
                lh.cName = dr["cName"].ToString();
            }
            conn.Close();
            return(View(lh));
        }
예제 #19
0
        public ActionResult DanhSachLopHoc()
        {
            string        username = Session["Username"] == null ? "" : Session["Username"].ToString();
            List <LopHoc> l_LopHoc = new LopHoc().GetList("", 0, "", 0, username);

            return(View(l_LopHoc));
        }
예제 #20
0
        public JsonResult lophoc_search(string TenLopHoc, byte MonHocID, string NhanHocVien, byte Khoi)
        {
            string        username = Session["Username"] == null ? "" : Session["Username"].ToString();
            List <LopHoc> l_LopHoc = new LopHoc().GetList(TenLopHoc, MonHocID, NhanHocVien, Khoi, username);

            return(Json(l_LopHoc, JsonRequestBehavior.AllowGet));
        }
예제 #21
0
        public ActionResult GetAllStudent()
        {
            string        connectString = ConfigurationManager.ConnectionStrings["QLSV"].ConnectionString;
            SqlConnection conn          = new SqlConnection(connectString);
            string        query         = "select*from student";

            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlCommand cmd = new SqlCommand(query, conn);

            cmd.CommandType = System.Data.CommandType.Text;
            SqlDataReader dr    = cmd.ExecuteReader();
            List <LopHoc> lstLh = new List <LopHoc>();

            while (dr.Read())
            {
                LopHoc lh = new LopHoc();
                lh.CID   = Convert.ToInt32(dr["CID"].ToString());
                lh.cName = dr["cName"].ToString();
                lstLh.Add(lh);
            }
            conn.Close();
            return(View());
        }
예제 #22
0
 public int lophoc_capnhat(short ID, string TenLopHoc, string NgayNhan, string HanChot, string NgayNhapHoc, byte MonHocID, string LichHoc, string MoTa, decimal HocPhi, byte LoaiHocPhiID, bool NhanHocVien, byte Khoi)
 {
     if (ID == 0)
     {
         LopHoc lh = new LopHoc();
         lh.TenLopHoc    = TenLopHoc;
         lh.NgayNhan     = NgayNhan;
         lh.HanChot      = HanChot;
         lh.NgayNhapHoc  = NgayNhapHoc;
         lh.MonHocID     = MonHocID;
         lh.LichHoc      = LichHoc;
         lh.MoTa         = MoTa;
         lh.HocPhi       = HocPhi;
         lh.LoaiHocPhiID = LoaiHocPhiID;
         lh.NhanHocVien  = NhanHocVien;
         lh.Khoi         = Khoi;
         return(lh.Add());
     }
     else
     {
         LopHoc lh = new LopHoc().FindByID(ID);
         lh.TenLopHoc    = TenLopHoc;
         lh.NgayNhan     = NgayNhan;
         lh.HanChot      = HanChot;
         lh.NgayNhapHoc  = NgayNhapHoc;
         lh.MonHocID     = MonHocID;
         lh.LichHoc      = LichHoc;
         lh.MoTa         = MoTa;
         lh.HocPhi       = HocPhi;
         lh.LoaiHocPhiID = LoaiHocPhiID;
         lh.NhanHocVien  = NhanHocVien;
         lh.Khoi         = Khoi;
         return(lh.Update());
     }
 }
예제 #23
0
        public ActionResult Edit(LopHoc model)
        {
            string        connectString = ConfigurationManager.ConnectionStrings["QLSV"].ConnectionString;
            SqlConnection conn          = new SqlConnection(connectString);
            string        query         = "update class set cName=@cName where cID=@cID";

            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlCommand   cmd    = new SqlCommand(query, conn);
            SqlParameter param  = new SqlParameter("@cID", model.CID);
            SqlParameter param1 = new SqlParameter("@cName", model.cName);

            cmd.Parameters.Add(param);
            cmd.Parameters.Add(param1);
            cmd.CommandType = System.Data.CommandType.Text;
            //ExecuteNonQuery danh cho cac cau lenh lien quan den Insert,Update,Delete
            int soDongAnhHuong = cmd.ExecuteNonQuery();

            conn.Close();
            if (soDongAnhHuong > 0)
            {
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
예제 #24
0
        public ActionResult Insert(LopHoc model)
        {
            string        connectString = ConfigurationManager.ConnectionStrings["QLSV"].ConnectionString;
            SqlConnection conn          = new SqlConnection(connectString);
            string        query         = "INSERT INTO CLASS (cName) VALUES (@cName)";

            if (conn.State == System.Data.ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlCommand   cmd   = new SqlCommand(query, conn);
            SqlParameter param = new SqlParameter("@cName", model.cName);

            cmd.Parameters.Add(param);
            cmd.CommandType = System.Data.CommandType.Text;
            //ExecuteNonQuery danh cho cac cau lenh lien quan den Insert,Update,Delete
            int           soDongAnhHuong = cmd.ExecuteNonQuery();
            List <LopHoc> lstData        = new List <LopHoc>();

            conn.Close();
            if (soDongAnhHuong > 0)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
예제 #25
0
        public async Task <IActionResult> PutLopHoc(int id, LopHoc lopHoc)
        {
            if (id != lopHoc.id)
            {
                return(BadRequest());
            }

            _context.Entry(lopHoc).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LopHocExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #26
0
        protected void grvLop_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            GridViewRow gvrLop;

            try
            {
                gvrLop = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
            }
            catch { return; }
            int index = gvrLop.RowIndex;

            if (e.CommandName == "Sua")
            {
                LopHoc      lh    = new LopHoc();
                GridViewRow gvrow = grvLop.Rows[index];
                txtMaLop.Enabled = false;
                txtMaLop.Text    = HttpUtility.HtmlDecode(gvrow.Cells[0].Text).ToString();
                lh               = lhbll.LayLopHoc(txtMaLop.Text);
                txtTenLop.Text   = lh.TenLop;
                txtHeDaoTao.Text = lh.HeDaoTao;
                txtKhoa.Text     = lh.Khoa;
                ddlDonvi.Text    = lh.MaKhoa;
                EditState.Value  = "edit";
                editType.Value   = "edit";
            }
            else
            if (e.CommandName == "Xoa")
            {
                GridViewRow gvrow = grvLop.Rows[index];
                string      id    = HttpUtility.HtmlDecode(gvrow.Cells[0].Text).ToString();
                idDelete.Value  = id;
                EditState.Value = "delete";
            }
        }
예제 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LopHoc lh = new LopHoc();
            if (Request.QueryString["action"] == "nhapdiem")
            {
                string action = Request.QueryString["nhapdiem"];
                string malop  = Request.QueryString["malop"];
                Session["malop"] = malop;

                lh.MaLop = Session["malop"].ToString();
            }
            lh.MaLop = Session["malop"].ToString();
            GiaoVien gv   = new GiaoVien();
            int      magv = int.Parse(Session["magv"].ToString());
            monhoc  = gvDAL.GetMaMonHoc(magv, lh.MaLop);
            gv.MaGV = magv;
            DSHocSinh.DataSource = gvDAL.GetDanhSachHSLopNhapDiem(Session["malop"].ToString(), magv, monhoc);
            DSHocSinh.DataBind();
            kiemtratb();
        }
        lbTenLop.Text = gvDAL.LayTenLop(Session["malop"].ToString());
        lbMonHoc.Text = gvDAL.LayTenMonHoc(monhoc);
    }
        public JsonResult Delete(int id)
        {
            LopHoc obj = db.LopHocs.Find(id);

            obj.Active = false;
            return(Json(db.SaveChanges()));
        }
예제 #29
0
        public async Task <LopHoc> UpdateLopHoc(LopHoc lopHoc)
        {
            _context.LopHocContext.Update(lopHoc);
            await _context.SaveChangesAsync();

            return(lopHoc);
        }
예제 #30
0
 private void cboKhoa_SelectedValueChanged(object sender, EventArgs e)
 {
     //load lớp trống của khóa
     cboLop.DataSource    = LopHoc.DanhSachLopTrong(cboKhoa.SelectedValue.ToString());
     cboLop.DisplayMember = "TenLop";
     cboLop.ValueMember   = "MaLop";
 }
예제 #31
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     if (curClass == null)
     {
         LopHoc lopHoc = new LopHoc()
         {
             SoLuongHocSinh = int.Parse(tbSoHocSinh.Text),
             HocPhiMotBuoi  = int.Parse(tbHocPhi1Buoi.Text),
             MaKhoaHoc      = int.Parse(cboKhoaHoc.SelectedValue.ToString()),
             MaGiaoVien     = int.Parse(cboGiaoVien.SelectedValue.ToString()),
             MaMonHoc       = int.Parse(cboMonHoc.SelectedValue.ToString()),
             MaMucHocPhi    = int.Parse(cboMucHocPhi.SelectedValue.ToString()),
             DaKetThuc      = cbTrangThai.Checked
         };
         db.LopHocs.Add(lopHoc);
     }
     else
     {
         curClass.SoLuongHocSinh = int.Parse(tbSoHocSinh.Text);
         curClass.HocPhiMotBuoi  = int.Parse(tbHocPhi1Buoi.Text);
         curClass.MaKhoaHoc      = int.Parse(cboKhoaHoc.SelectedValue.ToString());
         curClass.MaGiaoVien     = int.Parse(cboGiaoVien.SelectedValue.ToString());
         curClass.MaMonHoc       = int.Parse(cboMonHoc.SelectedValue.ToString());
         curClass.MaMucHocPhi    = int.Parse(cboMucHocPhi.SelectedValue.ToString());
         curClass.DaKetThuc      = cbTrangThai.Checked;
     }
     db.SaveChanges();
     BoundDataSource();
     dgvContent.Enabled = true;
 }
예제 #32
0
        public ActionResult Meeting(LopHoc lopHoc, int tt)         //tt=1 sắm tới : -1:cũ ; 0:all
        {
            var lh = new LopHocDAO().GetByID(lopHoc.ID);

            ViewBag.lophoc = lh;
            DateTime date;
            IEnumerable <TaiLieu> audiolist = null;

            if (lh.TaiLieux.Count() > 0)
            {
                audiolist = lh.TaiLieux.Where(x => x.idLH == lh.ID && x.idKN == null).OrderBy(x => x.thoiGian);

                if (tt == 1)
                {
                    foreach (var item in audiolist)
                    {
                        if (DateTime.Compare(item.thoiGian, DateTime.Now) >= 0)
                        {
                            date = item.thoiGian;
                            List <TaiLieu> list = new List <TaiLieu>();
                            list.Add(item);
                            audiolist = list;
                            return(View(audiolist));
                        }
                    }
                    return(View(audiolist));
                }
            }
            return(View(audiolist));
        }
예제 #33
0
 partial void UpdateLopHoc(LopHoc instance);
예제 #34
0
	private void detach_LopHocs(LopHoc entity)
	{
		this.SendPropertyChanging();
		entity.NguoiDung = null;
	}
예제 #35
0
 partial void DeleteLopHoc(LopHoc instance);
예제 #36
0
	private void attach_LopHocs(LopHoc entity)
	{
		this.SendPropertyChanging();
		entity.NguoiDung = this;
	}
예제 #37
0
 partial void InsertLopHoc(LopHoc instance);
예제 #38
0
 public DataTable LayDanhSachHS(LopHoc lh)
 {
     return kn.GetDanhSachHSLop(lh.MaLop);
 }
예제 #39
0
 private void BaoCao_Load(object sender, EventArgs e)
 {
     if (Kieu.Equals("TimKiemHeDaoTao"))
     {
         HeDaoTao HDT = new HeDaoTao();
         HDT.SetDataSource(DuLieu);
         HienThi.ReportSource = HDT;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemHocKy"))
     {
         HocKy HK = new HocKy();
         HK.SetDataSource(DuLieu);
         HienThi.ReportSource = HK;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemKhoa"))
     {
         Khoa Khoa = new Khoa();
         Khoa.SetDataSource(DuLieu);
         HienThi.ReportSource = Khoa;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemKhoaHoc"))
     {
         KhoaHoc KH = new KhoaHoc();
         KH.SetDataSource(DuLieu);
         HienThi.ReportSource = KH;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemLopHoc"))
     {
         LopHoc Lop = new LopHoc();
         Lop.SetDataSource(DuLieu);
         HienThi.ReportSource = Lop;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemMonHoc"))
     {
         MonHoc MH = new MonHoc();
         MH.SetDataSource(DuLieu);
         HienThi.ReportSource = MH;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemNganhDaoTao"))
     {
         NganhDaoTao NDT = new NganhDaoTao();
         NDT.SetDataSource(DuLieu);
         HienThi.ReportSource = NDT;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemSinhVien"))
     {
         SinhVien SV = new SinhVien();
         SV.SetDataSource(DuLieu);
         HienThi.ReportSource = SV;
         HienThi.Refresh();
     }
     if (Kieu.Equals("TimKiemTaiKhoan"))
     {
         TaiKhoan TK = new TaiKhoan();
         TK.SetDataSource(DuLieu);
         HienThi.ReportSource = TK;
         HienThi.Refresh();
     }
     if (Kieu.Equals("HocBong"))
     {
         HocBong HB = new HocBong();
         HB.SetDataSource(DuLieu);
         HB.SetParameterValue(1, HocKy);
         HienThi.ReportSource = HB;
         HienThi.Refresh();
     }
     if (Kieu.Equals("HocBong_Khoa"))
     {
         HocBong_Khoa HBK = new HocBong_Khoa();
         HBK.SetDataSource(DuLieu);
         HBK.SetParameterValue(2, HocKy);
         HBK.SetParameterValue(3, Khoa);
         HienThi.ReportSource = HBK;
         HienThi.Refresh();
     }
     if (Kieu.Equals("HocBong_Khoa_Top"))
     {
         HocBong_Khoa_Top HBK = new HocBong_Khoa_Top();
         HBK.SetDataSource(DuLieu);
         HBK.SetParameterValue(3, HocKy);
         HBK.SetParameterValue(4, Khoa);
         HBK.SetParameterValue(5, Top);
         HienThi.ReportSource = HBK;
         HienThi.Refresh();
     }
     if (Kieu.Equals("RaTruong"))
     {
         RaTruong RT = new RaTruong();
         RT.SetDataSource(DuLieu);
         HienThi.ReportSource = RT;
         HienThi.Refresh();
     }
     if (Kieu.Equals("RaTruong_NhanBang"))
     {
         RaTruong_NhanBang RTNB = new RaTruong_NhanBang();
         RTNB.SetDataSource(DuLieu);
         HienThi.ReportSource = RTNB;
         HienThi.Refresh();
     }
     if (Kieu.Equals("RaTruong_KhongBang"))
     {
         RaTruong_KhongBang RTKB = new RaTruong_KhongBang();
         RTKB.SetDataSource(DuLieu);
         HienThi.ReportSource = RTKB;
         HienThi.Refresh();
     }
     //
     if (Kieu.Equals("KetQuaRaTruong"))
     {
         KetQuaRaTruong KQRT = new KetQuaRaTruong();
         KQRT.SetDataSource(DuLieu);
         KQRT.SetParameterValue(1, He4);
         KQRT.SetParameterValue(2, He10);
         KQRT.SetParameterValue(3, TichLuy);
         KQRT.SetParameterValue(4, HoTen);
         KQRT.SetParameterValue(5, Lop);
         KQRT.SetParameterValue(6, MaSinhVien);
         HienThi.ReportSource = KQRT;
         HienThi.Refresh();
     }
     if (Kieu.Equals("KetQuaHocKy"))
     {
         KetQuaHocKy KQHK = new KetQuaHocKy();
         KQHK.SetDataSource(DuLieu);
         KQHK.SetParameterValue(2, HoTen);
         KQHK.SetParameterValue(3, Lop);
         KQHK.SetParameterValue(4, MaSinhVien);
         KQHK.SetParameterValue(5, He4);
         KQHK.SetParameterValue(6, He10);
         KQHK.SetParameterValue(7, TichLuy);
         KQHK.SetParameterValue(8, HocKy);
         HienThi.ReportSource = KQHK;
         HienThi.Refresh();
     }
 }