public ActionResult ManageCourse_Create([DataSourceRequest] DataSourceRequest request, CRMCourses _objlogmap) { if (ModelState.IsValid) { var _salesObj = _objSaleBAL.ManageCourse_GetAllBAL(CurrentUser.CompanyID, ""); bool flage = false; foreach (var x in _salesObj) { if (x.PrimaryCourseName == _objlogmap.PrimaryCourseName) { flage = true; break; } } if (flage) { ModelState.AddModelError(lr.DubliocationHappen, lr.ProposedCourseAllreadyExists); } else { _objlogmap.CreatedBy = CurrentUser.NameIdentifierInt64; _objlogmap.CreatedDate = DateTime.Now; _objlogmap.OrganizationID = CurrentUser.CompanyID; _objlogmap.ID = _objSaleBAL.ManageCourse_CreateBAL(_objlogmap); } } var resultData = new[] { _objlogmap }; return(Json(resultData.ToDataSourceResult(request, ModelState))); }
public ActionResult ManageCourse_Create([DataSourceRequest] DataSourceRequest request, CRMCourses _objlogmap) { if (ModelState.IsValid) { _objlogmap.CreatedBy = CurrentUser.NameIdentifierInt64; _objlogmap.CreatedDate = DateTime.Now; _objlogmap.OrganizationID = CurrentUser.CompanyID; _objlogmap.ID = _objSaleBAL.ManageCourse_CreateBAL(_objlogmap); //} } var resultData = new[] { _objlogmap }; return(Json(resultData.ToDataSourceResult(request, ModelState))); }