Exemple #1
0
        public MDL.T_GdList FindID(String ID)
        {
            String stmtId = "T_GdList.FindID";

            MDL.T_GdList temp_MDL = new MDL.T_GdList();
            temp_MDL.ID = ID;
            MDL.T_GdList result = MyISqlMap.QueryForObject <MDL.T_GdList>(stmtId, temp_MDL);
            return(result);
        }
Exemple #2
0
        public void Update(MDL.T_GdList obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "T_GdList.Update";

            MyISqlMap.Update(stmtId, obj);
        }
Exemple #3
0
        public MDL.T_GdList FindIDAndProjectNo(String ID, string ProjectNo)
        {
            String stmtId = "T_GdList.FindIDAndProjectNo";

            MDL.T_GdList temp_MDL = new MDL.T_GdList();
            temp_MDL.ID        = ID;
            temp_MDL.ProjectNo = ProjectNo;
            MDL.T_GdList result = MyISqlMap.QueryForObject <MDL.T_GdList>(stmtId, temp_MDL);
            return(result);
        }
Exemple #4
0
        public void Delete(String ID)
        {
            if (ID == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "T_GdList.Delete";

            MDL.T_GdList obj = new MDL.T_GdList();
            obj.ID = ID;
            MyISqlMap.Delete(stmtId, obj);
        }
Exemple #5
0
        public void Insert(MDL.T_GdList obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            String stmtId = "T_GdList.Insert";

            obj.ProjectCategory = new T_Projects_BLL().Find(obj.ProjectNo).ProjectCategory;

            MyISqlMap.Insert(stmtId, obj);
        }
Exemple #6
0
        public IList <MDL.T_GdList> FindByProjectNo(string ProjectNo)
        {
            String stmtId = "T_GdList.FindByProjectNo";

            MDL.T_GdList obj = new MDL.T_GdList();
            obj.ProjectNo = ProjectNo;

            T_Projects_BLL       BLL    = new T_Projects_BLL();
            IList <MDL.T_GdList> result = MyISqlMap.QueryForList <MDL.T_GdList>(stmtId, obj);

            return(result);
        }
Exemple #7
0
        public int GetMaxTemplateOrderIndex(string ProjectNo)
        {
            MDL.T_GdList obj    = new MDL.T_GdList();
            String       stmtId = "T_GdList.GetMaxTemplateOrderIndex";

            obj.ProjectNo = ProjectNo;
            object result = MyISqlMap.QueryForObject(stmtId, obj);

            if (result == null)
            {
                result = "0";
            }
            return(int.Parse(result.ToString()));
        }
Exemple #8
0
        /// <summary>
        /// 获取显示的归档列表
        /// </summary>
        private void CreateCheckBokList()
        {
            IList <MDL.T_GdList> gd_list
                = (new BLL.T_GdList_BLL()).FindByProjectNo(Globals.ProjectNO);

            TXCheckBox ckb_gd = null;
            Point      p      = new Point();

            p.X = 30;

            for (int i = 0; i < gd_list.Count; i++)
            {
                MDL.T_GdList gd_mdl = gd_list[i];
                if (gd_mdl.IsShow == 0)
                {
                    gd_list.Remove(gd_mdl);
                    i--;
                    continue;
                }
                if (i > 0 && i % 7 == 0)
                {
                    p.X += 247;
                    p.Y  = 15;
                }
                else
                {
                    if (i == 0)
                    {
                        p.Y = 15;
                    }
                    else
                    {
                        p.Y += 40;
                    }
                }
                ckb_gd          = new TXCheckBox();
                ckb_gd.Name     = gd_mdl.ID;
                ckb_gd.Text     = gd_mdl.GdName;
                ckb_gd.Location = p;
                if (string.Compare(ckb_gd.Name, _gdID) == 0)
                {
                    ckb_gd.Checked = true;
                }
                this.pl_gd.Controls.Add(ckb_gd);
                ckb_gd.CheckedChanged += new EventHandler(this.CheckBox_CheckedChanged);
            }
        }
Exemple #9
0
        public void CopyFileAndEFileList(string s_projectNO, string t_projectNO)
        {
            MDL.T_FileList obj = new MDL.T_FileList();
            obj.ProjectNO = s_projectNO;
            obj.ParentID  = t_projectNO;
            String stmtId = "T_FileList.CopyFileListByProjectNO";

            MyISqlMap.QueryForObject <int>(stmtId, obj);

            MDL.T_CellAndEFile obj2 = new MDL.T_CellAndEFile();
            obj2.ProjectNO = s_projectNO;
            obj2.FileID    = t_projectNO;
            stmtId         = "T_CellAndEFile.CopyCellFileListByProjectNO";
            MyISqlMap.QueryForObject <int>(stmtId, obj2);


            MDL.T_GdList obj3 = new MDL.T_GdList();
            obj3.ProjectNo = s_projectNO;
            obj3.ID        = t_projectNO;
            stmtId         = "T_GdList.CopyGdFileByProjectNO";
            MyISqlMap.QueryForObject <int>(stmtId, obj3);
        }
Exemple #10
0
        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();
            }
        }