Esempio n. 1
0
        /// <summary>
        //*** Bind DropBox Data Grid
        /// </summary>
        /// <param name="FolderPath">Folder Path in Array Format</param>
        /// <returns></returns>
        private async void DropBoxGridDataBind(List <string> FolderPath = null)
        {
            //*** Constract Path String
            string strFolderpath = "";

            if (FolderPath != null)
            {
                foreach (var item in FolderPath)
                {
                    strFolderpath += "/" + item;
                }
            }

            //*** Bind the Grid & Bread Crumb
            //*** Get Files & Folders List
            List <DropBoxFile> lstDropBoxFile = await DropBoxConnector.ListFolder(Application["dropBoxClientObj"], strFolderpath);

            if (DropBoxConnector.MsgError != "")    //*** If error
            {
                lblDropBoxMsg.Text = DropBoxConnector.MsgError;

                //*** Show Error
                divDropBoxAlert.Visible = true;
            }
            else
            {
                grdVWFilesFolderList.DataSource = lstDropBoxFile;
                grdVWFilesFolderList.DataBind();
                rptFolderBreadCrumb.DataSource = (List <string>)Session["FolderPath"];
                rptFolderBreadCrumb.DataBind();
                divFileGrid.Visible = true;
            }
        }
Esempio n. 2
0
        //*****************************************************************
        //*** Drop Box Files List Function
        //*****************************************************************
        /// <summary>
        /// *** Get DropBox Files List
        /// </summary>
        /// <param name="FolderPath">Folder Path in Array Format</param>
        /// <returns></returns>
        private async Task getDropBoxFilesList(List <string> FolderPath = null)
        {
            try
            {
                //*** Constract Path String
                string strFolderpath = "";
                string strFolderName = "";
                if (FolderPath != null)
                {
                    foreach (var item in FolderPath)
                    {
                        strFolderpath += "/" + item;
                        strFolderName  = item;
                    }
                }

                //*** Bind the Grid & Bread Crumb
                //*** Get Files & Folders List
                //var returnTask = DropBoxConnector.ListFolder(Session["dropBoxClientObj"], strFolderpath);
                //returnTask.Wait();
                //List<DropBoxFile> lstDropBoxFile = returnTask.Result;
                List <DropBoxFile> lstDropBoxFile = await DropBoxConnector.ListFolder(Session["dropBoxClientObj"], strFolderpath);

                if (DropBoxConnector.MsgError != "")    //*** If error
                {
                    Session["lblDropBoxMsg"] = DropBoxConnector.MsgError;
                }
                else
                {
                    //*** Set Session with All Dropbox List
                    Session["lstDropBoxFile"] = lstDropBoxFile;
                }
            }
            catch (Exception e)
            {
                Session["lblDropBoxMsg"] = "getDropBoxFilesList Error: " + e.ToString();
            }
        }
Esempio n. 3
0
        //*****************************************************************
        //*** Drop Box Files Grid Functions
        //*****************************************************************
        /// <summary>
        //*** Bind DropBox Data Grid
        /// </summary>
        /// <param name="FolderPath">Folder Path in Array Format</param>
        /// <returns></returns>
        private async void DropBoxGridDataBind(List <string> FolderPath = null)
        {
            //*** Constract Path String
            string strFolderpath = "";
            string strFolderName = "";

            if (FolderPath != null)
            {
                foreach (var item in FolderPath)
                {
                    strFolderpath += "/" + item;
                    strFolderName  = item;
                }
            }

            //*** Bind the Grid & Bread Crumb
            //*** Get Files & Folders List
            List <DropBoxFile> lstDropBoxFile = await DropBoxConnector.ListFolder(Application["dropBoxClientObj"], strFolderpath);

            if (DropBoxConnector.MsgError != "")    //*** If error
            {
                lblDropBoxMsg.Text = DropBoxConnector.MsgError;

                //*** Show Error
                divDropBoxAlert.Visible = true;
            }
            else
            {
                grdVWDropBoxFilesFolderList.DataSource = lstDropBoxFile;
                grdVWDropBoxFilesFolderList.DataBind();
                rptDropBoxFolderBreadCrumb.DataSource = (List <string>)Session["FolderPath"];
                rptDropBoxFolderBreadCrumb.DataBind();
                DivDropBoxFileGrid.Visible = true;
                if (divExactOnlineFileGrid.Visible)
                {
                    divSync.Visible = true;
                }

                //****************************************************************
                //**** Bind Exact Rebind Online Part
                //****************************************************************
                string strFolderGUID = "";
                if (divExactOnlineFileGrid.Visible)     //**** If Exact Online Grid Shown
                {
                    //*** 1. Get Folder Guid (If not root)
                    if (strFolderName != "")
                    {
                        //*** Fitch Grid to get GUID
                        foreach (GridViewRow row in grdVWExactOnlineFilesFolderList.Rows)
                        {
                            //*** Check if name & Is Folcder
                            if (bool.Parse(((Label)row.FindControl("lblisFolder")).Text) && ((Label)row.FindControl("lblFileName")).Text.ToLower() == strFolderName.ToLower())
                            {
                                strFolderGUID = ((Label)row.FindControl("lblFolderID")).Text;
                                break;
                            }
                        }
                    }

                    Session["CurrentExactFolderGUID"] = strFolderGUID;

                    //*** Then Rebind ExactOnline Grid
                    ExactOnlineGridDataBind(strFolderGUID);
                }
                //****************************************************************
            }
        }