Пример #1
0
        private void getAllFileFromTemplateNode(TreeNodeEx node)
        {
            tscmbDisp.SelectedIndex  = 0;
            tscmbScale.SelectedIndex = 2;
            tsCut.SelectedIndex      = 0;
            if (System.IO.File.Exists(reportsPath + "temp.tif"))
            {
                System.IO.File.Delete(reportsPath + "temp.tif");
            }
            string strSql = "select * from attachment where fileTreePath='" + treeFactory.OpeartPath(node) + "' and ProjectNO='" + Globals.ProjectNO + "'";

            strSql += " order by fileorderindex,attachid";
            DataSet ds = null;

            ds = Digi.DBUtility.DbHelperOleDb.Query(strSql);
            axImgAdmin1.Image = reportsPath + "temp.tif";
            axImgAdmin1.Append(reportsPath + "blank.tif", 1, 1);
            string str = "";

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                str = ds.Tables[0].Rows[i]["yswjpath"].ToString();
                str = str.Substring(str.LastIndexOf(".") + 1);
                str = str.ToLower();
                if (str == "jpg" || str == "bmp" || str == "gif" || str == "tif")
                {
                    arrPic.Add(projectPath + Globals.ProjectNO + "\\ODoc\\" + ds.Tables[0].Rows[i]["yswjpath"].ToString());
                    axImgAdmin1.Append(projectPath + Globals.ProjectNO + "\\ODoc\\" + ds.Tables[0].Rows[i]["yswjpath"].ToString(), 1, 1);
                }
            }
            axImgAdmin1.DeletePages(1, 1);
            axImgEdit1.ImagePalette = ImgeditLibCtl.ImagePaletteConstants.wiPaletteRGB24;
            if (arrPic.Count == 0)
            {
                this.axImgEdit1.Image = reportsPath + "blank.jpg";
            }
            else
            {
                axImgThumbnail1.Image = reportsPath + "temp.tif";
                this.axImgEdit1.Image = arrPic[0].ToString();
            }
            axImgEdit1.RenderAllPages(-100, -100);
            axImgEdit1.Display();
            if (arrPic.Count > 0)
            {
                curSelNoFrmThum = 1;
            }
            else
            {
                curSelNoFrmThum = 0;
            }
        }