Exemplo n.º 1
0
        public void setXmlInfo(System.Xml.XmlDocument To_JavaXml, System.Xml.XmlElement engBaseInfo, MDL.T_Projects project = null, System.Xml.XmlElement root = null)
        {
            XmlElement eFileINfo = To_JavaXml.CreateElement("eFileInfo");

            engBaseInfo.AppendChild(eFileINfo);
            List <T_Model> outList = new List <T_Model>();

            outList = ProjectXML_Factory.setXmlInfo(To_JavaXml, project, "queryByProjectNo", eFileINfo, "YW_CellAndEFile", "  where ProjectNo='" + project.ProjectNO + "' and cellid='" + obj.CellID + "'");

            if (outList != null)
            {
                foreach (var item in outList)
                {
                    XmlNodeList xmlList = eFileINfo.GetElementsByTagName(item.MappColumn);

                    if (xmlList.Count == 0)
                    {
                        X_temp = To_JavaXml.CreateElement(item.MappColumn);
                    }
                    else
                    {
                        continue;
                    }
                    switch (item.MappColumn)
                    {
                    case "FILENAME":    //文件名
                        X_temp.SetAttribute("value", fileName);
                        break;

                    case "FILEPATH":    //文件路径
                        X_temp.SetAttribute("value", filePath);
                        break;

                    case "FileSize":    //文件大小
                        FileStream st = new FileStream(Globals.ProjectPath + obj.filepath, FileMode.Open, FileAccess.Read);
                        X_temp.SetAttribute("value", st.Length.ToString());
                        st.Close();
                        st.Dispose();
                        break;

                    case "ORDER_RANK":
                        X_temp.SetAttribute("value", orderIndex);
                        break;

                    default:
                        X_temp.SetAttribute("value", item.Default);
                        break;
                    }
                    // X_temp.SetAttribute("description", item.Description);
                    eFileINfo.AppendChild(X_temp);
                }
            }
        }
Exemplo n.º 2
0
        public void setXmlInfo(System.Xml.XmlDocument To_JavaXml, System.Xml.XmlElement engBaseInfo, MDL.T_Projects project = null, System.Xml.XmlElement root = null)
        {
            List <T_Model> outList = new List <T_Model>();

            outList = ProjectXML_Factory.setXmlInfo(To_JavaXml, project, "queryByProjectNo", engBaseInfo, "Project", " where ProjectNo='" + project.ProjectNO + "'");

            List <string> list = new List <string>();//单位

            list.AddRange(new string[] { "initiationApprovalOrgSid", "developmentsOrgName", "designOrgSid", "reconnaissanceOrgSid", "supervisionOrgSid", "reconnaissanceOrgBy", "subpackageOrgBy", "subpackageOrgName", "constructOrgBy", "constructOrgName", "jldw_xmzj", "constructOrgSid", "supervisionOrgName", "designOrgName", "jldw_xmfzr" });

            if (outList != null)
            {
                foreach (var item in outList)
                {
                    if (list.Contains(item.MappColumn))
                    {
                        ProjectXML_Factory.FieldMethod(To_JavaXml, item, item.Column, ref X_temp, projectFactory);
                    }
                    else
                    {
                        X_temp = To_JavaXml.CreateElement(item.MappColumn);
                        X_temp.SetAttribute("value", item.Default);
                    }
                    engBaseInfo.AppendChild(X_temp);
                }
            }
        }
Exemplo n.º 3
0
        public void setXmlInfo(System.Xml.XmlDocument To_JavaXml, System.Xml.XmlElement engBaseInfo, MDL.T_Projects project = null, System.Xml.XmlElement root = null)
        {
            List <T_Model> outList = new List <T_Model>();

            outList = ProjectXML_Factory.setXmlInfo(To_JavaXml, project, "queryByItemID", engBaseInfo, "Item", " and a.ItemID='" + project.ItemID + "'");
            List <string> list2 = new List <string>();

            list2.AddRange(new string[] { "xmdesignOrgSidtmp", "xmreconnaissanceOrgSidtmp", "xmsupervisionOrgSidtmp" });

            XmlElement X_temp = null;

            if (outList != null)
            {
                foreach (var item in outList)
                {
                    if (list2.Contains(item.MappColumn))
                    {
                        ProjectXML_Factory.FieldMethod(To_JavaXml, item, item.Column, ref X_temp, projectFactory);
                    }
                    else
                    {
                        X_temp = To_JavaXml.CreateElement(item.MappColumn);
                        X_temp.SetAttribute("value", item.Default);
                    }

                    //X_temp.SetAttribute("description", item.Description==null?"":item.Description.ToString());
                    engBaseInfo.AppendChild(X_temp);
                }
            }
        }
Exemplo n.º 4
0
        public void setXmlInfo(System.Xml.XmlDocument To_JavaXml, System.Xml.XmlElement engBaseInfo, MDL.T_Projects project = null, System.Xml.XmlElement root = null)
        {
            List <T_Model> outList = new List <T_Model>();

            outList = ProjectXML_Factory.setXmlInfo(To_JavaXml, project, "queryByProjectNO", engBaseInfo, "Archive", " where ProjectNO='" + project.ProjectNO + "'");
            List <string> list = new List <string>();

            if (outList != null)
            {
                foreach (var item in outList)
                {
                    XmlNodeList xmlList = engBaseInfo.GetElementsByTagName(item.MappColumn);

                    if (xmlList.Count == 0)
                    {
                        X_temp = To_JavaXml.CreateElement(item.MappColumn);
                    }
                    else
                    {
                        continue;
                    }

                    if (item.MappColumn == "archWidth")
                    {
                        string jhlx = obj.jhlx.Replace("公分案卷盒", "");
                        jhlx = jhlx.Replace("公分", "");
                        jhlx = jhlx.Replace("案卷盒", "");
                        X_temp.SetAttribute("value", jhlx);
                    }
                    else
                    {
                        X_temp.SetAttribute("value", item.Default);
                    }

                    X_temp.SetAttribute("description", item.Description);
                    engBaseInfo.AppendChild(X_temp);
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        private bool SaveData()
        {
            if (string.IsNullOrEmpty(this.txtConStructionProjectName.Text))
            {
                TXMessageBoxExtensions.Info("提示:项目名称不能为空!");
                this.tabControl1.SelectedTab = tabPage4;
                txtConStructionProjectName.Focus();
                return(false);
            }


            if (string.IsNullOrEmpty(this.txtConstructionProjectAdd.Text))
            {
                TXMessageBoxExtensions.Info("提示:项目地址不能为空!");
                this.tabControl1.SelectedTab = tabPage4;
                txtConstructionProjectAdd.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(this.txtCreateUnit.Text))
            {
                TXMessageBoxExtensions.Info("提示:项目建设单位不能为空!");
                this.tabControl1.SelectedTab = tabPage4;
                txtCreateUnit.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(this.txtPZDW.Text))
            {
                TXMessageBoxExtensions.Info("提示:立项批准单位不能为空!");
                this.tabControl1.SelectedTab = tabPage4;
                txtPZDW.Focus();
                return(false);
            }

            if (this.cboProjectType.SelectedIndex == -1)
            {
                TXMessageBoxExtensions.Info("提示:工程类型必须选择!");
                this.tabControl1.SelectedTab = tabPage4;
                return(false);
            }
            if (txtProjectNo.Text.Trim() == "")
            {
                TXMessageBoxExtensions.Info("提示:工程编号必须填写!");
                this.tabControl1.SelectedTab = tabPage1;
                this.txtProjectNo.Focus();
                return(false);
            }
            if (!MyCommon.isYesProjectNo(txtProjectNo.Text.Trim()))
            {
                TXMessageBoxExtensions.Info("提示:工程编号格式错误!\n【温馨提示:工程编号只允许输入数字,字母,下划线,横线】");
                this.tabControl1.SelectedTab = tabPage1;
                txtProjectNo.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(txtProjectName.Text))
            {
                TXMessageBoxExtensions.Info("提示:工程名称不能为空!");
                this.tabControl1.SelectedTab = tabPage1;
                txtProjectName.Focus();
                return(false);
            }

            if (cboDistrict.SelectedValue.ToString() == "" || string.IsNullOrEmpty(this.txtAddress.Text))
            {
                TXMessageBoxExtensions.Info("提示:工程地址不能为空!");
                this.tabControl1.SelectedTab = tabPage1;
                txtAddress.Focus();
                return(false);
            }

            if (dtpBeginDate.TextEx == "")
            {
                TXMessageBoxExtensions.Info("提示:开工日期必须填写!\n");
                this.tabControl1.SelectedTab = tabPage1;
                dtpBeginDate.Focus();
                return(false);
            }

            if (dtpEndDate.TextEx == "")
            {
                TXMessageBoxExtensions.Info("提示:竣工日期必须填写!\n");
                this.tabControl1.SelectedTab = tabPage1;
                dtpEndDate.Focus();
                return(false);
            }

            //验证单位
            if (!isCheckUnit(new List <TXTextBoxEX>()
            {
                this.txtJsdw, this.txtLxpzdw, this.txtSjdw, this.txtKcdw, this.txtSgdw, this.txtJldw
            },
                             new string[] { "建设", "立项批准", "设计", "勘察", "施工", "监理" }))
            {
                return(false);
            }

            if (txtGhcode.Text == "")
            {
                TXMessageBoxExtensions.Info("提示:工程规划许可证号必须填写!\n");
                this.tabControl1.SelectedTab = tabPage1;
                txtGhcode.Focus();
                return(false);
            }

            if (ProjectNO == "")//不是编辑
            {
                ERM.BLL.T_Projects_BLL ProjectDB = new ERM.BLL.T_Projects_BLL();
                if (ProjectDB.Exists(txtProjectNo.Text.Trim()))
                {
                    TXMessageBoxExtensions.Info("提示:工程编号有重复的请重新填写!");
                    this.tabControl1.SelectedTab = tabPage1;
                    txtProjectNo.Focus();
                    return(false);
                }
                if (txtProjectName.Text.Trim() != "" &&
                    ProjectDB.ExistsName(txtProjectName.Text.Trim()))
                {
                    TXMessageBoxExtensions.Info("提示:工程名称有重复的请重新填写!");
                    this.tabControl1.SelectedTab = tabPage1;
                    txtProjectName.Focus();
                    return(false);
                }
            }

            if ((!String.IsNullOrEmpty(this.dtpBeginDate.TextEx)) && dtpBeginDate.TextEx != "")
            {
                if (this.dtpEndDate.TextEx != "" &&
                    (!this.dtpBeginDate.TextEx.Equals(this.dtpEndDate.TextEx)) &&
                    (MyCommon.ToDate(dtpBeginDate.TextEx) >
                     MyCommon.ToDate(dtpEndDate.TextEx)))
                {
                    TXMessageBoxExtensions.Info("提示:工程基本信息:开工日期 必须小于 竣工日期!");
                    this.tabControl1.SelectedTab = tabPage1;
                    this.dtpEndDate.Focus();
                    return(false);
                }
            }

            projectMDL = obj.GetInfo(ProjectNo, projectMDL, 1) as T_Projects;

            projectMDL.ProjectNO       = MyCommon.ToSqlString(txtProjectNo.Text);   //工程编号
            projectMDL.district        = MyCommon.ToSqlString(cboDistrict.Text);    //所属区域
            projectMDL.projectname     = MyCommon.ToSqlString(txtProjectName.Text); //工程名称
            projectMDL.address         = MyCommon.ToSqlString(txtAddress.Text);     //工程地址
            projectMDL.ajdh            = MyCommon.ToSqlString(txtysbah.Text);       //验收备案号
            projectMDL.ProjectCategory = cboProjectType.SelectedValue.ToString();
            projectMDL.begindate       = dtpBeginDate.TextEx;                       //开工时间
            projectMDL.enddate         = dtpEndDate.TextEx;                         //竣工时间
            projectMDL.ghcode          = MyCommon.ToSqlString(txtGhcode.Text);
            projectMDL.sgcode          = MyCommon.ToSqlString(txtSgcode.Text);
            projectMDL.tbr             = Globals.Fullname;

            //projectMDL.ydpzcode = MyCommon.ToSqlString(txtYdpzcode.Text);
            projectMDL.ydxkcode = MyCommon.ToSqlString(txtYdghxkCode.Text);
            SetItemInfo(itemMDL.ItemID, 1);

            if (this.ProjectNO == "")
            {
                projectMDL.createdate = DateTime.Now.ToString("yyyy.MM.dd");
                itemMDL.ItemID        = Guid.NewGuid().ToString();
                projectMDL.ItemID     = itemMDL.ItemID;
                SaveUnit();
                if (!obj.Add(projectMDL, itemMDL))
                {
                    TXMessageBoxExtensions.Info("保存失败!");
                    return(false);
                }
                this.ProjectNO       = txtProjectNo.Text;
                txtProjectNo.Enabled = false;
                try
                {
                    System.IO.Directory.CreateDirectory(Globals.ProjectPathParent + MyCommon.ToSqlString(txtProjectNo.Text));
                }
                catch
                {
                    TXMessageBoxExtensions.Info("发生错误,请检查存放电子文件的目录是否存在及可写!");
                }
            }
            else
            {
                SaveUnit();
                if (!obj.Updates(projectMDL, itemMDL))
                {
                    TXMessageBoxExtensions.Info("保存失败!");
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 6
0
        private void Init()
        {
            ProjectBind();//页面绑定方法
            ERM.BLL.T_Dict_BLL dicData = new ERM.BLL.T_Dict_BLL();
            BLL.District       bll1    = new ERM.BLL.District();
            DataSet            ds      = bll1.GetAllList();

            cboDistrict.DisplayMember = "DistrictName";
            cboDistrict.ValueMember   = "DistrictName";
            cboDistrict.DataSource    = ds.Tables[0];
            if (cboDistrict.Items.Count > 0)
            {
                cboDistrict.SelectedIndex = 0;
            }

            ds3 = dicData.FindByKeyWord("ProjectCategory");
            cboProjectType.DisplayMember = "displayname";
            cboProjectType.ValueMember   = "valuename";
            cboProjectType.DataSource    = ds3;

            if (ProjectNo != "")                     //编辑模式
            {
                txtProjectNo.Enabled        = false; //修改时,不允许修改项目编号,保证唯一性
                this.cboProjectType.Enabled = false;

                //修改 判断是否有权限修改工程编号与名称
                if (!MyCommon.CheckProjectBind())
                {
                    txtProjectNo.Enabled   = false;
                    txtProjectName.Enabled = false;
                }

                projectMDL = (new BLL.T_Projects_BLL()).Find(ProjectNo);
                if (projectMDL != null)
                {
                    itemMDL = (new ERM.BLL.T_Item_BLL()).Find(projectMDL.ItemID);
                    loadItemInfo();
                    txtProjectNo.Text            = projectMDL.ProjectNO;                                   //工程代码
                    cboDistrict.Text             = projectMDL.district == null ? "" : projectMDL.district; //区域
                    txtProjectName.Text          = projectMDL.projectname;                                 //工程名称
                    txtAddress.Text              = projectMDL.address == null ? "" : projectMDL.address;   //工程地址
                    cboProjectType.SelectedValue = projectMDL.ProjectCategory;
                    //txtYdpzcode.Text = projectMDL.ydpzcode == null ? "" : projectMDL.ydpzcode; //工程用地批准书号
                    txtYdghxkCode.Text  = projectMDL.ydxkcode == null ? "" : projectMDL.ydxkcode;     //用地规划许可证号
                    txtGhcode.Text      = projectMDL.ghcode == null ? "" : projectMDL.ghcode;         //规划许可证号
                    txtSgcode.Text      = projectMDL.sgcode == null ? "" : projectMDL.sgcode;         //工程施工许可证号
                    txtysbah.Text       = projectMDL.ajdh == null?"":projectMDL.ajdh;                 //验收备案号
                    dtpBeginDate.TextEx = projectMDL.begindate == null ? "" : (projectMDL.begindate); //开工日期
                    dtpEndDate.TextEx   = projectMDL.enddate == null ? "" : projectMDL.enddate;

                    //this.txtajdh.Text = projectMDL.ajdh.ToString();
                    this.cboProjectType.SelectedValue = projectMDL.ProjectCategory;//根据工程类型显示扩展信息
                }
            }
            else
            {
                this.cboProjectType.SelectedIndex = 0;
                projectMDL = new ERM.MDL.T_Projects();
                itemMDL    = new ERM.MDL.T_Item();
            }
            LoadDataFromView("");
            BindUnit();
        }
Exemplo n.º 7
0
        public void setXmlInfo(System.Xml.XmlDocument XmlDoc, System.Xml.XmlElement xmlNode, MDL.T_Projects project, System.Xml.XmlElement element = null)
        {
            T_Point_BLL     bll  = new T_Point_BLL();
            IList <T_Point> list = bll.GetList(project.ProjectNO);

            foreach (var pointItem in list)
            {
                XmlElement fileInfo = XmlDoc.CreateElement("pointInfo");
                xmlNode.AppendChild(fileInfo);
                List <T_Model> outList = new List <T_Model>();
                outList = ProjectXML_Factory.setXmlInfo(XmlDoc, project, "queryByProjectID", fileInfo, "Point", " where ProjectNo='" + project.ProjectNO + "' and id='" + pointItem.ID + "'");

                if (outList != null)
                {
                    foreach (var item in outList)
                    {
                        XmlElement X_temp = XmlDoc.CreateElement(item.MappColumn);
                        X_temp.SetAttribute("value", item.Default);
                        X_temp.SetAttribute("description", item.Description);
                        fileInfo.AppendChild(X_temp);
                    }
                }
            }
        }
Exemplo n.º 8
0
        public void setXmlInfo(System.Xml.XmlDocument To_JavaXml, System.Xml.XmlElement engBaseInfo, MDL.T_Projects project = null, System.Xml.XmlElement root = null)
        {
            //XmlElement brigeInfo = To_JavaXml.CreateElement("BrigeInfo");
            //engBaseInfo.AppendChild(brigeInfo);
            List <T_Model> outList = new List <T_Model>();

            outList = ProjectXML_Factory.setXmlInfo(To_JavaXml, project, "queryByProjectID", engBaseInfo, "Brige", " where ProjectID='" + project.ProjectNO + "'");

            if (outList != null)
            {
                foreach (var item in outList)
                {
                    XmlElement X_temp = To_JavaXml.CreateElement(item.MappColumn);
                    X_temp = To_JavaXml.CreateElement(item.MappColumn);
                    X_temp.SetAttribute("value", item.Default);
                    engBaseInfo.AppendChild(X_temp);
                }
            }
        }
Exemplo n.º 9
0
        public void setXmlInfo(System.Xml.XmlDocument To_JavaXml, System.Xml.XmlElement engBaseInfo, MDL.T_Projects project = null, System.Xml.XmlElement root = null)
        {
            XmlElement fileInfo = To_JavaXml.CreateElement("fileInfo");

            engBaseInfo.AppendChild(fileInfo);
            List <T_Model> listModel = ProjectXML_Factory.setXmlInfo(To_JavaXml, project, "queryByFileNo", fileInfo, "File", " where ProjectNO='" + project.ProjectNO + "' and FileID='" + obj.FileID + "'");

            //判断文件是否有电子扫描件,有就扫描件拷贝到指定目录
            if (!String.IsNullOrEmpty(obj.filepath) && obj.filepath != "")
            {
                string efile = System.IO.Path.Combine(Globals.ProjectPath, obj.filepath);

                if (System.IO.File.Exists(efile))
                {
                    //PDF 存储拷贝
                    string pdfPath      = @"/efile/" + archIndex.ToString();
                    string pdfOurcePath = @"/yw/" + archIndex.ToString() + "/" + fileIndex.ToString();

                    string pdfName = Globals.ProjectNO + "-" + archIndex.ToString().PadLeft(4, '0')
                                     + "-" + fileIndex.ToString().PadLeft(4, '0') + ".pdf";
                    string outfile = tempPath + "\\efile\\" + archIndex.ToString() + "\\" + pdfName;

                    System.IO.File.Copy(efile, outfile, true);

                    if (listModel != null)
                    {
                        foreach (var item in listModel)
                        {
                            XmlNodeList xmlList = fileInfo.GetElementsByTagName(item.MappColumn);

                            if (xmlList.Count == 0)
                            {
                                X_temp = To_JavaXml.CreateElement(item.MappColumn);
                            }
                            else
                            {
                                continue;
                            }

                            switch (item.MappColumn)
                            {
                            case "pdfPath":    //PDF电子文件路径
                                X_temp.SetAttribute("value", pdfPath);
                                break;

                            case "pdfFilename":    //电子文件名称
                                X_temp.SetAttribute("value", pdfName);
                                break;

                            case "pdfSourcePath":     //原文
                                X_temp.SetAttribute("value", pdfOurcePath);
                                break;

                            default:
                                X_temp.SetAttribute("value", item.Default);
                                break;
                            }

                            //X_temp.SetAttribute("description", item.Description);
                            fileInfo.AppendChild(X_temp);
                        }
                    }

                    #region 原文 拷贝
                    IList <MDL.T_CellAndEFile> EFileList =
                        (new BLL.T_CellAndEFile_BLL()).FindByGdFileID(obj.FileID, Globals.ProjectNO);
                    int efileIndex = 1;
                    foreach (MDL.T_CellAndEFile efile_MDL in EFileList)
                    {
                        string ywfile = Globals.ProjectPath + efile_MDL.filepath;
                        if (System.IO.File.Exists(ywfile))
                        {
                            string fileExtension = System.IO.Path.GetExtension(ywfile);

                            outfile = tempPath + "\\yw\\" +
                                      archIndex.ToString() + "\\" + fileIndex + "\\" +
                                      efileIndex + fileExtension;
                            //拷贝电子文件
                            System.IO.File.Copy(ywfile, outfile, true);


                            GetEFileXE(efile_MDL, To_JavaXml, fileInfo, "\\yw\\" +
                                       archIndex.ToString() + "\\" + fileIndex + "\\" +
                                       efileIndex + fileExtension, efileIndex + fileExtension, efileIndex.ToString(), project);

                            efileIndex++;
                        }
                    }
                    #endregion
                }
            }
            else
            {
                if (listModel != null)
                {
                    foreach (var item in listModel)
                    {
                        XmlNodeList xmlList = fileInfo.GetElementsByTagName(item.MappColumn);

                        if (xmlList.Count == 0)
                        {
                            X_temp = To_JavaXml.CreateElement(item.MappColumn);
                        }
                        else
                        {
                            continue;
                        }

                        switch (item.MappColumn)
                        {
                        case "scanFlag":     //是否扫描
                            X_temp.SetAttribute("value", "false");
                            break;

                        default:
                            X_temp.SetAttribute("value", item.Default);
                            break;
                        }

                        //X_temp.SetAttribute("description", item.Description);
                        fileInfo.AppendChild(X_temp);
                    }
                }
            }
        }