Esempio n. 1
0
        public override void DataBind()
        {
            if (_bound)
            {
                return;
            }
            _bound = true;

            StringBuilder cond = new StringBuilder();

            if (Type != "")
            {
                cond.Append(string.Format(" And (Type='{0}' or UniqueName='{0}')", StringUtils.SQLEncode(Type)));
            }

            if (status != DownloadStatus.All)
            {
                cond.Append(string.Format(" And Status={0}", (int)Status));
            }
            else
            {
                cond.Append(string.Format(" And Status<>{0}", (int)DownloadStatus.Disabled));
            }


            string sql = "";

            sql = string.Format("Status<>0 {0}", cond);


            Downloads dMgr = new Downloads();

            DataView downloads = dMgr.GetDownloadMax(max, sql);

            this.DataSource = downloads;

            base.DataBind();
        }