Exemplo n.º 1
0
        /// <summary>
        /// 作用:当单击登录界面的登录按钮,响应事件。
        /// 思路:如果用户身份合法,则给予登录,关闭当前界面并打开主界面;否则提示用户名、密码错误。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (CheckText())
            {
                if (this.cmb_ImgEquipment.Text.ToString() != GetConfig.ImgEquipment)
                {
                    GetConfig.SetImgEquipment(this.cmb_ImgEquipment.Text.ToString());        //回写配置文件默认的机器名
                    GetConfig.ImgEquipment = this.cmb_ImgEquipment.Text.ToString();
                }
                if (CheckUser())
                {
                    try
                    {
                        BUser buser = new BUser();
                        this.user = buser.GetModel(this.txt_DoctorId.Text.Trim().ToString());    //获取该用户信息
                    }
                    catch (Exception ex)
                    {
                        MessageBoxEx.Show(ex.Message);
                    }
                    this.Visible = false;
                    frmMainForm fp = new frmMainForm(this.user);
                    fp.Show();
                }
                else
                {
                    MessageBoxEx.Show("用户名、密码不正确,请重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.txt_Pwd.Text = "";
                    this.txt_Pwd.Focus();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 主界面构造函数1,根据配置文件的设置,初始化可停靠窗体
        /// </summary>
        /// <param name="user"></param>
        public frmMainForm(IModel user)
        {
            InitializeComponent();
            this.Text        = GetConfig.HospitalName;
            this.frmDockList = new List <DockForm>();
            myMainForm       = this;
            iUser            = user;
            Extender.SetSchema(this.dockPanel, BaseControls.Docking.Extender.Schema.FromBase);
            m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
            if (GetConfig.DALAndModel == "SIS")
            {
                SIS_Model.MUser muser = (SIS_Model.MUser)iUser;
                this.tssl_User.Text = muser.DOCTOR_NAME;
                this.tssl_Dept.Text = muser.CLINIC_OFFICE;
                BuildStruct();
                this.initExamInfText();
                iGather = (frmImageGather)this.SetFormDisplay("图像采集", "SIS.frmImageGather");
                qQuery  = (frmQuickQuery)this.SetFormDisplay("快速查询", "SIS.frmQuickQuery");
            }
            else
            {
                PACS_Model.MUser muser = (PACS_Model.MUser)iUser;
                this.tssl_User.Text    = muser.USER_NAME;
                this.tssl_Dept.Text    = muser.DEPT_NAME;
                this.p_Patient.Visible = false;
                switch (GetConfig.SystemType)
                {
                case "DeptManage":
                    BuildStructPacsDeptManage();
                    break;

                case "Register":
                    BuildStructPacs();
                    qQuery = (frmQuickQuery)this.SetFormDisplay("快速查询", "SIS.frmQuickQuery");
                    break;

                case "QualityControl":
                    BuildStructPacsQualityControl();
                    break;
                }
            }
            this.timer_Main.Start();
            string configFile = Application.StartupPath + "\\Config\\MainDockPanel.config";

            if (File.Exists(configFile))
            {
                dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
            }
            for (int i = 0; i < this.frmDockList.Count; i++)
            {
                if (!frmDockList[i].isShow)
                {
                    frmDockList[i].frmDock.Show(this.dockPanel, BaseControls.Docking.DockState.DockLeft);
                }
            }
        }
Exemplo n.º 3
0
 public frmMainForm()
 {
     InitializeComponent();
     myMainForm = this;
 }