Exemple #1
0
        public ActionResult AdminItemEdit(int ItemId, ItemCreateViewModel editItem)
        {
            try
            {
                Item tempitem = itemManager.EditItem(ItemId, editItem.Name, editItem.Type, editItem.SelectedOrganizationId, editItem.SelectedKeywords, editItem.StringKeywords);
                if (editItem.ProfileIds != null)
                {
                    itemManager.EditProfiles(editItem.ProfileIds, editItem.TwitterUrl);
                }
                else if (editItem.Type != "Thema")
                {
                    itemManager.AddProfileToItem(tempitem, editItem.TwitterUrl);
                }

                if (editItem.TwitterUrl == null && editItem.ProfileIds != null)
                {
                    itemManager.DeleteProfiles(editItem.ProfileIds);
                }
                return(RedirectToAction("AdminItemIndex"));
            }
            catch
            {
                return(View(editItem));
            }
        }