Ejemplo n.º 1
0
        public ActionResult DeleteListEntry(int entryId, string propertyName)
        {
            ActionResult actionResult = new ActionResult();

            try
            {
                int pid = PortalSettings.PortalId;
                if (!UserInfo.IsSuperUser && pid != PortalSettings.PortalId)
                {
                    actionResult.AddError(HttpStatusCode.Unauthorized.ToString(), Components.Constants.AuthFailureMessage);
                }

                if (actionResult.IsSuccess)
                {
                    ListController listController = new ListController();
                    listController.DeleteListEntryByID(entryId, true);
                    actionResult.Data = new { Managers.MemberProfileManager.GetListInfo(propertyName, PortalSettings.PortalId).Data.Entries };
                }
            }
            catch (Exception exc)
            {
                actionResult.AddError(HttpStatusCode.InternalServerError.ToString(), exc.Message);
            }
            return(actionResult);
        }
Ejemplo n.º 2
0
 private void DeleteItem(int entryId)
 {
     if (SelectedListItems.Any())
     {
         try
         {
             var ctlLists = new ListController();
             ctlLists.DeleteListEntryByID(entryId, true);
             DataBind();
         }
         catch (Exception exc)                 //Module failed to load
         {
             Exceptions.ProcessModuleLoadException(this, exc);
         }
     }
     else
     {
         DeleteList();
     }
 }