public PhanCongNhomLopModel ChiTietPhanCongNhomLop(int PhanCongNhomLopID)
        {
            PhanCongNhomLopModel model = null;

            try
            {
                model = PhanCongNhomLopDA.ChiTietPhanCongNhomLop(PhanCongNhomLopID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(model);
        }
        public ResponseResult SuaPhanCongNhomLop(PhanCongNhomLopModel model)
        {
            ResponseResult res = null;

            try
            {
                res = PhanCongNhomLopDA.SuaPhanCongNhomLop(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
        public ResponseResult ThemPhanCongNhomLop(PhanCongNhomLopModel model)
        {
            ResponseResult res = null;

            try
            {
                model.NguoiTao = AccountUtils.CurrentUsername();
                res            = PhanCongNhomLopDA.ThemPhanCongNhomLop(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
Beispiel #4
0
        public PhanCongNhomLopModel ChiTietPhanCongNhomLop(int PhanCongNhomLopID)
        {
            PhanCongNhomLopModel model = null;

            try
            {
                List <SqlParameter> listParameter = new List <SqlParameter>();
                listParameter.Add(new SqlParameter("@PhanCongNhomLopID", PhanCongNhomLopID));
                model = DBUtils.ExecuteSP <PhanCongNhomLopModel>("SP_PhanCongNhomLop_ChiTiet", listParameter);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(model);
        }
Beispiel #5
0
 public ActionResult ThemPhanCongNhomLop(PhanCongNhomLopModel model)
 {
     try
     {
         var hp = HocPhanService.ChiTietHocPhanLog(model.HocPhanLogID);
         var c  = PhanCongNhomLopService.DanhSachPhanCongNhomLop(model.BangPhanCongID, model.KhoaID, null).Where(x => x.HocPhanID == hp.HocPhanID).FirstOrDefault();
         if (c != null)
         {
             ModelState.AddModelError("HocPhanLogID", "Học phần \"" + model.TenHocPhan + "\" đã được phân công nhóm lớp");
         }
         if (ModelState.IsValid)
         {
             var result = PhanCongNhomLopService.ThemPhanCongNhomLop(model);
             if (result != null && result.ResponseCode == 1)
             {
                 return(Json(JsonResponseViewModel.CreateSuccess("Thêm phân công nhóm lớp thành công.")));
             }
             else if (result != null && result.ResponseCode == -1)
             {
                 return(Json(JsonResponseViewModel.CreateFail(result.ResponseMessage)));
             }
             else
             {
                 return(Json(JsonResponseViewModel.CreateFail("Thêm phân công nhóm lớp thất bại.")));
             }
         }
         else
         {
             var dshp = HocPhanService.DanhSachHocPhanTheoKhoa(model.KhoaID);
             ViewBag.bangpcIDvb = model.BangPhanCongID;
             ViewBag.khoaidvb   = model.KhoaID;
             ViewBag.hocphanddl = new SelectList(dshp, "HocPhanLogID", "MaVaTenHP");
             ViewBag.hocphanlt  = new SelectList(dshp, "HocPhanLogID", "SoTietLT");
             ViewBag.hocphanth  = new SelectList(dshp, "HocPhanLogID", "SoTietTH");
             ViewBag.hocphantc  = new SelectList(dshp, "HocPhanLogID", "SoTC");
             ViewBag.hocphanst  = new SelectList(dshp, "HocPhanLogID", "SoTietHP");
             ViewBag.bomont     = new SelectList(dshp, "HocPhanLogID", "TenBoMon");
             return(PartialView("_ThemPhanCongNhomLop"));
         }
     }
     catch (Exception ex)
     {
         return(Json(JsonResponseViewModel.CreateFail(ex)));
     }
 }
Beispiel #6
0
        public ResponseResult ThemPhanCongNhomLop(PhanCongNhomLopModel model)
        {
            ResponseResult res = null;

            try
            {
                List <SqlParameter> listParameter = new List <SqlParameter>();
                listParameter.Add(new SqlParameter("@BangPhanCongID", model.BangPhanCongID));
                listParameter.Add(new SqlParameter("@KhoaID", model.KhoaID));
                listParameter.Add(new SqlParameter("@HocPhanLogID", model.HocPhanLogID));
                listParameter.Add(new SqlParameter("@SLSVNhomLop", model.SLSVNhomLop));
                listParameter.Add(new SqlParameter("@SoLuongNhomLopLT", model.SoLuongNhomLopLT));
                listParameter.Add(new SqlParameter("@SoLuongNhomLopTH", model.SoLuongNhomLopTH));
                listParameter.Add(new SqlParameter("@NguoiTao", model.NguoiTao));
                res = DBUtils.ExecuteSP <ResponseResult>("SP_PhanCongNhomLop_Them", listParameter);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(res);
        }
Beispiel #7
0
 public ActionResult SuaPhanCongNhomLop(PhanCongNhomLopModel model)
 {
     try
     {
         var result = PhanCongNhomLopService.SuaPhanCongNhomLop(model);
         if (result != null && result.ResponseCode == 1)
         {
             return(Json(JsonResponseViewModel.CreateSuccess("Cập nhật phân công nhóm lớp 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 phân công nhóm lớp thất bại.")));
         }
     }
     catch (Exception ex)
     {
         return(Json(JsonResponseViewModel.CreateFail(ex)));
     }
 }