Esempio n. 1
0
        public ActionResult Edit(Module_Action moduleAction)
        {
            if (ModelState.IsValid)
            {
                var moduleActionModel = new ModuleActionModel();

                var updatedModuleAction = moduleActionModel.EditModuleAction(moduleAction.Module_Action_Id, moduleAction.Module_Controller_Id, moduleAction.Module_Action_Name);

                if (updatedModuleAction == null)
                {
                    ViewBag.Message = "An Error Occured, Please contact Support";
                    return(View(moduleAction));
                }

                // Link selected roles
                var roleIds = new List <int>();
                if (moduleAction.Posted_Roles != null)
                {
                    foreach (var roleId in moduleAction.Posted_Roles.Role_IDs)
                    {
                        var roleIdValue = int.Parse(roleId);
                        roleIds.Add(roleIdValue);
                    }
                }
                moduleActionModel.AddModuleActionToRole(updatedModuleAction.Module_Action_Id, roleIds);

                return(RedirectToAction("Index", "ModuleAction"));
            }

            return(View(moduleAction));
        }
Esempio n. 2
0
        public ActionResult Create()
        {
            var newModuleAction = new Module_Action();

            return(View(newModuleAction));
        }
Esempio n. 3
0
    public void AddModule(RectTransform container, Module_Action action)
    {
        RectTransform AddedAction = Instantiate(Action, container);

        AddedAction.GetComponent <UI_ModuleAction>().SetModuleData(action.Icon, action.Name, action.Action);
    }