public virtual object RelationshipAppGetRelatited(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    fileid  = request.GetString("fileid");
            BPMObjectNameCollection spriteids   = JArray.Parse(request.GetString("spriteids")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection tagfiletype = JArray.Parse(request.GetString("tagfiletype")).ToObject <BPMObjectNameCollection>();
            JArray rv = new JArray();

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    File file = File.Load(provider, cn, fileid);

                    this.AddReference(provider, cn, file, null, file.Property.Owner, tagfiletype, rv);
                    foreach (Sprite sprite in file.Sprites.SortByOrder())
                    {
                        if (spriteids.Count != 0 && !spriteids.Contains(sprite.Id))
                        {
                            continue;
                        }

                        this.AddReference(provider, cn, file, sprite, sprite.AllReferences, tagfiletype, rv);
                    }

                    return(rv);
                }
            }
        }
Exemple #2
0
        public UserCollection GetUnSignedUsers(BPMConnection cn, BPMObjectNameCollection accounts)
        {
            BPMObjectNameCollection accountsUnSigned = new BPMObjectNameCollection();

            accountsUnSigned.AddRange(accounts);

            foreach (Footmark footmark in this)
            {
                if (accountsUnSigned.Contains(footmark.Account))
                {
                    accountsUnSigned.Remove(footmark.Account);
                }
            }

            UserCollection users = new UserCollection();

            foreach (string account in accountsUnSigned)
            {
                if (users.Contains(account))
                {
                    continue;
                }

                User user = User.TryGetUser(cn, account);
                if (user != null)
                {
                    users.Add(user);
                }
            }

            return(users);
        }
        protected virtual void AddReference(IYZDbProvider provider, IDbConnection cn, File file, Sprite sprite, ReferenceCollection refs, BPMObjectNameCollection tagfiletype, JArray rv)
        {
            foreach (Reference @ref in refs)
            {
                AttachmentInfo tagAttachment = AttachmentManager.TryGetAttachmentInfo(provider, cn, @ref.FileID);
                if (tagAttachment == null)
                {
                    continue;
                }

                if (tagfiletype.Count != 0 && !tagfiletype.Contains(tagAttachment.Ext))
                {
                    continue;
                }

                File tagFile = File.TryLoad(provider, cn, @ref.FileID);
                if (tagFile == null)
                {
                    continue;
                }

                Sprite tagSprite = tagFile.Sprites.TryGetItem(@ref.SpriteID);

                JObject item = new JObject();
                rv.Add(item);
                item["FileID"]             = file.FileID;
                item["FileName"]           = file.FileName;
                item["SpriteName"]         = SpriteIdentity.ConvertSpriteName(sprite == null ? "" : sprite.Name);
                item["RelatiedFileID"]     = tagFile.FileID;
                item["RelatiedFileName"]   = tagFile.FileName;
                item["RelatiedSpriteName"] = SpriteIdentity.ConvertSpriteName(tagSprite == null ? "" : tagSprite.Name);
            }
        }
Exemple #4
0
        //日志
        public IDataReader GetAppLog(IDbConnection cn, BPMObjectNameCollection sids, DateTime date, string filter, string sort, int startRowIndex, int rows)
        {
            date = new DateTime(date.Year, date.Month, date.Day, 0, 0, 0);

            //Command
            using (OracleCommand cmd = new OracleCommand())
            {
                cmd.Connection = cn as OracleConnection;
                cmd.BindByName = true;

                //获得查询条件
                filter = this.CombinCond("EXTDATE=:EXTDATE", filter);
                cmd.Parameters.Add(":EXTDATE", OracleDbType.Date).Value = date;

                if (!sids.Contains(WellKnownSID.Administrators))
                {
                    string sidfilter = String.Format("ObjectID IN(SELECT ObjectID FROM BPMSysAppLogACL WITH(INDEX(YZIX_BPMSysAppLogACL_ExtDate)) WHERE ExtDate=:ExtDate AND SID IN({0}))", this.GetDbInList(sids));
                    filter = this.CombinCond(filter, sidfilter);
                }

                if (!String.IsNullOrEmpty(filter))
                {
                    filter = " WHERE " + filter;
                }

                //排序
                if (String.IsNullOrEmpty(sort))
                {
                    sort = "LOGDATE DESC";
                }

                this.GeneratePageCommand(cmd, "SELECT * FROM BPMSYSAPPLOG" + filter, sort, startRowIndex, rows);
                return(cmd.ExecuteReader());
            }
        }
Exemple #5
0
        public static OSFileInfoCollection GetFiles(string folderPath, BPMObjectNameCollection excludes)
        {
            DirectoryInfo folder = new DirectoryInfo(folderPath);

            FileInfo[] files = folder.GetFiles("*.*");

            OSFileInfoCollection rv = new OSFileInfoCollection();

            foreach (FileInfo fileInfo in files)
            {
                if ((fileInfo.Attributes & FileAttributes.Directory) == 0 &&
                    (fileInfo.Attributes & FileAttributes.System) == 0 &&
                    (fileInfo.Attributes & FileAttributes.Hidden) == 0)
                {
                    if (NameCompare.Equals(fileInfo.Extension, ".extension"))
                    {
                        continue;
                    }

                    if (excludes.Contains(fileInfo.Extension))
                    {
                        continue;
                    }

                    rv.Add(new OSFileInfo(fileInfo));
                }
            }

            rv.Sort();
            return(rv);
        }
Exemple #6
0
        public virtual object GetTeamReports(HttpContext context)
        {
            YZRequest request   = new YZRequest(context);
            string    myaccount = request.GetString("account", YZAuthHelper.LoginUserAccount);
            DateTime  date      = request.GetDateTime("date");

            BPMObjectNameCollection accounts = new BPMObjectNameCollection();

            accounts.Add(myaccount);

            using (BPMConnection bpmcn = new BPMConnection())
            {
                bpmcn.WebOpen();

                MemberCollection positions = OrgSvr.GetUserPositions(bpmcn, myaccount);
                foreach (Member position in positions)
                {
                    DirectXSCollection xss = position.GetDirectXSs(bpmcn);
                    foreach (DirectXS xs in xss)
                    {
                        if (!accounts.Contains(xs.UserAccount))
                        {
                            accounts.Add(xs.UserAccount);
                        }
                    }
                }

                DailyReportCollection rv = new DailyReportCollection();
                foreach (string account in accounts)
                {
                    DailyReport dailyReport;

                    using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
                    {
                        using (IDbConnection cn = provider.OpenConnection())
                        {
                            dailyReport = DailyReportManager.TryGetReport(provider, cn, account, date);

                            if (dailyReport == null)
                            {
                                dailyReport         = new DailyReport();
                                dailyReport.Account = account;
                                dailyReport.Date    = date;
                            }

                            rv.Add(dailyReport);
                        }
                    }

                    User user = User.TryGetUser(bpmcn, account);
                    dailyReport["ShortName"] = user == null ? "" : user.ShortName;
                }

                return(rv);
            }
        }
Exemple #7
0
        public virtual object RelationshipAppGetNonRelatited(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    fileid  = request.GetString("fileid");
            BPMObjectNameCollection  spriteids   = JArray.Parse(request.GetString("spriteids")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection  tagfiletype = JArray.Parse(request.GetString("tagfiletype")).ToObject <BPMObjectNameCollection>();
            SpriteIdentityCollection rv          = new SpriteIdentityCollection();

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    File file = File.Load(provider, cn, fileid);

                    foreach (Sprite sprite in file.Sprites.SortByOrder())
                    {
                        if (spriteids.Count != 0 && !spriteids.Contains(sprite.Id))
                        {
                            continue;
                        }

                        if (tagfiletype.Count == 0)
                        {
                            if (sprite.AllReferences.Count != 0)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            bool find = false;
                            foreach (Reference @ref in sprite.AllReferences)
                            {
                                AttachmentInfo tagAttachment = AttachmentManager.TryGetAttachmentInfo(provider, cn, @ref.FileID);
                                if (tagAttachment != null && tagfiletype.Contains(tagAttachment.Ext))
                                {
                                    find = true;
                                    break;
                                }
                            }

                            if (find)
                            {
                                continue;
                            }
                        }

                        rv.Add(new SpriteIdentity(sprite));
                    }

                    return(rv);
                }
            }
        }
Exemple #8
0
 public IEnumerable <Client> GetClientsFromUIDs(BPMObjectNameCollection uids, string channel, bool broadcast)
 {
     this.AcquireReaderLock();
     try
     {
         return(Clients.Where(client => (broadcast || uids.Contains(client.UID)) && client.IsSubscribedTo(channel)).ToList());
     }
     finally
     {
         this.ReleaseLock();
     }
 }
Exemple #9
0
        public virtual JObject GetResourcePerms(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    rsid    = request.GetString("rsid");
            JObject   rv      = new JObject();

            //获得数据
            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                UserResource userResource = UserResource.Open(cn, rsid);
                rv["ResourceName"] = userResource.ResourceName;

                UserResourcePermisionCollection perms = UserResource.GetPermisions(cn, rsid);
                URACL acl = UserResource.GetACL(cn, rsid);

                JArray jperms = new JArray();
                rv["perms"] = jperms;
                foreach (UserResourcePermision perm in perms)
                {
                    JObject jperm = JObject.FromObject(perm);
                    jperms.Add(jperm);
                    JArray jRoles = new JArray();
                    jperm["roles"] = jRoles;
                    BPMObjectNameCollection checkedSids = new BPMObjectNameCollection();

                    foreach (URACE ace in acl.ACEs)
                    {
                        if (checkedSids.Contains(ace.SID))
                        {
                            continue;
                        }

                        checkedSids.Add(ace.SID);

                        SecurityToken token = new SecurityToken();
                        token.SIDs.Add(ace.SID);
                        if (acl.HasPermision(token, perm.PermName))
                        {
                            JObject jRole = new JObject();
                            jRoles.Add(jRole);

                            jRole["Name"] = ace.GetSIDDisplayName(cn);
                        }
                    }
                }
            }

            return(rv);
        }
        public virtual object RelationshipAppGetUsedBy(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    fileid  = request.GetString("fileid");
            BPMObjectNameCollection spriteids   = JArray.Parse(request.GetString("spriteids")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection tagfiletype = JArray.Parse(request.GetString("tagfiletype")).ToObject <BPMObjectNameCollection>();
            JArray rv = new JArray();

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    File file = File.Load(provider, cn, fileid);
                    SpriteLinkCollection links = BPAManager.GetFileUsedByLinks(provider, cn, fileid, null);

                    foreach (SpriteLink link in links)
                    {
                        if (!String.IsNullOrEmpty(link.LinkedSpriteID) && spriteids.Count != 0 && !spriteids.Contains(link.LinkedSpriteID))
                        {
                            continue;
                        }

                        File usedbyFile = File.TryLoad(provider, cn, link.FileID);
                        if (usedbyFile == null)
                        {
                            continue;
                        }

                        AttachmentInfo usedByAttachment = AttachmentManager.GetAttachmentInfo(provider, cn, usedbyFile.FileID);
                        if (tagfiletype.Count != 0 && !tagfiletype.Contains(usedByAttachment.Ext))
                        {
                            continue;
                        }

                        Sprite usedbySprite = usedbyFile.Sprites.TryGetItem(link.SpriteID);
                        Sprite sprite       = file.Sprites.TryGetItem(link.LinkedSpriteID);

                        JObject item = new JObject();
                        rv.Add(item);
                        item["FileID"]             = file.FileID;
                        item["FileName"]           = file.FileName;
                        item["SpriteName"]         = SpriteIdentity.ConvertSpriteName(sprite == null ? "" : sprite.Name);
                        item["RelatiedFileID"]     = usedbyFile.FileID;
                        item["RelatiedFileName"]   = usedbyFile.FileName;
                        item["RelatiedSpriteName"] = SpriteIdentity.ConvertSpriteName(usedbySprite == null ? "" : usedbySprite.Name);
                    }

                    return(rv);
                }
            }
        }
Exemple #11
0
        public virtual JObject GetReActiveSteps(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            int       taskid  = request.GetInt32("TaskID");

            JArray children = new JArray();

            //获得数据
            BPMStepCollection steps = null;

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                steps = BPMTask.GetAllSteps(cn, taskid);

                BPMObjectNameCollection stepNames = new BPMObjectNameCollection();
                for (int i = steps.Count - 1; i >= 0; i--)
                {
                    BPMProcStep step = steps[i];

                    if (!step.IsHumanStep)
                    {
                        continue;
                    }

                    if (step.IsTaskOptStep || step.IsIndicateStep || step.IsInformStep || step.IsConsignStep)
                    {
                        continue;
                    }

                    if (stepNames.Contains(step.NodeName))
                    {
                        continue;
                    }

                    stepNames.Add(step.NodeName);
                    children.Add(Serialize(cn, step));
                }
            }

            //输出数据
            JObject rv = new JObject();

            rv[YZJsonProperty.success]  = true;
            rv[YZJsonProperty.total]    = children.Count;
            rv[YZJsonProperty.children] = children;
            return(rv);
        }
Exemple #12
0
        public virtual JObject GetUserDataESB(BPMConnection cn, JObject request)
        {
            string esbObjectName         = (string)request["ESB"];
            YZDSFilterCollection filters = request["Filter"] != null ? request["Filter"].ToObject <YZDSFilterCollection>() : null;

            //获取参数
            string[]                strs       = esbObjectName.Split(':');
            SourceTypeEnum          sourceType = (SourceTypeEnum)Enum.Parse(typeof(SourceTypeEnum), strs[0]);
            SourceInfo              sourceInfo = SourceInfoManager.GetSourceInfo(sourceType, strs[1]);
            SourceVisit             visit      = new SourceVisit(sourceInfo);
            BPMObjectNameCollection names      = new BPMObjectNameCollection();
            List <ColumnInfo>       values     = new List <ColumnInfo>();

            if (filters != null)
            {
                foreach (KeyValuePair <string, YZDSFilter> filter in filters)
                {
                    names.Add(filter.Key);
                    values.Add(new ColumnInfo()
                    {
                        columnName   = filter.Key,
                        defaultValue = filter.Value.value
                    });
                }

                foreach (ColumnInfo column in visit.GetParameter())
                {
                    if (!names.Contains(column.rename))
                    {
                        names.Add(column.rename);
                        values.Add(new ColumnInfo()
                        {
                            columnName   = column.rename,
                            defaultValue = column.defaultValue
                        });
                    }
                }
            }
            DataTable     dt    = visit.GetResult(values);
            FlowDataTable table = new FlowDataTable(dt);

            return(this.ToResult(table, false));
        }
Exemple #13
0
        public virtual DataTable GetESBDataNoPaged(HttpContext context)
        {
            YZRequest            request       = new YZRequest(context);
            string               esbObjectName = request.GetString("ESB");
            YZDSFilterCollection filters       = JObject.Parse(request.GetString("Filter", "{}")).ToObject <YZDSFilterCollection>();

            //获取参数
            string[]                strs       = esbObjectName.Split(':');
            SourceTypeEnum          sourceType = (SourceTypeEnum)Enum.Parse(typeof(SourceTypeEnum), strs[0]);
            SourceInfo              sourceInfo = SourceInfoManager.GetSourceInfo(sourceType, strs[1]);
            SourceVisit             visit      = new SourceVisit(sourceInfo);
            BPMObjectNameCollection names      = new BPMObjectNameCollection();
            List <ColumnInfo>       values     = new List <ColumnInfo>();

            if (filters != null)
            {
                foreach (KeyValuePair <string, YZDSFilter> filter in filters)
                {
                    names.Add(filter.Key);
                    values.Add(new ColumnInfo()
                    {
                        columnName   = filter.Key,
                        defaultValue = filter.Value.value
                    });
                }

                foreach (ColumnInfo column in visit.GetParameter())
                {
                    if (!names.Contains(column.rename))
                    {
                        names.Add(column.rename);
                        values.Add(new ColumnInfo()
                        {
                            columnName   = column.rename,
                            defaultValue = column.defaultValue
                        });
                    }
                }
            }

            return(visit.GetResult(values));
        }
Exemple #14
0
        public virtual object GetMasterData(HttpContext context)
        {
            YZRequest request              = new YZRequest(context);
            string    tableName            = request.GetString("tableName");
            string    orderby              = request.GetString("orderby", null);
            JObject   jPost                = request.GetPostData <JObject>();
            BPMObjectNameCollection fields = jPost["fields"].ToObject <BPMObjectNameCollection>();

            fields.Unique();

            if (MDMTableNames != null)
            {
                if (!MDMTableNames.Contains(tableName))
                {
                    throw new Exception(String.Format(Resources.YZMobile.Aspx_MDM_TableAccessDenied, tableName));
                }
            }

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    using (IDbCommand cmd = cn.CreateCommand())
                    {
                        if (!String.IsNullOrEmpty(orderby))
                        {
                            orderby = "order by " + orderby;
                        }

                        cmd.CommandText = String.Format("select {0} from {1} {2}", String.Join(",", fields.ToArray()), tableName, orderby);

                        using (YZReader reader = new YZReader(cmd.ExecuteReader()))
                        {
                            DataTable table = reader.LoadTable();
                            PageResult.RegularColumnsName(table, fields.ToArray());

                            return(table);
                        }
                    }
                }
            }
        }
Exemple #15
0
        public static string GetNewFileName(IYZDbProvider provider, IDbConnection cn, int folderid, string oldName)
        {
            string                   perfix      = Path.GetFileNameWithoutExtension(oldName);
            string                   ext         = Path.GetExtension(oldName);
            FileCollection           files       = DirectoryManager.GetFiles(provider, cn, folderid, null, null, -1);
            AttachmentInfoCollection attachments = files.GetAllAttachmentInfo(provider, cn);
            BPMObjectNameCollection  fileNames   = attachments.Names;

            for (int i = 1; true; i++)
            {
                string newFileName = perfix + "(" + i.ToString() + ")" + ext;

                if (fileNames.Contains(newFileName))
                {
                    continue;
                }

                return(newFileName);
            }
        }
Exemple #16
0
        public virtual object GetTeamList(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            DateTime  date    = request.GetDateTime("date");

            string uid = YZAuthHelper.LoginUserAccount;
            BPMObjectNameCollection accounts = new BPMObjectNameCollection();

            accounts.Add(uid);

            using (BPMConnection bpmcn = new BPMConnection())
            {
                bpmcn.WebOpen();

                MemberCollection positions = OrgSvr.GetUserPositions(bpmcn, uid);
                foreach (Member position in positions)
                {
                    DirectXSCollection xss = position.GetDirectXSs(bpmcn);
                    foreach (DirectXS xs in xss)
                    {
                        if (!accounts.Contains(xs.UserAccount))
                        {
                            accounts.Add(xs.UserAccount);
                        }
                    }
                }

                using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
                {
                    using (IDbConnection cn = provider.OpenConnection())
                    {
                        FootmarkCollection footmarks = FootmarkManager.GetFootmarks(provider, cn, accounts, date);
                        return(new
                        {
                            children = this.SerializeAsTeamList(bpmcn, footmarks),
                            unsignedusers = footmarks.GetUnSignedUsers(bpmcn, accounts)
                        });
                    }
                }
            }
        }
        public virtual object GetDashboardData(HttpContext context)
        {
            YZRequest               request       = new YZRequest(context);
            List <int>              rootfolderids = JArray.Parse(request.GetString("rootfolders")).ToObject <List <int> >();
            SpriteIdentity          responsible   = JObject.Parse(request.GetString("responsible")).ToObject <SpriteIdentity>();
            BPMObjectNameCollection milestones    = JArray.Parse(request.GetString("milestones")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection moduletypes   = JArray.Parse(request.GetString("moduletypes")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection colors        = JArray.Parse(request.GetString("colors")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection executeStatus = JArray.Parse(request.GetString("executeStatus")).ToObject <BPMObjectNameCollection>();
            string uid = YZAuthHelper.LoginUserAccount;

            FileCollection files = new FileCollection();

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    if (rootfolderids.Count == 0)
                    {
                        rootfolderids = this.GetAllReportRootFolders(provider, cn, uid);
                    }

                    FileSystem.FileCollection allfiles = new FileSystem.FileCollection();
                    foreach (int rootfolderid in rootfolderids)
                    {
                        FileSystem.FolderCollection allfolders  = FileSystem.DirectoryManager.GetAllChildFolders(provider, cn, rootfolderid, null, null);
                        FileSystem.FolderCollection rootFolders = allfolders.BuildTree(rootfolderid);
                        allfolders = rootFolders.Expand();

                        FileSystem.FileCollection folderfiles = FileSystem.DirectoryManager.GetFiles(provider, cn, allfolders.IDs, null, null, -1);
                        allfiles.AppendUnique(folderfiles);
                    }

                    foreach (FileSystem.File folderfile in allfiles)
                    {
                        File file = File.TryLoad(provider, cn, folderfile.FileID);
                        if (file == null)
                        {
                            continue;
                        }

                        //responsible过滤
                        if (!String.IsNullOrEmpty(responsible.FileID))
                        {
                            if (!file.Property.Owner.Contains(responsible))
                            {
                                continue;
                            }
                        }

                        //milestone过滤
                        if (milestones.Count != 0)
                        {
                            if (!milestones.Contains(file.Property.Milestone.ToString()))
                            {
                                continue;
                            }
                        }

                        //moduletypes过滤
                        if (moduletypes.Count != 0)
                        {
                            if (!moduletypes.Contains(file.AttachmentInfo.Ext))
                            {
                                continue;
                            }
                        }

                        //color过滤
                        if (colors.Count != 0)
                        {
                            if (!colors.Contains(file.Property.Color.ToString()))
                            {
                                continue;
                            }
                        }

                        //executeStatus过滤
                        if (executeStatus.Count != 0)
                        {
                            if (!executeStatus.Contains(file.Property.ExecuteStatus.ToString()))
                            {
                                continue;
                            }
                        }

                        files.Add(file);
                    }
                }
            }

            JObject rv = new JObject();
            JObject item;

            //Milestone
            item            = new JObject();
            rv["Milestone"] = item;
            item["Total"]   = files.Count;

            foreach (Milestone milestone in Enum.GetValues(typeof(Milestone)))
            {
                item[milestone.ToString()] = 0;
            }

            foreach (File file in files)
            {
                item[file.Property.Milestone.ToString()] = (int)item[file.Property.Milestone.ToString()] + 1;
            }

            //ExecuteStatus
            item = new JObject();
            rv["ExecuteStatus"] = item;

            foreach (ExecuteStatus executeState in Enum.GetValues(typeof(ExecuteStatus)))
            {
                item[executeState.ToString()] = 0;
            }

            foreach (File file in files)
            {
                item[file.Property.ExecuteStatus.ToString()] = (int)item[file.Property.ExecuteStatus.ToString()] + 1;
            }

            //Color
            item        = new JObject();
            rv["Color"] = item;

            foreach (FileColor fileColor in Enum.GetValues(typeof(FileColor)))
            {
                item[fileColor.ToString()] = 0;
            }

            foreach (File file in files)
            {
                item[file.Property.Color.ToString()] = (int)item[file.Property.Color.ToString()] + 1;
            }

            //分类统计
            item            = new JObject();
            rv["FileTypes"] = item;
            foreach (string ext in ".evc,.flow,.bpmn,.org,.data,.it,.product,.risk,.reg,.kpi".Split(','))
            {
                JObject jTypeCounts = new JObject();
                item[ext] = jTypeCounts;

                foreach (Milestone milestone in Enum.GetValues(typeof(Milestone)))
                {
                    jTypeCounts[milestone.ToString()] = 0;
                }
            }

            foreach (File file in files)
            {
                string ext = file.AttachmentInfo.Ext;
                if (ext != null)
                {
                    ext = ext.ToLower().Trim();
                }

                JObject jTypeCounts = item[ext] as JObject;
                if (jTypeCounts != null)
                {
                    jTypeCounts[file.Property.Milestone.ToString()] = (int)jTypeCounts[file.Property.Milestone.ToString()] + 1;
                }
            }

            //战略流程数量
            item                     = new JObject();
            rv["Strategic"]          = item;
            item["StrategicProcess"] = 0;
            item["OperationProcess"] = 0;
            item["SupportProcess"]   = 0;
            item["Other"]            = 0;

            foreach (File file in files)
            {
                string filetype;

                if (file.isStrategicProces)
                {
                    filetype = "StrategicProcess";
                }
                else if (file.isOperationProcess)
                {
                    filetype = "OperationProcess";
                }
                else if (file.isSupportProces)
                {
                    filetype = "SupportProcess";
                }
                else
                {
                    filetype = "Other";
                }

                item[filetype] = (int)item[filetype] + 1;
            }

            return(rv);
        }
Exemple #18
0
        protected virtual void ApplyMSChartData(YZRequest request, JObject rv, ReportMSChartView view, DataTable dataTable)
        {
            Chart chart = new Chart();

            YZChartHelper.ApplayChartStyle(chart);

            //设置报表大小
            chart.Width  = new Unit(view.ReportWidth, UnitType.Pixel);
            chart.Height = new Unit(view.ReportHeight, UnitType.Pixel);

            //添加主副标题
            chart.Titles[0].Text      = view.ReportTitle;
            chart.Titles[0].Alignment = ContentAlignment.TopCenter;

            //设置注释
            if (view.Series.Count >= 2)
            {
                chart.Legends.Add(new Legend("Default"));
                chart.Legends[0].Docking     = Docking.Bottom;
                chart.Legends[0].BackColor   = Color.Transparent;
                chart.Legends[0].Alignment   = StringAlignment.Center;
                chart.Legends[0].BorderColor = Color.Black;
            }

            //添加系列
            BPMObjectNameCollection denySeries = JArray.Parse(request.GetString("DenySeries", "[]")).ToObject <BPMObjectNameCollection>();

            foreach (ReportSeries reportSeries in view.Series)
            {
                if (denySeries.Contains(reportSeries.Name))
                {
                    continue;
                }

                Series series = new Series(reportSeries.Name);
                chart.Series.Add(series);

                series.ShadowColor   = Color.Transparent;
                series.BorderColor   = Color.FromArgb(180, 26, 59, 105);
                series.Color         = Color.FromArgb(180, reportSeries.Color);
                series.XValueMember  = view.XAxisColumnName;
                series.YValueMembers = reportSeries.DataColumnName;
                series.Tag           = reportSeries;
            }

            //应用客户设置
            SeriesChartType chartType = request.GetEnum <SeriesChartType>("ChartType", view.ChartType);
            bool            enable3D  = request.GetBool("Enable3D", false);
            int             rotation  = request.GetInt32("Rotation", 0);

            foreach (Series chartSeries in chart.Series)
            {
                chartSeries.ChartType = chartType;
            }

            if (enable3D)
            {
                foreach (ChartArea chartArea in chart.ChartAreas)
                {
                    chartArea.Area3DStyle.Enable3D = true;
                    chartArea.Area3DStyle.Rotation = rotation;
                }
            }

            //执行绑定
            chart.DataSource = dataTable;
            chart.DataBind();

            //应用数据显示
            foreach (Series series in chart.Series)
            {
                foreach (DataPoint point in series.Points)
                {
                    point.Label = point.YValues[0].ToString() + (series.Tag as ReportSeries).Unit;
                }
            }

            //生成报表图片
            string imageId = Guid.NewGuid().ToString();

            using (MemoryStream stream = new MemoryStream())
            {
                chart.SaveImage(stream, ChartImageFormat.Png);
                ChartManager.CurrentStore.Save(imageId, stream.ToArray(), "mschart.png", null);
            }

            rv["chartid"] = imageId;
            rv["width"]   = chart.Width.Value;
            rv["height"]  = chart.Height.Value;
        }
Exemple #19
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                YZAuthHelper.OAuth();

                //YZAuthHelper.AshxAuthCheck();

                string   method = context.Request.Params["Method"];
                JsonItem rv     = new JsonItem();

                if (YZStringHelper.EquName(method, "GET"))
                {
                    string uid = YZAuthHelper.LoginUserAccount;
                    using (BPMConnection cn = new BPMConnection())
                    {
                        JsonItem data = new JsonItem();
                        rv.Attributes.Add("data", data);

                        cn.WebOpen();

                        User user = User.FromAccount(cn, uid);
                        UserInfoSelfMantSetting setting = new UserInfoSelfMantSetting();
                        setting.Load(cn);

                        data.Attributes["Account"]     = user.Account;
                        data.Attributes["HRID"]        = user.HRID;
                        data.Attributes["DisplayName"] = user.DisplayName;
                        data.Attributes["Mobile"]      = user.Mobile;
                        data.Attributes["OfficePhone"] = user.OfficePhone;
                        data.Attributes["HomePhone"]   = user.HomePhone;
                        data.Attributes["EMail"]       = user.EMail;
                        data.Attributes["Office"]      = user.Office;
                        data.Attributes["Birthday"]    = YZStringHelper.DateToString(user.Birthday);
                        data.Attributes["DateHired"]   = YZStringHelper.DateToString(user.DateHired);

                        data.Attributes["editableFields"] = "DisplayName,HRID,Mobile,OfficePhone,HomePhone,EMail,Office,Birthday,DateHired";
                        //data.Attributes["editableFields"] = "Mobile,OfficePhone,HomePhone,EMail,Office";

                        //获得所有主管
                        BPMObjectNameCollection depts       = new BPMObjectNameCollection();
                        BPMObjectNameCollection supervisors = new BPMObjectNameCollection();
                        MemberCollection        members     = OrgSvr.GetUserPositions(cn, uid);
                        foreach (Member member in members)
                        {
                            OU ou = member.GetParentOU(cn);
                            depts.Add(ou.Name);

                            SupervisorCollection spvs = Member.GetSupervisors(cn, member.FullName);
                            foreach (Supervisor spv in spvs)
                            {
                                if (!supervisors.Contains(spv.UserFriendlyName))
                                {
                                    supervisors.Add(spv.UserFriendlyName);
                                }
                            }
                        }

                        data.Attributes["Supervisor"] = String.Join(",", supervisors.ToArray());
                        data.Attributes["Dept"]       = String.Join(",", depts.ToArray());
                    }
                }
                else if (YZStringHelper.EquName(method, "UPDATE"))
                {
                    string   uid       = YZAuthHelper.LoginUserAccount;
                    string   fieldName = context.Request.Params["fieldName"];
                    string   strValue  = context.Request.Params["value"];
                    DateTime date;
                    using (BPMConnection cn = new BPMConnection())
                    {
                        cn.WebOpen();

                        User user = User.FromAccount(cn, uid);

                        switch (fieldName)
                        {
                        case "DisplayName":
                            user.DisplayName = strValue;
                            break;

                        case "HRID":
                            user.HRID = strValue;
                            break;

                        case "Mobile":
                            user.Mobile = strValue;
                            break;

                        case "OfficePhone":
                            user.OfficePhone = strValue;
                            break;

                        case "HomePhone":
                            user.HomePhone = strValue;
                            break;

                        case "EMail":
                            user.EMail = strValue;
                            break;

                        case "Office":
                            user.Office = strValue;
                            break;

                        case "Birthday":
                            if (DateTime.TryParse(strValue, out date))
                            {
                                user.Birthday = date;
                            }
                            else
                            {
                                user.Birthday = DateTime.MinValue;
                            }
                            break;

                        case "DateHired":
                            if (DateTime.TryParse(strValue, out date))
                            {
                                user.DateHired = date;
                            }
                            else
                            {
                                user.DateHired = DateTime.MinValue;
                            }
                            break;
                        }

                        User.Update(cn, uid, user);
                    }
                }
                else
                {
                    throw new Exception(String.Format(JosonStrings.Aspx_UnknowCommand, method));
                }

                //System.Threading.Thread.Sleep(500);

                rv.Attributes.Add("success", true);
                context.Response.Write(rv.ToString());
            }
            catch (Exception e)
            {
                JsonItem rv = new JsonItem();
                rv.Attributes.Add("success", false);
                rv.Attributes.Add("errorMessage", e.Message);
                context.Response.Write(rv.ToString());
            }

            context.Response.AppendHeader("Access-Control-Allow-Origin", "*");      // 响应类型
            context.Response.AppendHeader("Access-Control-Allow-Methods", "POST");  // 响应头设置
            context.Response.AppendHeader("Access-Control-Allow-Headers", "x-requested-with,content-type");

            context.Response.Charset         = "gb2312"; //设置字符集类型
            context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
            context.Response.ContentType     = "application/json;charset=gb2312";
        }
Exemple #20
0
        public virtual void VideoStreamFromFileID(HttpContext context)
        {
            //System.Threading.Thread.Sleep(6000);
            YZRequest request = new YZRequest(context);
            string    fileId  = request.GetString("fileid");
            BPMObjectNameCollection supports = BPMObjectNameCollection.FromStringList(request.GetString("supports", null), ',');

            AttachmentInfo attachment;

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    attachment = AttachmentManager.GetAttachmentInfo(provider, cn, fileId);
                }
            }

            string fileName     = attachment.Name;
            string fileExt      = attachment.Ext;
            string fileExtNoDot = fileExt == null ? "" : fileExt.TrimStart('.');
            long   fileSize     = attachment.Size;
            string filePath     = AttachmentInfo.FileIDToPath(fileId, AttachmentManager.AttachmentRootPath);

            if (!File.Exists(filePath))
            {
                throw new Exception(String.Format(Resources.YZStrings.Aspx_Upload_FileIDNotFount, fileId));
            }

            //有请求格式并且请求格式非元文件格式
            if (supports.Count != 0 && !supports.Contains(fileExtNoDot))
            {
                //发现已有转换文件
                string existFile = null;
                foreach (string format in supports)
                {
                    string outputFile = Path.Combine(Path.GetDirectoryName(filePath), String.Format("{0}.{1}", Path.GetFileNameWithoutExtension(filePath), format));
                    if (File.Exists(outputFile))
                    {
                        existFile = outputFile;
                        break;
                    }
                }

                if (!String.IsNullOrEmpty(existFile))
                {
                    filePath = existFile;
                }
                else
                {
                    //转换文件
                    string targetExt  = supports[0];
                    string outputFile = Path.Combine(Path.GetDirectoryName(filePath), String.Format("{0}.{1}", Path.GetFileNameWithoutExtension(filePath), targetExt));

                    var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
                    ffMpeg.ConvertMedia(filePath, fileExtNoDot, outputFile, targetExt, null);
                    filePath = outputFile;
                }
            }

            this.ProcessResponseHeader(context, fileName, true);
            context.Response.TransmitFile(filePath);
        }
Exemple #21
0
        public virtual void Preview(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            bool      osfile  = request.GetBool("osfile", false);
            BPMObjectNameCollection supports = BPMObjectNameCollection.FromStringList(request.GetString("supports", null), ',');

            string filePath;
            string fileName;
            long   fileSize;
            string fileExt;

            if (osfile)
            {
                string root = request.GetString("root");
                string path = request.GetString("path");
                fileName = request.GetString("name");
                string rootPath = context.Server.MapPath(YZSoft.FileSystem.OSDirectoryManager.GetRootPath(root));
                filePath = Path.Combine(rootPath, path, fileName);

                if (!File.Exists(filePath))
                {
                    throw new Exception(String.Format(Resources.YZStrings.Aspx_Upload_FileIDNotFount, fileName));
                }

                FileInfo fileInfo = new FileInfo(filePath);
                fileSize = fileInfo.Length;
                fileExt  = fileInfo.Extension;
            }
            else
            {
                string fileId = request.GetString("fileid");

                AttachmentInfo attachment;
                using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
                {
                    using (IDbConnection cn = provider.OpenConnection())
                    {
                        attachment = AttachmentManager.GetAttachmentInfo(provider, cn, fileId);
                    }
                }

                fileName = attachment.Name;
                fileExt  = attachment.Ext;
                fileSize = attachment.Size;
                filePath = AttachmentInfo.FileIDToPath(fileId, AttachmentManager.AttachmentRootPath);

                if (!File.Exists(filePath))
                {
                    throw new Exception(String.Format(Resources.YZStrings.Aspx_Upload_FileIDNotFount, fileId));
                }
            }

            string fileExtNoDot = fileExt == null ? "" : fileExt.TrimStart('.');

            //有请求格式并且请求格式非元文件格式
            if (supports.Count != 0 && !supports.Contains(fileExtNoDot))
            {
                //发现已有转换文件
                string existFile = null;
                foreach (string format in supports)
                {
                    string outputFile = Path.Combine(Path.GetDirectoryName(filePath), String.Format("{0}.{1}", Path.GetFileNameWithoutExtension(filePath), format));
                    if (File.Exists(outputFile))
                    {
                        existFile = outputFile;
                        break;
                    }
                }

                if (!String.IsNullOrEmpty(existFile))
                {
                    filePath = existFile;
                }
                else
                {
                    //转换文件
                    string         targetExt    = supports[0];
                    DocumentFormat targetFormat = (DocumentFormat)Enum.Parse(typeof(DocumentFormat), targetExt, true);
                    string         outputFile   = Path.Combine(Path.GetDirectoryName(filePath), String.Format("{0}.{1}", Path.GetFileNameWithoutExtension(filePath), targetExt));
                    DocumentFormat srcFormat    = (DocumentFormat)Enum.Parse(typeof(DocumentFormat), fileExtNoDot, true);

                    if (srcFormat == DocumentFormat.Pdf && targetFormat == DocumentFormat.Html)
                    {
                        YZSoft.Web.File.FileConvert.Pdf2Html(filePath);
                        filePath = outputFile;
                    }
                    else
                    {
                        DocumentConverterResult result = DocumentConverter.Convert(
                            new GleamTech.IO.BackSlashPath(filePath),
                            new InputOptions(srcFormat),
                            new GleamTech.IO.BackSlashPath(outputFile),
                            targetFormat
                            );
                        filePath = result.OutputFiles[0];
                    }
                }

                fileExt = Path.GetExtension(filePath);
            }

            string range       = context.Request.Headers["Range"];
            string contentType = YZMimeMapping.GetMimeType(fileExt);

            context.Response.AppendHeader("Content-Type", contentType);
            context.Response.AppendHeader("Accept-Ranges", "bytes");

            if (range == null)
            {
                FileInfo fileinfo = new FileInfo(filePath);

                //全新下载
                context.Response.AppendHeader("Content-Length", fileinfo.Length.ToString());
                //context.Response.CacheControl = HttpCacheability.Public.ToString();
                //context.Response.Cache.AppendCacheExtension("max-age=" + 365 * 24 * 60 * 60);
                //context.Response.Cache.SetExpires(DateTime.Now.AddYears(1));
                //context.Response.AppendHeader("ETag", "Never_Modify");
                //context.Response.Cache.SetETag("Never_Modify");
                //context.Response.Cache.SetLastModified(DateTime.Now.AddMinutes(-1));

                context.Response.TransmitFile(filePath);
            }
            else
            {
                //断点续传以及多线程下载支持
                string[] file_range = range.Substring(6).Split(new char[1] {
                    '-'
                });
                context.Response.Status = "206 Partial Content";
                context.Response.AppendHeader("Content-Range", "bytes " + file_range[0] + "-" + file_range[1] + "/" + fileSize.ToString());
                context.Response.AppendHeader("Content-Length", (Int32.Parse(file_range[1]) - Int32.Parse(file_range[0]) + 1).ToString());
                context.Response.TransmitFile(filePath, long.Parse(file_range[0]), (long)(Int32.Parse(file_range[1]) - Int32.Parse(file_range[0]) + 1));
            }
        }
        public virtual DataTable GetModuleList(HttpContext context)
        {
            YZRequest               request       = new YZRequest(context);
            List <int>              rootfolderids = JArray.Parse(request.GetString("rootfolders")).ToObject <List <int> >();
            SpriteIdentity          responsible   = JObject.Parse(request.GetString("responsible")).ToObject <SpriteIdentity>();
            BPMObjectNameCollection milestones    = JArray.Parse(request.GetString("milestones")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection moduletypes   = JArray.Parse(request.GetString("moduletypes")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection colors        = JArray.Parse(request.GetString("colors")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection executeStatus = JArray.Parse(request.GetString("executeStatus")).ToObject <BPMObjectNameCollection>();
            string uid = YZAuthHelper.LoginUserAccount;
            BPMObjectNameCollection indexs = BPMObjectNameCollection.FromStringList(".evc,.flow,.bpmn,.org,.data,.it,.product,.risk,.reg,.kpi", ',');

            DataTable table = new DataTable();

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    FileCollection files = new FileCollection();

                    if (rootfolderids.Count == 0)
                    {
                        rootfolderids = this.GetAllReportRootFolders(provider, cn, uid);
                    }

                    FileSystem.FileCollection allfiles = new FileSystem.FileCollection();
                    foreach (int rootfolderid in rootfolderids)
                    {
                        FileSystem.FolderCollection allfolders  = FileSystem.DirectoryManager.GetAllChildFolders(provider, cn, rootfolderid, null, null);
                        FileSystem.FolderCollection rootFolders = allfolders.BuildTree(rootfolderid);
                        allfolders = rootFolders.Expand();

                        FileSystem.FileCollection folderfiles = FileSystem.DirectoryManager.GetFiles(provider, cn, allfolders.IDs, null, null, -1);
                        allfiles.AppendUnique(folderfiles);
                    }

                    foreach (FileSystem.File folderfile in allfiles)
                    {
                        File file = File.TryLoad(provider, cn, folderfile.FileID);
                        if (file == null)
                        {
                            continue;
                        }

                        //responsible过滤
                        if (!String.IsNullOrEmpty(responsible.FileID))
                        {
                            if (!file.Property.Owner.Contains(responsible))
                            {
                                continue;
                            }
                        }

                        //milestone过滤
                        if (milestones.Count != 0)
                        {
                            if (!milestones.Contains(file.Property.Milestone.ToString()))
                            {
                                continue;
                            }
                        }

                        //moduletypes过滤
                        if (moduletypes.Count != 0)
                        {
                            if (!moduletypes.Contains(file.AttachmentInfo.Ext))
                            {
                                continue;
                            }
                        }

                        //color过滤
                        if (colors.Count != 0)
                        {
                            if (!colors.Contains(file.Property.Color.ToString()))
                            {
                                continue;
                            }
                        }

                        //executeStatus过滤
                        if (executeStatus.Count != 0)
                        {
                            if (!executeStatus.Contains(file.Property.ExecuteStatus.ToString()))
                            {
                                continue;
                            }
                        }

                        files.Add(file);
                    }

                    DataRow row;

                    table.Columns.Add("OrderIndex", typeof(string));
                    table.Columns.Add("SubOrderIndex", typeof(string));
                    table.Columns.Add("Ext", typeof(string));
                    table.Columns.Add("Category", typeof(string));
                    table.Columns.Add("FileOrderFlag", typeof(int));
                    table.Columns.Add("FileOrder", typeof(string));
                    table.Columns.Add("FileCode", typeof(string));
                    table.Columns.Add("FileID", typeof(string));
                    table.Columns.Add("FileName", typeof(string));
                    table.Columns.Add("Responsible", typeof(string));

                    foreach (File file in files)
                    {
                        string ext = file.AttachmentInfo.Ext;
                        if (ext != null)
                        {
                            ext = ext.ToLower().Trim();
                        }

                        string category;
                        int    subOrderIndex = 0;

                        if (file.isStrategicProces)
                        {
                            category      = "战略流程";
                            subOrderIndex = 0;
                        }
                        else if (file.isOperationProcess)
                        {
                            category      = "运营流程";
                            subOrderIndex = 1;
                        }
                        else if (file.isSupportProces)
                        {
                            category = "支持流程";
                        }
                        else
                        {
                            category = File.GetCategoryNameFromExt(ext);
                        }

                        row = table.NewRow();
                        table.Rows.Add(row);

                        int orderIndex = indexs.IndexOf(ext);
                        row["OrderIndex"]    = orderIndex == -1 ? Int32.MaxValue : orderIndex;
                        row["SubOrderIndex"] = subOrderIndex;
                        row["Ext"]           = ext;
                        row["Category"]      = category;
                        row["FileOrderFlag"] = String.IsNullOrEmpty(file.Property.Order) ? 1 : 0;
                        row["FileOrder"]     = file.Property.Order;
                        row["FileCode"]      = file.Property.Code;
                        row["FileID"]        = file.FileID;
                        row["FileName"]      = file.AttachmentInfo.Name;
                        row["Responsible"]   = String.Join(",", file.Property.Owner.ToString(provider, cn));
                    }
                }
            }

            DataView view = new DataView(table);

            view.Sort = "OrderIndex ASC,SubOrderIndex ASC,FileOrderFlag,FileOrder,FileCode,FileID";
            return(view.ToTable(table.TableName));
        }
Exemple #23
0
        public virtual object RelationshipAppGetNonUsedBy(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    fileid  = request.GetString("fileid");
            BPMObjectNameCollection  spriteids   = JArray.Parse(request.GetString("spriteids")).ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection  tagfiletype = JArray.Parse(request.GetString("tagfiletype")).ToObject <BPMObjectNameCollection>();
            SpriteIdentityCollection rv          = new SpriteIdentityCollection();

            using (IYZDbProvider provider = YZDbProviderManager.DefaultProvider)
            {
                using (IDbConnection cn = provider.OpenConnection())
                {
                    File file = File.Load(provider, cn, fileid);
                    SpriteLinkCollection links = BPAManager.GetFileUsedByLinks(provider, cn, fileid, null);

                    foreach (Sprite sprite in file.Sprites.SortByOrder())
                    {
                        if (spriteids.Count != 0 && !spriteids.Contains(sprite.Id))
                        {
                            continue;
                        }

                        if (tagfiletype.Count == 0)
                        {
                            bool find = false;
                            foreach (SpriteLink link in links)
                            {
                                if (NameCompare.EquName(link.LinkedSpriteID, sprite.Id))
                                {
                                    find = true;
                                    break;
                                }
                            }

                            if (find)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            bool find = false;
                            foreach (SpriteLink link in links)
                            {
                                bool attachmentInfoSetted = link["attachmentInfoSetted"] == null ? false:Convert.ToBoolean(link["attachmentInfoSetted"]);

                                AttachmentInfo srcAttachment;
                                if (attachmentInfoSetted)
                                {
                                    srcAttachment = link["attachmentInfo"] as AttachmentInfo;
                                }
                                else
                                {
                                    srcAttachment                = AttachmentManager.TryGetAttachmentInfo(provider, cn, link.FileID);
                                    link["attachmentInfo"]       = srcAttachment;
                                    link["attachmentInfoSetted"] = true;
                                }

                                if (tagfiletype != null && tagfiletype.Contains(srcAttachment.Ext))
                                {
                                    find = true;
                                    break;
                                }
                            }

                            if (find)
                            {
                                continue;
                            }
                        }

                        rv.Add(new SpriteIdentity(sprite));
                    }

                    return(rv);
                }
            }
        }