示例#1
0
        public int ThemJSON(string hocKy, string maHocPhan, string maLopHocphan,
                            string tenLopHocPhan, string siSo, string loaiLopHocPhan)
        {
            int st = new LopHocPhanModel(maLopHocphan, tenLopHocPhan, int.Parse(siSo),
                                         int.Parse(loaiLopHocPhan), int.Parse(maHocPhan), int.Parse(hocKy)).Them();

            if (st > 0)
            {
                PhanCongGiangDayModel pc = new PhanCongGiangDayModel();
                pc.MSGIANGVIEN  = Contains.TAIKHOANDANGNHAP.MSGIANGVIEN;
                pc.MSLOPHOCPHAN = st;
                return(pc.Them());
            }
            return(0);
        }
示例#2
0
        public ActionResult CapNhat(ICollection <string> MSPHANCONGGIANGDAY, ICollection <string> MSLOPHOCPHAN,
                                    ICollection <string> MSGIANGVIEN)
        {
            var listPhanCong         = MSPHANCONGGIANGDAY.ToArray();
            var listLopHocPhan       = MSLOPHOCPHAN.ToArray();
            var listGiangVien        = MSGIANGVIEN.ToArray();
            PhanCongGiangDayModel pc = new PhanCongGiangDayModel();

            for (int i = 0; i < listPhanCong.Length; i++)
            {
                pc.MSPHANCONGGIANGDAY = int.Parse(listPhanCong[i]);
                pc.MSLOPHOCPHAN       = int.Parse(listLopHocPhan[i]);
                pc.MSGIANGVIEN        = int.Parse(listGiangVien[i]);
                pc.CapNhat();
            }
            return(RedirectToAction("Index", "PhanCongGiangDay", new { area = "Admin" }));
        }