Ejemplo n.º 1
0
        private void FrmDetail_Load(object sender, EventArgs e)
        {
            //加载数据开始
            LoadController.State = "正在加载...";
            Thread.Sleep(500);
            //处理配置文件
            this.lblModality.Text = ModalityConfig.getXmlCate() + ":";
            //标记跳转到主窗口
            this.Tag = WinTag.frmSignQuery;
            var uInfo = uInfoRepository.UserInfoes.FirstOrDefault(p => p.ID == currentID);

            if (uInfo == null)
            {
                MessageBox.Show("跳转失败了");
                DialogHelper.ShowNextDlg(new Thread(delegate() { NinjectControllerFactory.Resolve <FrmSignQuery>().ShowDialog(); }));
                return;
            }
            //赋值操作
            this.lblShowModality.Text    = uInfo.modality;
            this.lblShowName.Text        = uInfo.uName;
            this.lblShowAge.Text         = uInfo.age.ToString();
            this.lblShowPhoneNum.Text    = uInfo.phoneNum.ToString();
            this.lblShowPersonIDNum.Text = uInfo.personIDNum;
            this.lblShowComment.Text     = uInfo.comment;
            this.lblShowGender.Text      = uInfo.gender;
            this.lblID.Text = uInfo.ID.ToString();
            //图片显示处理
            this.picShowMyPhoto.SizeMode = PictureBoxSizeMode.StretchImage;
            this.picShowMyPhoto.Image    = ImageHelper.BytesToImage(uInfo.photo);
            //加载完成
            LoadController.State = "加载完成...";
            Thread.Sleep(500);
            //关闭加载界面
            LoadController.Close();
        }
Ejemplo n.º 2
0
        //系统提供的事件——窗体加载处理
        private void FrmManage_Load(object sender, EventArgs e)
        {
            LoadController.State = "正在加载...";
            //配置文件处理
            this.lblModality.Text = ModalityConfig.getXmlCate() + ":";
            this.dgvPeople.Columns[2].HeaderText = ModalityConfig.getXmlCate();
            this.btnModality.Text = ModalityConfig.getXmlCateCount();

            //处理窗口之间如何跳转
            this.Tag = WinTag.frmLogin;

            //处理下拉选择框
            this.cboModality.Items.Add("全部");
            UserInfoesListViewModel model = new UserInfoesListViewModel
            {
                //类初始化器
                UserInfoes = uInfoRepository.UserInfoes,
                PagingInfo = new PagingInfo()
                {
                    ItemsPerPage = PageSize,
                    TotalItems   = uInfoRepository.UserInfoes.Count()
                }
            };

            //默认加载全部的数据
            this.cboCurrentPage.Items.Add("1");
            this.cboModality.SelectedIndex = 0;
            foreach (var p in model.UserInfoes)
            {
                this.cboGenderContext.Items.Add(p.gender);
            }
            RemoveRepeatItem(this.cboGenderContext);
            foreach (DataRowView dr in ModalityConfig.getXmlSubjectData().Tables[0].DefaultView)
            {
                var tempStr = dr["name"].ToString();
                this.cboModality.Items.Add(tempStr);
                this.cboModalityContext.Items.Add(tempStr);
            }
            //数据视图附加下拉选择框
            this.dgvPeople.Controls.Add(this.cboModalityContext);
            this.dgvPeople.Controls.Add(this.cboGenderContext);
            //加载完成
            LoadController.State = "加载完成...";
            Thread.Sleep(500);
            //关闭加载界面
            loadingFrm = LoadController.Close();
        }
Ejemplo n.º 3
0
 private void FrmSign_Load(object sender, EventArgs e)
 {
     //处理配置文件
     this.lblModality.Text = ModalityConfig.getXmlCate() + ":";
     //处理下拉选择框
     this.Tag = WinTag.frmMain;
     foreach (DataRowView dr in ModalityConfig.getXmlSubjectData().Tables[0].DefaultView)
     {
         this.cboModality.Items.Add(dr["name"].ToString());
     }
     for (int i = 70; i >= 3; i--)
     {
         this.cboAge.Items.Add("" + i);
     }
     //判断是增加还是修改。
     if (FillID == 0)
     {
         //增加时的窗体处理
         this.cboAge.SelectedIndex      = 0;
         this.cboModality.SelectedIndex = 0;
     }
     else
     {
         //修改时的窗体处理
         uInfo = uInfoRepository.UserInfoes.FirstOrDefault(p => p.ID == FillID);
         this.cboModality.Text    = uInfo.modality;
         this.txtName.Text        = uInfo.uName;
         this.txtComment.Text     = uInfo.comment;
         this.txtPhoneNum.Text    = uInfo.phoneNum;
         this.txtPersonIDNum.Text = uInfo.personIDNum;
         //性别显示
         if (uInfo.gender == "男")
         {
             rdoMale.Checked = true;
         }
         else
         {
             rdoFemale.Checked = true;
         }
         this.cboAge.Text         = uInfo.age.ToString();
         this.picMyPhoto.SizeMode = PictureBoxSizeMode.StretchImage;
         this.picMyPhoto.Image    = ImageHelper.BytesToImage(uInfo.photo);
     }
 }
        private void FrmModality_Load(object sender, EventArgs e)
        {
            //加载数据开始
            LoadController.State = "正在加载...";
            Thread.Sleep(500);
            //处理配置文件
            this.Text          = ModalityConfig.getXmlCateCount();
            this.lblTitle.Text = ModalityConfig.getXmlCateCount();

            //显示图例
            Font myFont = new Font("黑体", 20);

            this.chartSubject.Series.Clear();

            List <int>    value = new List <int>();
            List <String> str   = new List <String>();

            foreach (DataRowView dr in ModalityConfig.getXmlSubjectData().Tables[0].DefaultView)
            {
                var tempStr   = dr["name"].ToString();
                var tempValue = uInfoRepository.UserInfoes.Where(p => p.modality == tempStr).ToList().Count;
                value.Add(tempValue);
                str.Add(tempStr);
            }
            Series mySeries = new Series(ModalityConfig.getXmlCateCount());

            mySeries.Points.DataBindXY(str, value);
            mySeries.IsValueShownAsLabel = true;
            mySeries.LabelForeColor      = Color.Red;
            mySeries.Font = myFont;
            this.chartSubject.Series.Add(mySeries);
            this.chartSubject.DataBind();
            //加载完成
            LoadController.State = "加载完成...";
            Thread.Sleep(500);
            //关闭加载界面
            LoadController.Close();
        }
Ejemplo n.º 5
0
 private void FrmMain_Load(object sender, EventArgs e)
 {
     this.Text = ModalityConfig.getXmlTitle();
 }