Exemple #1
0
        public ActionResult Relation_Destroy([DataSourceRequest] DataSourceRequest request, PersonRelation _objPersonRelation)
        {
            if (ModelState.IsValid)
            {
                _objPersonRelation.UpdatedBy   = CurrentUser.NameIdentifierInt64;
                _objPersonRelation.UpdatedDate = DateTime.Now;
                var    result = _PersonBAL.PersonRelationToPerson_DeleteBAL(_objPersonRelation);
                string ip     = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (string.IsNullOrEmpty(ip))
                {
                    ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
                }
                _objConfigurationBAL.Audit_CreateBAL(ip, DateTime.Now, CurrentUser.CompanyID, CurrentUser.NameIdentifierInt64, EventType.Update, System.Web.HttpContext.Current.Request.Browser.Browser);

                if (result == -1)
                {
                    ModelState.AddModelError(lr.ErrorServerError, lr.ResourceUpdateValidationError);
                }
            }
            var resultData = new[] { _objPersonRelation };

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