Exemple #1
0
        public ActionResult Permission(int id)
        {
            //Session["fullname"] = HttpContext.Session["FullName"];
            ViewData["group_id"]    = id;
            ViewData["functions"]   = Areas.API.Models.Permission.getAllFunction();
            ViewData["permissions"] = Areas.API.Models.Permission.getAll(id);
            var lstPage = PageRes.Page_GetAll();

            if (User.IsInRole("subpergroup_view") == false)
            {
                lstPage = lstPage.Where(p => p.alias != "subpergroup").ToList();
            }
            ViewData["page"] = lstPage;
            return(View());
        }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();

            CurrentPageAuth         = new PageAuth();
            CurrentPageMenu         = new PageMenu();
            CurrentPageResults      = new PageResults();
            CurrentPagePrescription = new PagePrescription();
            CurrentPageRedactor     = new PageRedactor();
            CurrentPageTest         = new PageTest();
            CurrentPageTestsList    = new PageTestsList();
            CurrentPageRes          = new PageRes();

            CurrentBackButton = BackButton;
            CurrentLabelName  = LabelName;
            CurrentFrame      = MainFrame;

            MainFrame.Navigate(CurrentPageAuth);
        }
        public ActionResult UpdatePage(IFormCollection form)
        {
            int    id             = Int32.Parse(form["id"].ToString());
            string name           = form["name"].ToString();
            string alias          = form["alias"].ToString();
            int    permission     = Convert.ToInt32(form["permission"].ToString());
            string note           = WebUtility.HtmlDecode(form["note"].ToString());
            string description_fn = WebUtility.HtmlDecode(form["description_fn"].ToString());
            string email          = HttpContext.User.Claims.Where(c => c.Type == System.Security.Claims.ClaimsIdentity.DefaultNameClaimType).FirstOrDefault().Value;

            object[] value        = { id, name, alias, permission, note, email, description_fn };
            var      errorCode    = 0;
            var      errorMessage = "";

            string[] output = { };
            var      result = PageRes.Save(value, ref output, ref errorCode, ref errorMessage);

            return(Json(result));
        }