public JsonResult SaveTest(AthleteTestMasterModel objTest) { AthleteTestBL athleteTestBL = new AthleteTestBL(_context, _httpContextAccessor); bool Status = athleteTestBL.SaveTestDetials(objTest); return(Json(Status)); }
public bool DeleteTestDetails(long id) { AthleteTestMasterModel objTest = new AthleteTestMasterModel(); objTest = _context.TblAthleteTestMaster.Find(id); _context.TblAthleteTestMaster.Remove(objTest); _context.SaveChanges(); return(true); }
public AthleteTestMasterModel GetTestDetails(long id) { AthleteTestMasterModel objTest = new AthleteTestMasterModel(); if (_context.TblAthleteTestMaster.Find(id) != null) { objTest = _context.TblAthleteTestMaster.Find(id); } return(objTest); }
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)); }
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); }