protected void cadLookup_Click(object sender, EventArgs e)
        {
            FineUIPro.TreeNode treenode = firsttree.SelectedNode;

            if (treenode.Attributes["nodemenu"].ToString().Trim() == "2")
            {
                cd_thermal ct     = new cd_thermal();
                string     strtid = ct.isExistdata("cd_thermal", "pid", treenode.NodeID.Trim(), "ID").Trim();

                if (strtid != "")
                {
                    pd_cad pc          = new pd_cad();
                    string strfilename = pc.isExistdata("pd_cad", "pid", strtid, "filename");

                    //GrapkTabStrip.ActiveTabIndex = 2;
                    if (strfilename.Trim() != "")
                    {
                        PageContext.RegisterStartupScript("openwebcad('http://" + Request.Url.Authority.Trim() + "/resources/cad/" + strfilename + "')");
                    }
                    else
                    {
                        PageContext.RegisterStartupScript("clearcad()");
                    }
                }
            }
        }
        //CAD图纸
        protected void filemxcad_FileSelected(object sender, EventArgs e)
        {
            FineUIPro.TreeNode treenode = firsttree.SelectedNode;

            if (treenode != null && treenode.Attributes["nodemenu"].ToString().Trim() == "2")
            {
                cd_thermal ct     = new cd_thermal();
                string     strtid = ct.isExistdata("cd_thermal", "pid", treenode.NodeID.ToString().Trim(), "ID").Trim();

                if (strtid == "")
                {
                    Alert.Show("请先保存工艺卡基本信息");
                    return;
                }

                try
                {
                    if (filemxcad.HasFile)
                    {
                        string fileName = filemxcad.ShortFileName;

                        if (!commonLib.ValidateCADType(fileName))
                        {
                            Alert.Show("无效的文件类型!");
                            return;
                        }

                        fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
                        int    lastDotIndex = fileName.LastIndexOf(".");
                        string strfiletype  = fileName.Substring(lastDotIndex + 1).ToLower();
                        string strpname     = fileName.Substring(0, lastDotIndex);
                        fileName = DateTime.Now.Ticks.ToString() + fileName.Substring(lastDotIndex).Trim();

                        filemxcad.SaveAs(Server.MapPath("~/resources/cad/" + fileName));

                        // 清空文件上传组件
                        filemxcad.Reset();

                        Dictionary <string, string> dic = initCADdic(strtid, strpname, fileName, strfiletype);

                        try
                        {
                            pd_cad pc          = new pd_cad();
                            string strfilename = pc.isExistdata("pd_cad", "pid", strtid, "filename");

                            if (strfilename.Trim() != "")
                            {
                                strfilename = Server.MapPath("~/resources/cad/") + strfilename;

                                if (File.Exists(strfilename))
                                {
                                    File.Delete(strfilename);
                                }

                                pc.update(dic, "pd_cad", "pid", strtid);
                            }
                            else
                            {
                                dic.Add("ID", Guid.NewGuid().ToString());
                                dic.Add("pid", strtid);
                                pc.add(dic, "pd_cad");
                            }


                            PageContext.RegisterStartupScript("openwebcad('http://" + Request.Url.Authority.Trim() + "/resources/cad/" + fileName + "')");
                        }
                        catch
                        {
                        }
                    }
                }
                catch
                {
                }
            }
        }