예제 #1
0
        public ActionResult ConfigurationUpdate([DataSourceRequest] DataSourceRequest request, CRMHowHeard _course)
        {
            if (ModelState.IsValid)
            {
                var  _manageconfiguration = _objSaleBAL.ManageConfiguration_GetAllBAL(CurrentUser.CompanyID, "");
                bool flage = false;
                foreach (var x in _manageconfiguration)
                {
                    if (x.Name == _course.Name)
                    {
                        flage = true;
                        break;
                    }
                }
                if (flage)
                {
                    ModelState.AddModelError(lr.DubliocationHappen, lr.CRMConfigrationAllreadyExists);
                }
                else
                {
                    _course.ModifiedBy = CurrentUser.NameIdentifierInt64;
                    _course.ModifiedOn = DateTime.Now;
                    var result = _objSaleBAL.ManageConfiguration_UpdateBAL(_course);
                    if (result == -1)
                    {
                        ModelState.AddModelError(lr.ErrorServerError, lr.ErrorServerError);
                    }
                }
            }
            var resultData = new[] { _course };

            return(Json(resultData.ToDataSourceResult(request, ModelState)));
        }
예제 #2
0
        public ActionResult ConfigurationUpdate([DataSourceRequest] DataSourceRequest request, CRMHowHeard _course)
        {
            if (ModelState.IsValid)
            {
                _course.ModifiedBy = CurrentUser.NameIdentifierInt64;
                _course.ModifiedOn = DateTime.Now;
                var result = _objSaleBAL.ManageConfiguration_UpdateBAL(_course);
                if (result == -1)
                {
                    ModelState.AddModelError(lr.ErrorServerError, lr.ResourceUpdateValidationError);
                }
            }
            var resultData = new[] { _course };

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