public ActionResult deleteDataAttribute(long Id, string cssId = "")
        {
            MessageModel DataAttributeDeleteValidation = MessageModel.validateAttributeDelete(Id);

            if (DataAttributeDeleteValidation.hasMessage)
            {
                return(PartialView("_messageWindow", DataAttributeDeleteValidation));
            }
            else
            {
                DataContainerManager dataAttributeManager = null;
                try
                {
                    dataAttributeManager = new DataContainerManager();

                    DataAttribute dataAttribute = dataAttributeManager.DataAttributeRepo.Get(Id);

                    dataAttributeManager.DeleteDataAttribute(dataAttribute);

                    return(PartialView("_message", new MessageModel()
                    {
                        Message = "DataStructure" + Id + "deleted",
                        hasMessage = false,
                        CssId = "deleted"
                    }));
                }
                finally
                {
                    dataAttributeManager.Dispose();
                }
            }
        }
예제 #2
0
 public ActionResult deletAttribute(long id, string name)
 {
     if (id != 0)
     {
         DataContainerManager DAM = null;
         try
         {
             DAM = new DataContainerManager();
             DataAttribute dataAttribute = DAM.DataAttributeRepo.Get(id);
             if (dataAttribute != null)
             {
                 if (!attributeInUse(dataAttribute))
                 {
                     DAM.DeleteDataAttribute(dataAttribute);
                 }
             }
         }
         finally
         {
             DAM.Dispose();
         }
     }
     return(RedirectToAction("AttributeManager"));
 }