private void BindPxInfo(string ParentID, int Flg) { if (Flg == 0) { BLL.T_FileList_BLL FileList_BLL = new ERM.BLL.T_FileList_BLL(); DataTable tbl_FileList = FileList_BLL.GetFileByGDID(Globals.ProjectNO, ParentID); if (tbl_FileList != null && tbl_FileList.Rows.Count > 0) { int index = 1; foreach (DataRow f_row in tbl_FileList.Rows) { dgv_PX.Rows.Add(); dgv_PX.Rows[dgv_PX.Rows.Count - 1].Cells["cl_ID"].Value = f_row["FileID"].ToString(); dgv_PX.Rows[dgv_PX.Rows.Count - 1].Cells["cl_Index"].Value = index; dgv_PX.Rows[dgv_PX.Rows.Count - 1].Cells["cl_Name"].Value = f_row["wjtm"].ToString(); index++; } } } else if (Flg == 1) { BLL.T_CellAndEFile_BLL CellAndEFile_BLL = new ERM.BLL.T_CellAndEFile_BLL(); IList <MDL.T_CellAndEFile> CellAndEFile_List = CellAndEFile_BLL.FindByGdFileID(ParentID, Globals.ProjectNO); int index = 1; foreach (MDL.T_CellAndEFile ef_MDL in CellAndEFile_List) { dgv_PX.Rows.Add(); dgv_PX.Rows[dgv_PX.Rows.Count - 1].Cells["cl_ID"].Value = ef_MDL.CellID; dgv_PX.Rows[dgv_PX.Rows.Count - 1].Cells["cl_Index"].Value = index; dgv_PX.Rows[dgv_PX.Rows.Count - 1].Cells["cl_Name"].Value = ef_MDL.title; index++; } } }
private void frmDelInfo_Shown(object sender, EventArgs e) { if (_Action_Flg == 1) { TreeNode nodeGD = new TreeNode(); nodeGD.Text = _TNode.Text; nodeGD.Tag = _TNode.Name; nodeGD.SelectedImageIndex = 1; nodeGD.ImageIndex = 1; nodeGD.Name = _TNode.Name; (new TreeFactory()).InitGDTree(Globals.ProjectNO, _TreeNodeState_flg, nodeGD, true, 2, true); //BLL.T_FileList_BLL FileList_BLL = new BLL.T_FileList_BLL(); ////归档类别 //DataTable tbl_FileInfo = FileList_BLL.GetFileByGDID(Globals.ProjectNO, _TNode.Name); //if (tbl_FileInfo != null) //{ // foreach (DataRow f_row in tbl_FileInfo.Rows) // { // TreeNode File_Node = new TreeNode(); // File_Node.Text = f_row["wjtm"].ToString(); // File_Node.Tag = f_row["FileID"].ToString(); // File_Node.StateImageKey = f_row["filepath"].ToString(); // File_Node.Name = f_row["FileID"].ToString(); // int fileStatus = MyCommon.ToInt(f_row["fileStatus"]); // if (fileStatus == 6) // File_Node.SelectedImageIndex = 4;//组卷 // else // { // if (fileStatus == 4)//判断是否登记 // File_Node.SelectedImageIndex = 5; // else // { // if (isShowEFileCount) // tNode.SelectedImageIndex = (EfileCount_flg == true) ? 7 : 2;//判断是否有电子文件 // else // { // DataRow[] ERows = dTable2.Select("FileID='" + tNode.Name + "' AND DoStatus='1'"); // if (ERows != null && ERows.Length > 0)//判断是否有电子文件 // tNode.SelectedImageIndex = 7; // else // tNode.SelectedImageIndex = 2; // } // } // } // if (f_row["fileStatus"] != null && // f_row["fileStatus"].ToString() == "6") // { // File_Node.SelectedImageIndex = 4; // File_Node.ImageIndex = 4; // } // else // { // File_Node.SelectedImageIndex = 2; // File_Node.ImageIndex = 2; // } // nodeGD.Nodes.Add(File_Node); // } //} tv_Info.Nodes.Add(nodeGD); tv_Info.ExpandAll(); } else if (_Action_Flg == 2) { //删除电子文件 TreeNode nodeFile = new TreeNode(); nodeFile.Text = _TNode.Text; nodeFile.Tag = _TNode.Name; nodeFile.SelectedImageIndex = 1; nodeFile.ImageIndex = 1; nodeFile.Name = _TNode.Name; BLL.T_CellAndEFile_BLL cellFile = new ERM.BLL.T_CellAndEFile_BLL(); IList <MDL.T_CellAndEFile> cellList = cellFile.FindByGdFileID(_TNode.Name, Globals.ProjectNO); foreach (MDL.T_CellAndEFile obj in cellList) { TreeNodeEx cnode = new TreeNodeEx(); cnode.Text = obj.title; cnode.Name = obj.CellID; cnode.NodeValue = obj.filepath; cnode.ImageIndex = 3; cnode.SelectedImageIndex = 3; nodeFile.Nodes.Add(cnode); } tv_Info.Nodes.Add(nodeFile); tv_Info.ExpandAll(); } }
private void CreateFile(string TableName, string ID, string TempSavePath) { if (TableName == "T_FileList") { BLL.T_FileList_BLL fileBLL = new ERM.BLL.T_FileList_BLL(); MDL.T_FileList fileMDL = fileBLL.Find(ID, Globals.ProjectNO); if (fileMDL != null) { List <MDL.T_FileList> fileList = new List <ERM.MDL.T_FileList>(); fileList.Add(fileMDL); DataTable ds = MyCommon.ToDataTable <MDL.T_FileList>(fileList); ds.TableName = "T_FileList_" + ID; ds.WriteXml(TempSavePath + "\\T_FileList\\" + ID + ".xml", XmlWriteMode.WriteSchema); lblTitle.Text = @"正在导出:" + fileMDL.wjtm; if (!string.IsNullOrEmpty(fileMDL.filepath) && System.IO.File.Exists(Globals.ProjectPath + fileMDL.filepath))//pdf文件 { System.IO.File.Copy(Globals.ProjectPath + fileMDL.filepath, TempSavePath + "\\T_CellAndEFile\\" + fileMDL.filepath, true); } } else { MDL.T_GdList gdList_MDL = (new BLL.T_GdList_BLL()).FindIDAndProjectNo(ID, Globals.ProjectNO); if (gdList_MDL != null) { List <MDL.T_GdList> GdList = new List <ERM.MDL.T_GdList>(); GdList.Add(gdList_MDL); DataTable ds = MyCommon.ToDataTable <MDL.T_GdList>(GdList); ds.TableName = "T_GdList_" + ID; ds.WriteXml(TempSavePath + "\\T_GdList\\" + ID + ".xml", XmlWriteMode.WriteSchema); lblTitle.Text = @"正在导出:" + gdList_MDL.GdName; } } if (curIndex < progressBar1.Maximum) { progressBar1.Value = curIndex++; } else { progressBar1.Value = progressBar1.Maximum - 1; } Application.DoEvents(); } else if (TableName == "T_CellAndEFile") { BLL.T_CellAndEFile_BLL cellBLL = new ERM.BLL.T_CellAndEFile_BLL(); IList <MDL.T_CellAndEFile> cellList = cellBLL.FindByGdFileID(ID, Globals.ProjectNO); if (cellList.Count > 0) { ///移除没有保存的电子表格 // for (int i = 0; i < cellList.Count; i++) // { // if (cellList[i].DoStatus != 1) // { // cellList.RemoveAt(i); // i--; // } // } if (cellList.Count > 0) { BLL.T_CellFileTemplate_BLL cellTplBLL = new ERM.BLL.T_CellFileTemplate_BLL(); foreach (MDL.T_CellAndEFile cellMDL in cellList) { if (cellMDL.filepath == null || cellMDL.filepath.Trim() == "") { MDL.T_CellFileTemplate cellTplMDL = cellTplBLL.Find(cellMDL.CellID); if (cellTplMDL != null) { string CelllTplFile = Application.StartupPath + "\\Template" + cellTplMDL.filepath; if (System.IO.File.Exists(CelllTplFile)) { FileInfo fileInfo = new FileInfo(CelllTplFile); string NewCellFileID = cellMDL.CellID; cellMDL.filepath = "ODOC\\" + NewCellFileID + fileInfo.Extension; string NewCellFile = TempSavePath + "\\T_CellAndEFile\\ODOC\\" + NewCellFileID + fileInfo.Extension; System.IO.File.Copy(CelllTplFile, NewCellFile, true); } } } else { if (System.IO.File.Exists(Globals.ProjectPath + cellMDL.filepath))//原件 { System.IO.File.Copy(Globals.ProjectPath + cellMDL.filepath, TempSavePath + "\\T_CellAndEFile\\" + cellMDL.filepath, true); } if (System.IO.File.Exists(Globals.ProjectPath + cellMDL.fileTreePath))//pdf文件 { System.IO.File.Copy(Globals.ProjectPath + cellMDL.fileTreePath, TempSavePath + "\\T_CellAndEFile\\" + cellMDL.fileTreePath, true); } } } DataTable ds2 = MyCommon.ToDataTable <MDL.T_CellAndEFile>(cellList); ds2.TableName = "T_CellAndEFile_" + ID; ds2.WriteXml(TempSavePath + "\\T_CellAndEFile\\" + ID + ".xml", XmlWriteMode.WriteSchema); } } if (curIndex < progressBar1.Maximum) { progressBar1.Value = curIndex++; } else { progressBar1.Value = progressBar1.Maximum - 1; } Application.DoEvents(); } }