Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string     ProName     = txtProName.Text.Trim();
            string     Manager     = txtManager.Text.Trim();
            Project    ProjectInfo = new Project();
            ProjectBLL pbll        = new ProjectBLL();

            if (!string.IsNullOrEmpty(ProName) && !string.IsNullOrEmpty(Manager))
            {
                if (!pbll.Check_ProjectName(ProName))
                {
                    ProjectInfo.ProNumber   = txtProNumber.Text;
                    ProjectInfo.Name        = ProName;
                    ProjectInfo.Compartment = txtProCompany.Text;
                    ProjectInfo.ProDic      = txtProDic.Text;
                    ProjectInfo.ProCoverPic = txtCoverPic.Text;
                    ProjectInfo.ProManager  = txtManager.Text;
                    ProjectInfo.ReviewDate  = txtReDate.Text;
                    ProjectInfo.CreatePer   = txtCreatePer.Text;
                    ProjectInfo.PrintState  = txtPrintState.Text;
                    ProjectInfo.PrintDate   = txtPrintState.Text;
                    ProjectInfo.ImportDate  = txtImportDate.Text;
                    ProjectInfo.ProDigest   = rtxtDigest.Text;
                    if (pbll.Add_ProjectInfo(ProjectInfo))
                    {
                        HAZOP分析系统.ProName = ProName;
                        IsNew             = true;
                        if (this.SetInitBtn != null)
                        {
                            this.SetInitBtn(this);
                        }
                        MessageBox.Show("新建成功!");
                        if (MyLoadPreparePageEvents != null)
                        {
                            MyLoadPreparePageEvents();
                        }
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("该项目名已存在,请重新输入!");
                    txtProName.Text = null;
                }
            }
            else
            {
                MessageBox.Show("请输入必要的信息!");
            }
        }