Example #1
0
    protected void BrowseTreeView_SelectedNodeChanged(object sender, EventArgs e)
    {
        TreeNode selectedNode = BrowseTreeView.SelectedNode;

        if (selectedNode != null)
        {
            if (selectedNode.ChildNodes.Count > 0)
            {
                ObjectDataSource_DocumentList.SelectParameters["DocTypeName"].DefaultValue = selectedNode.Text;
                ObjectDataSource_DocumentList.SelectParameters["DocName"].DefaultValue     = "";
                ObjectDataSource_DocAttributeValue.SelectParameters["DocID"].DefaultValue  = "0";
            }
            else
            {
                if (selectedNode.Target != "")
                {
                    if (selectedNode.Parent != null)
                    {
                        ObjectDataSource_DocumentList.SelectParameters["DocTypeName"].DefaultValue = selectedNode.Parent.Text;
                        ObjectDataSource_DocumentList.SelectParameters["DocName"].DefaultValue     = selectedNode.Text;
                        if (GetCrewID() > 0)
                        {
                            ObjectDataSource_DocAttributeValue.SelectParameters["DocID"].DefaultValue = selectedNode.Target;
                            GridView_DocAttributes.DataBind();
                            GridView_DocAttributes.Visible = true;
                        }
                        else
                        {
                            GridView_DocAttributes.Visible = false;
                        }

                        string docFile     = objDMSBLL.getDocumentFileNameByID(int.Parse(selectedNode.Target));
                        string crewDocPath = "../Uploads/CrewDocuments/" + docFile;


                        if (File.Exists(Server.MapPath("../Uploads/CrewDocuments/") + docFile))
                        {
                            string js = "previewDocument('" + crewDocPath + "');";
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "loadfile", js, true);
                        }
                        else
                        {
                            string js = "previewDocument('../Images/FileNotFound.png');";
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "loadfile", js, true);
                        }
                    }
                }
            }
        }
    }
Example #2
0
 protected void LoadDocumentAttributes(string DocID)
 {
     ObjectDataSource_DocAttributeValue.SelectParameters["DocID"].DefaultValue = DocID;
     GridView_DocAttributes.DataBind();
 }