Exemplo n.º 1
0
        private void LoadTagCount(Dictionary <TagNodeKey, List <TagNode> > dic, TagNodeKey key, int count)
        {
            var c = count;

            if (bool.Parse(AppSettingCache.Instance["ActDirectorTag"]))
            {
                try
                {
                    if (key.Dimension == CustomArray.ActDimension)
                    {
                        if (key.Type == 1)
                        {
                            var sql = "select count(*) from bktags where tagtype=4 and bktype=0";
                            c = Convert.ToInt32(DbObject <BoxTypeInfo> .ExecuteScalarBySql(sql));
                        }
                        else if (key.Type == 2)
                        {
                            var sql = "select count(*) from bktags where tagtype=4 and bktype=1";
                            c = Convert.ToInt32(DbObject <BoxTypeInfo> .ExecuteScalarBySql(sql));
                        }
                    }
                    else if (key.Dimension == CustomArray.DirectorDimension)
                    {
                        if (key.Type == 1)
                        {
                            var sql = "select count(*) from bktags where tagtype=5 and bktype=0";
                            c = Convert.ToInt32(DbObject <BoxTypeInfo> .ExecuteScalarBySql(sql));
                        }
                        else if (key.Type == 2)
                        {
                            var sql = "select count(*) from bktags where tagtype=5 and bktype=1";
                            c = Convert.ToInt32(DbObject <BoxTypeInfo> .ExecuteScalarBySql(sql));
                        }
                    }
                }
                catch (Exception ex)
                {
                    _log.Error(ex);
                    dic[key] = new List <TagNode>(1000);
                }
            }
            dic[key] = new List <TagNode>(c);
        }