예제 #1
0
        public ActionResult FeaturesManagement(FeatureProfileModel fpm, String submit)
        {
            AuthenticationsAndAuthorizationsOperations aNaOps = new AuthenticationsAndAuthorizationsOperations();

            switch (submit)
            {
            case "Delete":
                if (!aNaOps.DeleteFeatureProfile(fpm.FeatureName))
                {
                    TempData["FeaturesManagementErrorMsg"] = "Error - The feature name not found in the list.";
                }
                break;

            case "Create":
                if (!aNaOps.InsertNewFeatureProfile(fpm.FeatureName, fpm.Remarks))
                {
                    TempData["FeaturesManagementErrorMsg"] = "Error - The feature name already exists, please change a name and try again.";
                }
                break;

            case "Update":
                if (!String.IsNullOrEmpty(fpm.OldFeatureName))
                {
                    if (!aNaOps.UpdateFeatureProfile(fpm.OldFeatureName, fpm.FeatureName, fpm.Remarks))
                    {
                        TempData["FeaturesManagementErrorMsg"] = "Error - The feature name not found in the list.";
                    }
                }
                break;

            default: break;
            }
            return(RedirectToAction("FeaturesManagement"));
        }