Exemple #1
0
        protected void Bind_gvUploadedFiles()
        {
            pnlDocMgr.Visible = true;
            List <DOCUMENT> files = SQMDocumentMgr.SelectDocList(SessionManager.EffLocation.Company.COMPANY_ID, SessionManager.DocumentContext);

            gvUploadedFiles.DataSource   = files;
            gvUploadedFiles.DataKeyNames = new string[] { "DOCUMENT_ID" };
            gvUploadedFiles.DataBind();
            gvUploadedFiles.Visible = true;
            SetGridViewDisplay(gvUploadedFiles, lblDocsListEmpty, divDocsGVScroll, 20, 0);
        }
Exemple #2
0
        public int BindDocumentSelect(string docScope, int displayType, bool showLabel, bool clearList, string message)
        {
            int status = 0;


            if (displayType > 0)
            {
                SessionManager.DocumentContext = new DocumentScope().CreateNew(SessionManager.PrimaryCompany().COMPANY_ID, docScope, 0, "", 0, "", new decimal[1] {
                    (decimal)displayType
                });
            }
            else
            {
                SessionManager.DocumentContext = new DocumentScope().CreateNew(docScope, 0, "", 0, "");
            }

            List <DOCUMENT> files = SQMDocumentMgr.SelectDocList(SessionManager.PrimaryCompany().COMPANY_ID, SessionManager.DocumentContext);

            if (clearList)
            {
                ddlSelectDocs.Items.Clear();
            }

            foreach (DOCUMENT doc in files)
            {
                RadComboBoxItem item = new RadComboBoxItem(doc.FILE_DESC, doc.DOCUMENT_ID.ToString());
                item.ToolTip = doc.FILE_NAME;
                // item.Font.Size = 10;
                string[] args = doc.FILE_NAME.Split('.');
                if (args.Length > 0)
                {
                    string ext = args[args.Length - 1];
                    item.ImageUrl = "~/images/filetype/icon_" + ext.ToLower() + ".jpg";
                }

                /*
                 * if (++status % 2 == 0)
                 * {
                 *  item.CssClass = "rcbComboItemAlt";
                 * }
                 */
                ddlSelectDocs.Items.Add(item);
            }
            ddlSelectDocs.Font.Size = 10;
            if (!string.IsNullOrEmpty(message))
            {
                ddlSelectDocs.EmptyMessage = message;
            }

            pnlSelectDocument.Visible = true;
            lblSelectDocs.Visible     = showLabel;
            return(status);
        }
        protected void Bind_gvUploadedFiles()
        {
            files = null;

            switch (SessionManager.DocumentContext.Scope)
            {
            case "USR":
                files = SQMDocumentMgr.SelectDocListByOwner(SessionManager.UserContext.Person.PERSON_ID, 15);
                break;

            default:
                files = SQMDocumentMgr.SelectDocList(SessionManager.EffLocation.Company.COMPANY_ID, SessionManager.DocumentContext);
                break;
            }

            if (files != null && files.Count > 0)
            {
                gvUploadedFiles.DataSource   = files;
                gvUploadedFiles.DataKeyNames = new string[] { "DOCUMENT_ID" };
                gvUploadedFiles.DataBind();
                gvUploadedFiles.Visible = true;
            }
        }