示例#1
0
        public JsonResult SaveTest(AthleteTestMasterModel objTest)
        {
            AthleteTestBL athleteTestBL = new AthleteTestBL(_context, _httpContextAccessor);
            bool          Status        = athleteTestBL.SaveTestDetials(objTest);

            return(Json(Status));
        }
示例#2
0
        public bool DeleteTestDetails(long id)
        {
            AthleteTestMasterModel objTest = new AthleteTestMasterModel();

            objTest = _context.TblAthleteTestMaster.Find(id);
            _context.TblAthleteTestMaster.Remove(objTest);
            _context.SaveChanges();
            return(true);
        }
示例#3
0
        public AthleteTestMasterModel GetTestDetails(long id)
        {
            AthleteTestMasterModel objTest = new AthleteTestMasterModel();

            if (_context.TblAthleteTestMaster.Find(id) != null)
            {
                objTest = _context.TblAthleteTestMaster.Find(id);
            }
            return(objTest);
        }
示例#4
0
        public PartialViewResult _AddEditTest(long Id)
        {
            AthleteTestBL          athleteTestBL          = new AthleteTestBL(_context, _httpContextAccessor);
            AthleteTestMasterModel athleteTestMasterModel = athleteTestBL.GetTestDetails(Id);


            AthleteTestTypesBL   objTestType   = new AthleteTestTypesBL(_context, _httpContextAccessor);
            List <TestTypeModel> lstTestTypess = objTestType.GetAllAthleteTestType();

            if (athleteTestMasterModel != null)
            {
                ViewBag.lstTestType = new SelectList(lstTestTypess, "Id", "TestType", athleteTestMasterModel.TestTypeId);
            }
            else
            {
                athleteTestMasterModel = new AthleteTestMasterModel();
                ViewBag.lstTestType    = new SelectList(lstTestTypess, "Id", "TestType");
            }
            return(PartialView(athleteTestMasterModel));
        }
示例#5
0
 public bool SaveTestDetials(AthleteTestMasterModel tblAthleteTestMaster)
 {
     if (tblAthleteTestMaster.Id > 0)
     {
         AthleteTestMasterModel obj = _context.TblAthleteTestMaster.Find(tblAthleteTestMaster.Id);
         obj.TestTypeId  = tblAthleteTestMaster.TestTypeId;
         obj.TestDate    = tblAthleteTestMaster.TestDate;
         obj.UpdatedBy   = Convert.ToInt64(HttpHelper.GetSessionString(Constants.SessionUserId));
         obj.UpdatedDate = DateTime.Now;
         _context.TblAthleteTestMaster.Update(obj);
         _context.SaveChanges();
     }
     else
     {
         tblAthleteTestMaster.CreatedBy = Convert.ToInt64(HttpHelper.GetSessionString(Constants.SessionUserId));
         _context.TblAthleteTestMaster.Add(tblAthleteTestMaster);
         _context.SaveChanges();
     }
     return(true);
 }