Ejemplo n.º 1
0
        /// <summary>
        /// 工程管理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiProjectSelect_Click(object sender, EventArgs e)
        {
            this.btnProjectSelect.Enabled  = false;
            this.btnFileCreate.Enabled     = false;
            this.toolStripButton2.Enabled  = false;
            this.btnProjectMaint.Enabled   = false;
            this.btnProjectArchive.Enabled = false;
            this.btnChangePass.Enabled     = false;
            this.myMenuStrip1.Enabled      = false;
            this.toolProjCombox.Enabled    = false;
            this.btnExit.Enabled           = false;
            frmProjectList frm = new frmProjectList(setComBox);
            DialogResult   drs = frm.ShowDialog();

            this.Text = Globals.AppTitle + " - " + Globals.Projectname;//Globals.ProjectNO;
            if (drs != DialogResult.OK)
            {
                ToolStripComboBox c1 = (ToolStripComboBox)myToolStrip1.Items["toolProjCombox"];
                c1.Items.Clear();
                this.btnExit.Enabled = true;
            }
            else
            {
                ToolStripComboBox c1 = (ToolStripComboBox)myToolStrip1.Items["toolProjCombox"];
                c1.Items.Clear();

                BLL.T_Projects_BLL     projBLL  = new ERM.BLL.T_Projects_BLL();
                IList <MDL.T_Projects> projList =
                    projBLL.GetAll();

                ArrayList projname_list =
                    new ArrayList();

                foreach (MDL.T_Projects obj in projList)
                {
                    //c1.Items.Add(obj.ProjectNO);
                    projname_list.Add(obj.ProjectNO + "|" + obj.projectname + "|" + obj.ajdh);
                    c1.Items.Add(obj.projectname);
                }
                c1.Tag  = projname_list;
                c1.Text = Globals.Projectname;
                ReadWriteAppConfig config = new ReadWriteAppConfig();
                config.Write("Current_Project", Globals.ProjectNO);
                config.Write("Current_ProjectAjdh", Globals.Ajdh);
            }
        }
Ejemplo n.º 2
0
        private void frmWelcome_Load(object sender, EventArgs e)
        {
            if (!MyCommon.IsCheckFD())
            {
                this.Ukey_timer.Tick -= new System.EventHandler(this.Ukey_timer_Tick);
            }
            else
            {
                this.Ukey_timer.Tick += new System.EventHandler(this.Ukey_timer_Tick);
            }

            ToolStripComboBox c1 = (ToolStripComboBox)myToolStrip1.Items["toolProjCombox"];

            BLL.T_Projects_BLL     projBLL  = new ERM.BLL.T_Projects_BLL();
            IList <MDL.T_Projects> projList = projBLL.GetAll();

            if (projList.Count <= 0)
            {
                tsmiProjectSelect.PerformClick();
            }
            else
            {
                ArrayList projname_list = new ArrayList();
                foreach (MDL.T_Projects obj in projList)
                {
                    //c1.Items.Add(obj.ProjectNO);
                    projname_list.Add(obj.ProjectNO + "|" + obj.projectname + "|" + obj.ajdh);
                    c1.Items.Add(obj.projectname);
                }
                c1.Tag = projname_list;

                if (Globals.ProjectNO == string.Empty)
                {
                    //Common.OptRegisterTable optRegTable = new OptRegisterTable();
                    //Globals.ProjectNO = optRegTable.ReadRegistData("Digipower_Current_Project");
                    ReadWriteAppConfig config = new ReadWriteAppConfig();
                    Globals.ProjectNO = config.Read("Current_Project");//Properties.Settings.Default.Current_Project;
                    Globals.Ajdh      = config.Read("Current_ProjectAjdh");
                    if (Globals.ProjectNO != null && Globals.ProjectNO != "")
                    {
                        foreach (string proj in projname_list)
                        {
                            string[] projString = proj.Split(new char[] { '|' });
                            if (projString != null && projString[0] == Globals.ProjectNO)
                            {
                                Globals.Ajdh        = projString[2];
                                Globals.Projectname = projString[1];
                                Globals.ProjectNO   = projString[0];
                                break;
                            }
                        }
                    }
                    //MDL.T_Projects projMDL = projBLL.Find(Globals.ProjectNO);
                    //if (projMDL != null)
                    //{
                    //    Globals.Projectname = projMDL.projectname;
                    //}
                }
                //c1.Text = Globals.ProjectNO;
                c1.Text = Globals.Projectname;
                if (c1.SelectedItem == null)
                {
                    tsmiProjectSelect.PerformClick();
                }
            }
            FromBind();
            Globals.SystemDocxOffice = CheckSystemOffice();
        }