Beispiel #1
0
        public ActionResult CourseUpdate([DataSourceRequest] DataSourceRequest request, CRMCourses _course)
        {
            if (ModelState.IsValid)
            {
                var  _salesObj = _objSaleBAL.ManageCourse_GetAllBAL(CurrentUser.CompanyID, "");
                bool flage     = false;
                foreach (var x in _salesObj)
                {
                    if (x.PrimaryCourseName == _course.PrimaryCourseName && x.ID != _course.ID)
                    {
                        flage = true;
                        break;
                    }
                }
                if (flage)
                {
                    ModelState.AddModelError(lr.DubliocationHappen, lr.ProposedCourseAllreadyExists);
                }
                else
                {
                    _course.ModifiedBy = CurrentUser.NameIdentifierInt64;
                    _course.ModifiedOn = DateTime.Now;
                    var result = _objSaleBAL.CourseUpdateBAL(_course);
                    if (result == -1)
                    {
                        ModelState.AddModelError(lr.ErrorServerError, lr.ErrorServerError);
                    }
                }
            }
            var resultData = new[] { _course };

            return(Json(resultData.ToDataSourceResult(request, ModelState)));
        }
        public ActionResult CourseUpdate([DataSourceRequest] DataSourceRequest request, CRMCourses _course)
        {
            if (ModelState.IsValid)
            {
                _course.ModifiedBy = CurrentUser.NameIdentifierInt64;
                _course.ModifiedOn = DateTime.Now;
                var result = _objSaleBAL.CourseUpdateBAL(_course);
                if (result == -1)
                {
                    ModelState.AddModelError(lr.ErrorServerError, lr.ResourceUpdateValidationError);
                }
            }
            var resultData = new[] { _course };

            return(Json(resultData.ToDataSourceResult(request, ModelState)));
        }