Exemple #1
0
        public void getBCM()
        {
            CTMonHoc.ctmh.Clear();

            HocSinhDBDataContext hdb = new HocSinhDBDataContext();
            var qq = from si in hdb.BAOCAOTONGKETMONs select si;

            foreach (var ss in qq.ToList())
            {
                String cc  = ss.MaHocKi.ToString();
                int    cc2 = int.Parse(cc);



                CTMonHoc x = new CTMonHoc(ss.MaBaoCaoMon, cc2, ss.MaLop, ss.MaMon, 0, 0);
                CTMonHoc.ctmh.Add(x);
            }
            CTMonHoc.mh.Clear();


            var mhoc = from si in hdb.MONHOCs select si;

            foreach (var ss in mhoc.ToList())
            {
                CTMonHoc x = new CTMonHoc(ss.MaMonHoc, ss.TenMonHoc);
                CTMonHoc.mh.Add(x);
            }
        }
Exemple #2
0
        private void hk2bt_Click(object sender, EventArgs e)
        {
            string x = yearcombo.SelectedItem.ToString();
            string y = "2" + x;
            int    z = int.Parse(y);
            int    i = 0;

            if (mhnothkgrid.SelectedRows.Count > 0)
            {
                foreach (var nh in HocKi.HK)
                {
                    if (nh.MaHK1 == z && mhnothkgrid.SelectedRows.Count > 0)
                    {
                        i = 1;
                        DataGridViewRow row = mhnothkgrid.SelectedRows[0];

                        string   mabc    = nh.MaHK1 + row.Cells[0].Value.ToString();
                        CTMonHoc chitiet = new CTMonHoc(mabc, nh.MaHK1, row.Cells[0].Value.ToString());
                        HSB.AddMHtoHK(chitiet);
                        MessageBox.Show("successfull");
                    }
                }
                if (i == 0)
                {
                    MessageBox.Show("năm học này chưa có học kì này");
                }
            }
            else
            {
                MessageBox.Show("Chưa chọn môn học cần thêm vào học kì");
            }
        }
Exemple #3
0
        public void GetKL()
        {
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();

            try
            {
                HocKi.HK.Clear();
                var hocki = from hk in hdb.HOCKIs select hk;
                if (hocki != null)
                {
                    foreach (var hki in hocki)
                    {
                        HocKi lst = new HocKi(hki.MaHocKi, hki.TenHocKi);
                        HocKi.HK.Add(lst);
                    }
                }
                CTMonHoc.ctmh.Clear();
                var ct = from mh in hdb.MONHOCs select mh;
                if (ct != null)
                {
                    foreach (var b in ct)
                    {
                        CTMonHoc lst = new CTMonHoc(b.MaMonHoc, b.TenMonHoc);
                        CTMonHoc.ctmh.Add(lst);
                    }
                }



                ClassDTO.khoilop.Clear();
                clasDTO.lop.Clear();
                var kk = from l in hdb.DANHSACHLOPs select l;
                var q  = from kq in hdb.KHOILOPs select kq;
                if (q == null || kk == null)
                {
                    clasDTO.TonTail = false;
                    ClassDTO.TonTai = false;
                }
                else
                {
                    ClassDTO.TonTai = true;
                    clasDTO.TonTail = true;
                    foreach (var x in q)
                    {
                        ClassDTO kl = new ClassDTO(x.MaKhoiLop, x.TenKhoiLop);
                        ClassDTO.khoilop.Add(kl);
                    }
                    foreach (var n in kk)
                    {
                        clasDTO lop = new clasDTO(n.MaLop, n.TenLop, 0, n.MaKhoiLop);
                        clasDTO.lop.Add(lop);
                    }
                }
            }
            catch
            {
            }
        }
Exemple #4
0
        public void GetBCHK2(int MaHK)
        {
            CTMonHoc.BaoCaoHocKi.Clear();
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();
            var x = from xx in hdb.BAOCAOTONGKETHKs where xx.MaHocKi == MaHK select xx;

            foreach (var kq in x)
            {
                CTMonHoc bcm = new CTMonHoc(kq.MaBaoCaoHK, int.Parse(kq.MaHocKi.ToString()), kq.MaLop, int.Parse(kq.SoLuongDat.ToString()), float.Parse(kq.TiLeDat.ToString()));


                CTMonHoc.BaoCaoHocKi.Add(bcm);
            }
        }
Exemple #5
0
        public void GetBCMonHoc(string MaMon, int MaHK)
        {
            CTMonHoc.BaocaoMon.Clear();
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();
            var x = from xx in hdb.BAOCAOTONGKETMONs where xx.MaHocKi == MaHK && xx.MaMon == MaMon select xx;

            foreach (var kq in x)
            {
                CTMonHoc bcm = new CTMonHoc(kq.MaBaoCaoMon, int.Parse(kq.MaHocKi.ToString()), kq.MaLop, kq.MaMon, int.Parse(kq.SoLuongDatMon.ToString()), float.Parse(kq.TiLeDatMon.ToString()));


                CTMonHoc.BaocaoMon.Add(bcm);
            }
        }
Exemple #6
0
        public bool AddMHtoHK(CTMonHoc hk)
        {
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();

            try
            {
                hdb.AddMHtoNH(hk.MaBCMon1, hk.MaHK1, hk.MaMon1);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #7
0
        public bool AddMH(CTMonHoc mh)
        {
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();

            try
            {
                hdb.AddMH(mh.MaMon1, mh.TenMon1);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #8
0
        public void getMon()
        {
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();

            CTMonHoc.mh.Clear();


            var mhoc = from si in hdb.MONHOCs select si;

            foreach (var ss in mhoc.ToList())
            {
                CTMonHoc x = new CTMonHoc(ss.MaMonHoc, ss.TenMonHoc);
                CTMonHoc.mh.Add(x);
            }
        }
Exemple #9
0
        public void dsBD()
        {
            CTMonHoc.mhHS.Clear();
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();
            var kq = from s in hdb.BANGDIEMs select s;

            foreach (var ok in kq.ToList())
            {
                float    ck     = float.Parse(ok.DiemCuoiKi.ToString());
                float    p15    = float.Parse(ok.Diem15Phut.ToString());
                float    t1     = float.Parse(ok.Diem1Tiet.ToString());
                int      mhs    = int.Parse(ok.MaHocSinh.ToString());
                int      mhhk   = int.Parse(ok.MaHocKi.ToString());
                CTMonHoc ctmhhs = new CTMonHoc(ok.MaBangDiem.ToString(), mhs, mhhk, ok.MaMonHoc.ToString(), p15, t1, ck);
                CTMonHoc.mhHS.Add(ctmhhs);
            }
        }
Exemple #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            string c = txtnamemh.Text.ToLower();
            string d = VietHoa(c);

            if (txtnamemh.Text != "" && checkNameMH1.ErrorMessage == null)
            {
                string   ma      = "MH" + d;
                CTMonHoc chitiet = new CTMonHoc(ma, d);
                HSB.AddMH(chitiet);
                MessageBox.Show("successfull");
            }
            else
            {
                MessageBox.Show("vui lòng nhập đúng tên môn học");
            }
        }
Exemple #11
0
        public void gethavehk(int mahk)
        {
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();

            CTMonHoc.haveHK.Clear();
            var yesHK = from mh in hdb.BAOCAOTONGKETMONs select mh;

            if (yesHK != null)
            {
                foreach (var yes in yesHK)
                {
                    string cc  = yes.MaHocKi.ToString();
                    int    cc2 = int.Parse(cc);
                    if (cc2 == mahk)
                    {
                        CTMonHoc ee = new CTMonHoc(yes.MaBaoCaoMon, cc2, yes.MaMon);
                        CTMonHoc.haveHK.Add(ee);
                    }
                }
            }
        }
Exemple #12
0
        public void getnohk()
        {
            HocSinhDBDataContext hdb = new HocSinhDBDataContext();

            CTMonHoc.noneHK.Clear();
            var monnohk = from mh in hdb.MONHOCs select mh;

            if (monnohk != null)
            {
                foreach (var no in monnohk)
                {
                    var MHnHK = hdb.noneHK(no.MaMonHoc);
                    if (MHnHK != null)
                    {
                        foreach (var oo in MHnHK)
                        {
                            CTMonHoc ee = new CTMonHoc(oo.MaMonHoc, oo.TenMonHoc);
                            CTMonHoc.noneHK.Add(ee);
                        }
                    }
                }
            }
        }
 public bool AddMHtoHK(CTMonHoc ct)
 {
     return(HS.AddMHtoHK(ct));
 }