Esempio n. 1
0
        public ActionResult Links_Destroy([DataSourceRequest] DataSourceRequest request, long oid, int type, Links _objLinks)
        {
            if (ModelState.IsValid)
            {
                _objLinks.UpdatedBy   = CurrentUser.NameIdentifierInt64;
                _objLinks.UpdatedDate = DateTime.Now;
                if (type == 1)
                {
                    var result = _objPersonContactBAL.PersonLinks_DeleteBAL(_objLinks, Convert.ToInt64(oid));
                    if (!result)
                    {
                        ModelState.AddModelError(lr.ErrorServerError, lr.ResourceUpdateValidationError);
                    }
                }
                else
                {
                    var result = _objIOrganizationBAL.OrganizationLinks_DeleteBAL(_objLinks, Convert.ToInt64(oid));
                    if (!result)
                    {
                        ModelState.AddModelError(lr.ErrorServerError, lr.ResourceUpdateValidationError);
                    }
                }
            }
            var resultData = new[] { _objLinks };

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