Ejemplo n.º 1
0
        public static ReturnObject Delete(HttpContext context, long id)
        {
            if (id <= 0)
                return new ReturnObject() { Error = true, Message = "Invalid Group." };

            var item = new Framework.Security.Group(id);
            item.Delete();

            return new ReturnObject()
            {
                Growl = new ReturnGrowlObject()
                {
                    Type = "default",
                    Vars = new ReturnGrowlVarsObject()
                    {
                        text = "You have successfully deleted a group.",
                        title = "Group Deleted"
                    }
                },
                Actions = new List<ReturnActionObject>()
                {
                    new ReturnActionObject() {
                        Ele = "#groups-table tr[data-id=\""+id.ToString()+"\"]",
                        Type = "remove"
                    }
                }
            };
        }
Ejemplo n.º 2
0
        public static ReturnObject Edit(HttpContext context, long id, string name, string display_name)
        {
            Framework.Security.Group item = null;
            if (id > 0)
                item = new Framework.Security.Group(id);
            else
                item = new Framework.Security.Group();

            item.Name = name;
            item.DisplayName = display_name;
            item.Save();

            return new ReturnObject() {
                Result = item,
                Redirect = new ReturnRedirectObject() {
                    Hash = "admin/security/groups/list"
                },
                Growl = new ReturnGrowlObject() {
                    Type = "default",
                    Vars = new ReturnGrowlVarsObject() {
                        text = "You have successfully saved this group.",
                        title = "Group Saved"
                    }
                }
            };
        }
Ejemplo n.º 3
0
 protected void Page_Init(object sender, EventArgs e)
 {
     string strID = Request.QueryString["id"];
     long id;
     if (string.IsNullOrEmpty(strID) || !long.TryParse(strID, out id))
         item = new Framework.Security.Group();
     else
         item = new Framework.Security.Group(id);
 }