Пример #1
0
        /// <summary>
        /// 打印调的方法
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="showmsg"></param>
        //public void Test(DataTable dt, bool showmsg)
        //{
        //    if (Globals.SH == 0)
        //    {
        //        TXMessageBoxExtensions.Info("您没有提交权限!");
        //        return;
        //    }
        //    if (dt.Rows.Count > 0)
        //    {
        //        string CurPrinterName = PrinterOperate.GetDefaultPrinterName();
        //        if (CurPrinterName != PrinterOperate.UsePrinterName)//如果当前打印机不是EASYPDF就要设置
        //        {
        //            PrinterOperate.SetPrinter(PrinterOperate.UsePrinterName);
        //        }
        //        frmRefreshHead frm = new frmRefreshHead(Mydel, dt);
        //        frm.SetTitle = "提交中…";
        //        frm.SetMsg = "正在处理数据,请稍候…";
        //        if (frm.ShowDialog() != DialogResult.OK)
        //        {
        //            if (!string.IsNullOrEmpty(frm.ErrorMsg))
        //            {
        //                TXMessageBoxExtensions.Info(frm.ErrorMsg);
        //            }
        //        }
        //        else
        //        {
        //            if (showmsg)
        //                TXMessageBoxExtensions.Info("提交完成!");
        //        }
        //        if (CurPrinterName != PrinterOperate.UsePrinterName)
        //        {
        //            PrinterOperate.SetPrinter(CurPrinterName);
        //        }//设置打印机后,设回来
        //    }
        //    else
        //    {
        //        TXMessageBoxExtensions.Info("没有找到需要提交的文件!");
        //    }
        //}
        /// <summary>
        /// 新建目录,0为同级,1为子级
        /// </summary>
        /// <param name="level">0为同级,1为子级</param>
        private void NewFloder(int level)
        {
            try
            {
                TreeNodeEx parentNode = (TreeNodeEx)treeView1.SelectedNode;
                if (parentNode == null)
                {
                    return;
                }
                TreeNodeEx tempNode = null;//传个空值用
                frmMainGetTempletFromStandard frm = new frmMainGetTempletFromStandard(tempNode, false, parentNode);
                DialogResult ret = frm.ShowDialog();
                if (ret == DialogResult.OK)
                {
                    string Title      = MyCommon.ToSqlString(frm.StrTitle.Trim());
                    int    orderindex = (new BLL.T_FileList_BLL()).GetMaxOrderIndex(parentNode.Name, Globals.ProjectNO);
                    string ProjectNO  = Globals.ProjectNO;

                    fileModel            = new ERM.MDL.T_FileList();
                    fileModel.gdwj       = Title;
                    fileModel.wjtm       = Title;
                    fileModel.FileID     = Guid.NewGuid().ToString();
                    fileModel.ParentID   = parentNode.Name;
                    fileModel.ProjectNO  = ProjectNO;
                    fileModel.OrderIndex = orderindex + 1;
                    fileModel.fileStatus = "0";
                    fileModel.FL         = 0;

                    BLL.T_FileList_BLL fileBLL = new ERM.BLL.T_FileList_BLL();
                    fileModel.isvisible = 0;
                    fileBLL.Add(fileModel);

                    TreeNodeEx newNode = new TreeNodeEx();
                    newNode.Name               = fileModel.FileID;
                    newNode.Text               = fileModel.wjtm;
                    newNode.ImageIndex         = 1;
                    newNode.SelectedImageIndex = 1;
                    parentNode.Nodes.Add(newNode);
                }
            }
            catch
            {
            }
        }
Пример #2
0
        /// <summary>
        /// 修改节点属性
        /// </summary>
        private void EditNode()
        {
            try
            {
                TreeNodeEx theNode = (TreeNodeEx)treeView1.SelectedNode;
                if (theNode == null)
                {
                    return;
                }
                if (theNode.Parent == null)
                {
                    return;
                }

                if (theNode.ImageIndex == 4)
                {
                    TXMessageBoxExtensions.Info("提示:已经组卷的文件不允许修改!");
                    return;
                }

                frmMainGetTempletFromStandard frm = new frmMainGetTempletFromStandard(theNode, (theNode.ImageIndex == 2 || theNode.ImageIndex == 7), (TreeNodeEx)theNode.Parent);
                frm.Text = "修改";
                DialogResult ret = frm.ShowDialog();
                if (ret == DialogResult.OK)
                {
                    if (GetTrueText(theNode.Text) == frm.StrTitle.Trim())
                    {
                        return;
                    }
                    string title = MyCommon.ToSqlString(frm.StrTitle.Trim());
                    theNode.Text = title;
                    MDL.T_FileList fileMDL = (new BLL.T_FileList_BLL()).Find(theNode.Name, Globals.ProjectNO);
                    if (fileMDL != null)
                    {
                        fileMDL.wjtm = title;
                        (new BLL.T_FileList_BLL()).Update(fileMDL);
                    }
                }
            }
            catch (Exception ex)
            {
                ////TXMessageBoxExtensions.InfoErrors(ex);
            }
        }
Пример #3
0
 private void NewTable()
 {
     try
     {
         TreeNodeEx theNode = (TreeNodeEx)treeView1.SelectedNode;
         if (theNode == null)
         {
             return;
         }
         TreeNodeEx tempNode = null;//传个空值进去
         frmMainGetTempletFromStandard frm = new frmMainGetTempletFromStandard(tempNode, true, theNode);
         DialogResult ret = frm.ShowDialog();
         if (ret == DialogResult.OK)
         {
             //2011-3-18 去掉表格代码
             //AddNewNode("", frm.txtLocalPath.Text.ToLower(), MyCommon.ToSqlString(frm.txtCodeno.Text.Trim()), MyCommon.ToSqlString(frm.StrTitle.Trim()), Convert.ToInt16(frm.txtys.Text));
             AddNewNode("", frm.txtLocalPath.Text.ToLower(), MyCommon.ToSqlString(frm.StrTitle.Trim()));
         }
     }
     catch (Exception ex)
     {
         ////TXMessageBoxExtensions.InfoErrors(ex);
     }
 }