Exemplo n.º 1
0
        public bool UpdateModule(Module module)
        {
            string sql = "update Module set Name='" + module.Name + "', FormName='" + module.FormName + "', ControlName='" + module.ControlName + "', Remark='" + module.Remark + "' where ID=" + module.ID;
            int    r   = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }
Exemplo n.º 2
0
        public bool UpdateRole(Role role)
        {
            string sql = "update [Role] set Name='" + role.Name + "', Permissions='" + Common.GetPermissionsStr(role.Permissions) + "', Flag=" + (role.Flag ? "1" : "0") + ", Remark='" + role.Remark + "' where ID=" + role.ID;
            int    r   = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }
Exemplo n.º 3
0
        public bool UpdateUserGroup(UserGroup ug)
        {
            string sql = "update UserGroup set Name='" + ug.Name + "', Remark='" + ug.Remark + "' where ID=" + ug.ID;
            int    r   = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }
Exemplo n.º 4
0
        public bool UpdateAction(Action action)
        {
            string sql = "update [Action] set Name='" + action.Name + "', FormName='" + action.FormName + "', ControlName='" + action.ControlName + "', Remark='" + action.Remark + "' where ID=" + action.ID;
            int    r   = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }
Exemplo n.º 5
0
        public bool UpdateUser(User user)
        {
            string sql = "update [User] set Username='******',Password='******', Depart='" + Common.GetDepartmentsStr(user.Departments) + "', Flag=" + user.Flag + ", Remark='" + user.Remark + "' where ID=" + user.ID;
            int    r   = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }
Exemplo n.º 6
0
        public bool UpdateDepartment(Department dep)
        {
            //string parent = "0";
            //if (dep.Parent != null)
            //    parent = dep.Parent.ID.ToString();
            string sql = "update Depart set Name='" + dep.Name + "', Manager='" + dep.Manager + "', Parent=" + dep.ParentID + ", Remark='" + dep.Remark + "' where ID=" + dep.ID;
            int    r   = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }
Exemplo n.º 7
0
        public bool UpdatePermission(Permission perm)
        {
            string sql = "";

            if (perm.TheAction != null)
            {
                sql = "update Permission set Name='" + perm.Name + "', IsExcept=" + (perm.IsExcept ? "1" : "0") + ", TheModule=" + perm.TheModule.ID + ", TheAction=" + perm.TheAction.ID + ", Remark='" + perm.Remark + "' where ID=" + perm.ID;
            }
            else
            {
                sql = "update Permission set Name='" + perm.Name + "', IsExcept=" + (perm.IsExcept ? "1" : "0") + ", TheModule=" + perm.TheModule.ID + ", TheAction=0, Remark='" + perm.Remark + "' where ID=" + perm.ID;
            }
            int r = sqlHelper.ExecuteSql(sql);

            return(r > 0);
        }