public int ThemNamHoc(string tenNamHoc)
        {
            NamHocModel nh = new NamHocModel();

            nh.TENNAMHOC = tenNamHoc;
            return(nh.Them());
        }
        public int CapNhatNamHoc(string msNamHoc, string tenNamHoc)
        {
            NamHocModel nh = new NamHocModel();

            nh.MSNAMHOC  = int.Parse(msNamHoc);
            nh.TENNAMHOC = tenNamHoc;
            return(nh.CapNhatNamHoc());
        }
        public int XoaNamHoc(string msNamHoc)
        {
            NamHocModel nh = new NamHocModel();

            nh.MSNAMHOC  = int.Parse(msNamHoc);
            nh.TENNAMHOC = msNamHoc;
            return(nh.XoaNamHoc());
        }
Пример #4
0
        public ResponseResult SuaNamHoc(NamHocModel model)
        {
            ResponseResult res = null;

            try
            {
                res = NamHocDA.SuaNamHoc(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
Пример #5
0
        public NamHocModel ChiTietNamHoc(int BangPhanCongID)
        {
            NamHocModel model = null;

            try
            {
                model = NamHocDA.ChiTietNamHoc(BangPhanCongID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(model);
        }
Пример #6
0
        public ResponseResult ThemNamHoc(NamHocModel model)
        {
            ResponseResult res = null;

            try
            {
                model.NguoiTao = AccountUtils.CurrentUsername();
                res            = NamHocDA.ThemNamHoc(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
Пример #7
0
        public NamHocModel ChiTietNamHoc(int BangPhanCongID)
        {
            NamHocModel model = null;

            try
            {
                List <SqlParameter> listParameter = new List <SqlParameter>();
                listParameter.Add(new SqlParameter("@BangPhanCongID", BangPhanCongID));
                model = DBUtils.ExecuteSP <NamHocModel>("SP_BangPhanCong_ChiTiet", listParameter);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(model);
        }
Пример #8
0
        public ResponseResult ThemNamHoc(NamHocModel model)
        {
            ResponseResult res = null;

            try
            {
                List <SqlParameter> listParameter = new List <SqlParameter>();
                listParameter.Add(new SqlParameter("@NamHoc", model.NamHoc));
                listParameter.Add(new SqlParameter("@NguoiTao", model.NguoiTao));
                res = DBUtils.ExecuteSP <ResponseResult>("SP_BangPhanCong_Them", listParameter);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
Пример #9
0
 public ActionResult SuaNamHoc(NamHocModel model)
 {
     try
     {
         var result = NamHocService.SuaNamHoc(model);
         if (result != null && result.ResponseCode == 1)
         {
             return(Json(JsonResponseViewModel.CreateSuccess("Cập nhật năm học thành công.")));
         }
         else if (result != null && result.ResponseCode == -1)
         {
             return(Json(JsonResponseViewModel.CreateFail(result.ResponseMessage)));
         }
         else
         {
             return(Json(JsonResponseViewModel.CreateFail("Cập nhật năm học thất bại.")));
         }
     }
     catch (Exception ex)
     {
         return(Json(JsonResponseViewModel.CreateFail(ex)));
     }
 }
 // GET: Admin/HocKyNamHoc
 public ActionResult Index()
 {
     ViewData["DSNamHoc"] = new NamHocModel().DanhSach();
     ViewData["DSKhoa"]   = new KhoaHocModel().DanhSach();
     return(View());
 }