Exemple #1
0
        public ActionResult Body()
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Data.Model.RoleApp  roleApp     = null;
            string id = Request.QueryString["id"];

            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;

            Guid appID;

            if (id.IsGuid(out appID))
            {
                roleApp = broleApp.Get(appID);
                if (roleApp != null)
                {
                    name    = roleApp.Title;
                    type    = roleApp.AppID.HasValue ? bappLibrary.GetTypeByID(roleApp.AppID.Value) : "";
                    appid   = roleApp.AppID.ToString();
                    params1 = roleApp.Params;
                    ico     = roleApp.Ico;
                }
            }
            if (roleApp == null)
            {
                roleApp = new MyCreek.Data.Model.RoleApp();
            }
            ViewBag.AppID           = appid;
            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type);
            return(View(roleApp));
        }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     appLibraryTypes = bappLibrary.GetTypeOptions();
     stepID          = Request.QueryString["id"];
     stepX           = Request.QueryString["x"];
     stepY           = Request.QueryString["y"];
     stepWidth       = Request.QueryString["width"];
     stepHeight      = Request.QueryString["height"];
 }
Exemple #3
0
        public ActionResult AddApp(FormCollection collection)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.UsersApp   busersApp   = new MyCreek.Platform.UsersApp();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Data.Model.UsersApp usersApp    = null;

            string id     = Request.QueryString["id"];
            string userID = Request.QueryString["userid"];
            string roleID = Request.QueryString["roleid"];

            if (collection != null && id.IsGuid() && userID.IsGuid())
            {
                usersApp = busersApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    MyCreek.Data.Model.UsersApp usersApp1 = new MyCreek.Data.Model.UsersApp();

                    usersApp1.ID       = Guid.NewGuid();
                    usersApp1.ParentID = id.ToGuid();
                    usersApp1.Title    = name.Trim();
                    usersApp1.Sort     = broleApp.GetMaxSort(id.ToGuid());
                    usersApp1.UserID   = userID.ToGuid();
                    usersApp1.RoleID   = roleID.IsGuid() ? roleID.ToGuid() : Guid.Empty;
                    if (appid.IsGuid())
                    {
                        usersApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp1.AppID = null;
                    }
                    usersApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp1.Ico = ico;
                    }

                    busersApp.Add(usersApp1);
                    busersApp.ClearCache();
                    MyCreek.Platform.Log.Add("添加了个人应用", busersApp.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    ViewBag.Script = "alert('添加成功!'); parent.frames[0].reLoad('" + refreshID + "')";
                }
            }

            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions();
            return(View());
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.UsersApp   busersApp   = new MyCreek.Platform.UsersApp();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Data.Model.UsersApp usersApp    = null;

            string id     = Request.QueryString["id"];
            string userID = Request.QueryString["userid"];
            string roleID = Request.QueryString["roleid"];

            if (IsPostBack && id.IsGuid() && userID.IsGuid())
            {
                usersApp = busersApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    MyCreek.Data.Model.UsersApp usersApp1 = new MyCreek.Data.Model.UsersApp();

                    usersApp1.ID       = Guid.NewGuid();
                    usersApp1.ParentID = id.ToGuid();
                    usersApp1.Title    = name.Trim();
                    usersApp1.Sort     = broleApp.GetMaxSort(id.ToGuid());
                    usersApp1.UserID   = userID.ToGuid();
                    usersApp1.RoleID   = roleID.IsGuid() ? roleID.ToGuid() : Guid.Empty;
                    if (appid.IsGuid())
                    {
                        usersApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp1.AppID = null;
                    }
                    usersApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp1.Ico = ico;
                    }

                    busersApp.Add(usersApp1);
                    busersApp.ClearCache();
                    MyCreek.Platform.Log.Add("添加了个人应用", busersApp.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功!'); parent.frames[0].reLoad('" + refreshID + "')", true);
                }
            }

            AppTypesOptions = bappLibrary.GetTypeOptions();
        }
Exemple #5
0
        public ActionResult AddApp(FormCollection collection)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Data.Model.RoleApp  roleApp     = null;

            string id = Request.QueryString["id"];

            if (collection != null)
            {
                roleApp = broleApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    MyCreek.Data.Model.RoleApp roleApp1 = new MyCreek.Data.Model.RoleApp();

                    roleApp1.ID       = Guid.NewGuid();
                    roleApp1.ParentID = id.ToGuid();
                    roleApp1.RoleID   = roleApp.RoleID;
                    roleApp1.Title    = name.Trim();
                    roleApp1.ParentID = roleApp.ID;
                    roleApp1.Sort     = broleApp.GetMaxSort(roleApp.ID);
                    roleApp1.Type     = 0;
                    if (appid.IsGuid())
                    {
                        roleApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        roleApp1.AppID = null;
                    }
                    roleApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        roleApp1.Ico = ico;
                    }

                    broleApp.Add(roleApp1);
                    broleApp.ClearAllDataTableCache();
                    MyCreek.Platform.Log.Add("添加了应用模板", roleApp1.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    ViewBag.Script = "alert('添加成功');parent.frames[0].reLoad('" + refreshID + "');";
                }
            }

            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions();
            return(View());
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Data.Model.RoleApp  roleApp     = null;

            string id = Request.QueryString["id"];

            if (IsPostBack)
            {
                roleApp = broleApp.Get(id.ToGuid());
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    string name    = Request.Form["Name"];
                    string type    = Request.Form["Type"];
                    string appid   = Request.Form["AppID"];
                    string params1 = Request.Form["Params"];
                    string ico     = Request.Form["Ico"];

                    MyCreek.Data.Model.RoleApp roleApp1 = new MyCreek.Data.Model.RoleApp();

                    roleApp1.ID       = Guid.NewGuid();
                    roleApp1.ParentID = id.ToGuid();
                    roleApp1.RoleID   = roleApp.RoleID;
                    roleApp1.Title    = name.Trim();
                    roleApp1.ParentID = roleApp.ID;
                    roleApp1.Sort     = broleApp.GetMaxSort(roleApp.ID);
                    roleApp1.Type     = 0;
                    if (appid.IsGuid())
                    {
                        roleApp1.AppID = appid.ToGuid();
                    }
                    else
                    {
                        roleApp1.AppID = null;
                    }
                    roleApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        roleApp1.Ico = ico;
                    }

                    broleApp.Add(roleApp1);
                    broleApp.ClearAllDataTableCache();
                    MyCreek.Platform.Log.Add("添加了应用模板", roleApp1.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = id;
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功');parent.frames[0].reLoad('" + refreshID + "');", true);
                }
            }
            this.AppTypesOptions.Text = bappLibrary.GetTypeOptions();
        }
Exemple #7
0
        public ActionResult Body1(FormCollection collection)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Platform.UsersApp   buserApp    = new MyCreek.Platform.UsersApp();
            MyCreek.Data.Model.UsersApp usersApp    = null;

            string id = Request.QueryString["id"];

            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;

            Guid appID;

            if (id.IsGuid(out appID))
            {
                usersApp = buserApp.Get(appID);
                if (usersApp != null)
                {
                    name    = usersApp.Title;
                    type    = usersApp.AppID.HasValue ? bappLibrary.GetTypeByID(usersApp.AppID.Value) : "";
                    appid   = usersApp.AppID.ToString();
                    params1 = usersApp.Params;
                    ico     = usersApp.Ico;
                }
            }


            if (collection != null && usersApp != null)
            {
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    name    = Request.Form["Name"];
                    type    = Request.Form["Type"];
                    appid   = Request.Form["AppID"];
                    params1 = Request.Form["Params"];
                    ico     = Request.Form["Ico"];

                    string oldXML = usersApp.Serialize();
                    usersApp.Title = name.Trim();
                    if (appid.IsGuid())
                    {
                        usersApp.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp.AppID = null;
                    }
                    usersApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp.Ico = ico;
                    }
                    else
                    {
                        usersApp.Ico = null;
                    }

                    buserApp.Update(usersApp);
                    buserApp.ClearCache();
                    MyCreek.Platform.Log.Add("修改了个人应用", "", MyCreek.Platform.Log.Types.角色应用, oldXML, usersApp.Serialize());
                    string refreshID = usersApp.ParentID.ToString();
                    ViewBag.Script = "alert('保存成功!'); parent.frames[0].reLoad('" + refreshID + "')";
                }

                if (!Request.Form["Delete"].IsNullOrEmpty())
                {
                    int i = buserApp.DeleteAndAllChilds(usersApp.ID);
                    buserApp.ClearCache();
                    MyCreek.Platform.Log.Add("删除了个人应用", usersApp.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = usersApp.ParentID.ToString();
                    var    parent    = buserApp.Get(usersApp.ParentID);
                    string page      = parent == null ? "Body" : "Body1";
                    ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');window.location='" + page + "?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "&userid=" + Request.QueryString["userid"] + "';";
                }
            }
            ViewBag.AppID           = appid;
            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type);
            return(View(usersApp == null ? new MyCreek.Data.Model.UsersApp() : usersApp));
        }
Exemple #8
0
        public ActionResult Body(FormCollection collection)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Data.Model.RoleApp  roleApp     = null;
            string id      = Request.QueryString["id"];
            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;
            Guid   appID;

            if (id.IsGuid(out appID))
            {
                roleApp = broleApp.Get(appID);
            }

            if (!Request.Form["Save"].IsNullOrEmpty())
            {
                name    = Request.Form["Name"];
                type    = Request.Form["Type"];
                appid   = Request.Form["AppID"];
                params1 = Request.Form["Params"];
                ico     = Request.Form["Ico"];

                string oldXML = roleApp.Serialize();
                roleApp.Title = name.Trim();
                if (appid.IsGuid())
                {
                    roleApp.AppID = appid.ToGuid();
                }
                else
                {
                    roleApp.AppID = null;
                }
                roleApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                if (!ico.IsNullOrEmpty())
                {
                    roleApp.Ico = ico;
                }
                else
                {
                    roleApp.Ico = null;
                }

                broleApp.Update(roleApp);
                broleApp.ClearAllDataTableCache();
                MyCreek.Platform.Log.Add("修改了应用模板", "", MyCreek.Platform.Log.Types.角色应用, oldXML, roleApp.Serialize());
                string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');alert('保存成功!');";
            }

            if (!Request.Form["Delete"].IsNullOrEmpty())
            {
                int i = broleApp.DeleteAndAllChilds(roleApp.ID);
                broleApp.ClearAllDataTableCache();
                MyCreek.Platform.Log.Add("删除了模板及其所有下级共" + i.ToString() + "项", roleApp.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');window.location='Body?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "';";
            }
            if (roleApp != null && roleApp.AppID.HasValue)
            {
                var app = new MyCreek.Platform.AppLibrary().Get(roleApp.AppID.Value);
                if (app != null)
                {
                    type = app.Type.ToString();
                }
            }
            ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type);
            ViewBag.AppID           = roleApp.AppID.ToString();
            return(View(roleApp));
        }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();

            string id      = Request.QueryString["id"];
            string name    = string.Empty;
            string type    = string.Empty;
            string appid   = string.Empty;
            string params1 = string.Empty;
            string ico     = string.Empty;
            Guid   appID;

            if (id.IsGuid(out appID))
            {
                roleApp = broleApp.Get(appID);
            }

            if (IsPostBack)
            {
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    name    = Request.Form["Name"];
                    type    = Request.Form["Type"];
                    appid   = Request.Form["AppID"];
                    params1 = Request.Form["Params"];
                    ico     = Request.Form["Ico"];

                    string oldXML = roleApp.Serialize();
                    roleApp.Title = name.Trim();
                    if (appid.IsGuid())
                    {
                        roleApp.AppID = appid.ToGuid();
                    }
                    else
                    {
                        roleApp.AppID = null;
                    }
                    roleApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        roleApp.Ico = ico;
                    }
                    else
                    {
                        roleApp.Ico = null;
                    }

                    broleApp.Update(roleApp);
                    broleApp.ClearAllDataTableCache();
                    MyCreek.Platform.Log.Add("修改了应用模板", "", MyCreek.Platform.Log.Types.角色应用, oldXML, roleApp.Serialize());
                    string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');alert('保存成功!');", true);
                }

                if (!Request.Form["Delete"].IsNullOrEmpty())
                {
                    int i = broleApp.DeleteAndAllChilds(roleApp.ID);
                    broleApp.ClearAllDataTableCache();
                    MyCreek.Platform.Log.Add("删除了模板及其所有下级共" + i.ToString() + "项", roleApp.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');window.location='Body.aspx?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "';", true);
                }
            }
            if (roleApp != null && roleApp.AppID.HasValue)
            {
                var app = new MyCreek.Platform.AppLibrary().Get(roleApp.AppID.Value);
                if (app != null)
                {
                    type = app.Type.ToString();
                }
            }
            if (roleApp != null)
            {
                this.Name.Value   = roleApp.Title;
                this.Params.Value = roleApp.Params;
                this.Ico.Value    = roleApp.Ico;
            }
            this.AppTypesOptions.Text = bappLibrary.GetTypeOptions(type);
            AppID = roleApp.AppID.ToString();
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            query = "&id=" + Request.QueryString["id"] + "&appid=" + Request.QueryString["appid"] + "&roleid=" + Request.QueryString["roleid"] + "&userid=" + Request.QueryString["userid"];
            MyCreek.Platform.AppLibrary bappLibrary = new MyCreek.Platform.AppLibrary();
            MyCreek.Platform.RoleApp    broleApp    = new MyCreek.Platform.RoleApp();
            MyCreek.Platform.UsersApp   buserApp    = new MyCreek.Platform.UsersApp();
            MyCreek.Data.Model.UsersApp usersApp    = null;

            string id = Request.QueryString["id"];

            Guid appID;

            if (id.IsGuid(out appID))
            {
                usersApp = buserApp.Get(appID);
                if (usersApp != null)
                {
                    name     = usersApp.Title;
                    type     = usersApp.AppID.HasValue ? bappLibrary.GetTypeByID(usersApp.AppID.Value) : "";
                    appid    = usersApp.AppID.ToString();
                    params1  = usersApp.Params;
                    ico      = usersApp.Ico;
                    ParentID = usersApp.ParentID;
                }
            }


            if (IsPostBack && usersApp != null)
            {
                if (!Request.Form["Save"].IsNullOrEmpty())
                {
                    name    = Request.Form["Name"];
                    type    = Request.Form["Type"];
                    appid   = Request.Form["AppID"];
                    params1 = Request.Form["Params"];
                    ico     = Request.Form["Ico"];

                    string oldXML = usersApp.Serialize();
                    usersApp.Title = name.Trim();
                    if (appid.IsGuid())
                    {
                        usersApp.AppID = appid.ToGuid();
                    }
                    else
                    {
                        usersApp.AppID = null;
                    }
                    usersApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
                    if (!ico.IsNullOrEmpty())
                    {
                        usersApp.Ico = ico;
                    }
                    else
                    {
                        usersApp.Ico = null;
                    }

                    buserApp.Update(usersApp);
                    buserApp.ClearCache();
                    MyCreek.Platform.Log.Add("修改了个人应用", "", MyCreek.Platform.Log.Types.角色应用, oldXML, usersApp.Serialize());
                    string refreshID = usersApp.ParentID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!'); parent.frames[0].reLoad('" + refreshID + "')", true);
                }

                if (!Request.Form["Delete"].IsNullOrEmpty())
                {
                    int i = buserApp.DeleteAndAllChilds(usersApp.ID);
                    buserApp.ClearCache();
                    MyCreek.Platform.Log.Add("删除了个人应用", usersApp.Serialize(), MyCreek.Platform.Log.Types.角色应用);
                    string refreshID = usersApp.ParentID.ToString();
                    var    parent    = buserApp.Get(usersApp.ParentID);
                    string page      = parent == null ? "Body.aspx" : "Body1.aspx";
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');window.location='" + page + "?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "&userid=" + Request.QueryString["userid"] + "';", true);
                }
            }
            AppID           = appid;
            AppTypesOptions = bappLibrary.GetTypeOptions(type);
        }