Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            DateTime Date   = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).AddDays(-7);
            DateTime Date_1 = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase);

            this.dateTimePicker1.Value = Date;
            this.dateTimePicker2.Value = Date_1;


            txtinpatientNo.InpatientNoLength = Convert.ToInt32(new SystemCfg(5026).Config);
            txtinpatientNo.Text = InpatientNo.GetEmptyZyh();
            zyh = InpatientNo.GetEmptyZyh();

            string    sql    = "";
            DataTable tbWard = new DataTable();

            sql    = "select * from jc_ward where jgbm=" + FrmMdiMain.Jgbm + " order by ward_id";
            tbWard = FrmMdiMain.Database.GetDataTable(sql);
            DataRow dr = tbWard.NewRow();

            dr["ward_id"]   = "-1";
            dr["ward_name"] = "全部";
            tbWard.Rows.Add(dr);
            cmbWard.ValueMember   = "ward_id";
            cmbWard.DisplayMember = "ward_name";
            cmbWard.DataSource    = tbWard;
            cmbWard.SelectedValue = "-1";

            BingData();
        }
Example #2
0
        private void FrmCzgl_Load(object sender, EventArgs e)
        {
            //住院号长度
            txtinpatientNo.InpatientNoLength = Convert.ToInt32(new SystemCfg(5026).Config);
            txtinpatientNo.Text = InpatientNo.GetEmptyZyh();

            DateTime now = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase);

            dtpCzrq1.Value = now;
            dtpCzrq2.Value = now;
            dtpJzrq1.Value = now;
            dtpJzrq2.Value = now;

            //病区
            //DataTable tb = InstanceForm.BDatabase.GetDataTable(@"SELECT WARD_ID,WARD_NAME FROM JC_WARD WHERE JGBM=" + FrmMdiMain.Jgbm + " ORDER BY WARD_ID");
            //Modify By Kevin 2013-09-23 改成调用数据库操作类中的SQL执行方法
            System.Collections.ArrayList arrList = new System.Collections.ArrayList();
            arrList.Add(1);
            arrList.Add(FrmMdiMain.Jgbm);
            DataTable tb = Ts_Zygl_Classes.PublicDataBaseAccessClass.BindWard(arrList, InstanceForm.BDatabase); //TszyHIS.DataBaseAccess.BindWard(FrmMdiMain.Jgbm, dataBase);

            if (tb == null)
            {
                MessageBox.Show("错误,未能取得病区信息!", "提示");
            }
            DataRow row = tb.NewRow();

            row["WARD_ID"]   = "-1";
            row["WARD_NAME"] = "全部";
            tb.Rows.Add(row);
            cmbWard.DataSource    = tb;
            cmbWard.DisplayMember = "WARD_NAME";
            cmbWard.ValueMember   = "WARD_ID";

            if (_functionName == "Fun_ts_zy_czgl_all" || _functionName == "Fun_ts_zy_czgl_cx_all" || _functionName == "Fun_ts_zy_czgl_sh_all")
            {
                cmbWard.SelectedValue = "-1";
            }
            else
            {
                cmbWard.SelectedValue = InstanceForm.BCurrentDept.WardId;
                cmbWard.Enabled       = false;
            }

            if (_functionName == "Fun_ts_zy_czgl_cx" || _functionName == "Fun_ts_zy_czgl_cx_all")
            {
                btAffirm.Enabled = false;
                btRefuse.Enabled = false;
            }

            if (_functionName == "Fun_ts_zy_czgl_sh" || _functionName == "Fun_ts_zy_czgl_sh_all")
            {
                btAffirm.Text = "审核";
            }
        }
Example #3
0
        private void txtinpatientNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
            {
                if (txtinpatientNo.Text != InpatientNo.GetEmptyZyh())
                {
                    if (txtinpatientNo.Tag == null)
                    {
                        DlgInpatients dlgInpatients = new DlgInpatients();
                        if (!(_functionName == "Fun_ts_zy_czgl_all" || _functionName == "Fun_ts_zy_czgl_cx_all" || _functionName == "Fun_ts_zy_czgl_sh_all"))
                        {
                            if (InstanceForm.BCurrentDept.WardId == "")
                            {
                                return;
                            }
                            dlgInpatients = new DlgInpatients(InstanceForm.BCurrentDept.WardId);
                        }
                        dlgInpatients.txtZyh.Text             = txtinpatientNo.Text;
                        dlgInpatients.tabControl1.SelectedTab = dlgInpatients.tpZyh;
                        dlgInpatients.cmbDept.SelectedIndex   = -1;
                        DlgInpatients.SelectedDeptID          = -1;
                        dlgInpatients.rbAll.Enabled           = true;
                        dlgInpatients.rbAll.Checked           = true;
                        dlgInpatients.txtZyh_KeyPress(null, new KeyPressEventArgs((char)13));
                        dlgInpatients.ShowDialog();

                        string inpatientNo = DlgInpatients.SelectedInpatientNO;
                        Guid   inpatientId = DlgInpatients.SelectedInpatientID;
                        string name        = DlgInpatients.SelectedInpatientName;

                        if (inpatientNo != "" && inpatientId != Guid.Empty)
                        {
                            txtinpatientNo.Text = inpatientNo;
                            txtinpatientNo.Tag  = inpatientId;
                            txtName.Text        = name;

                            chkCzrq.Checked = false;
                            chkJzrq.Checked = false;
                        }
                        else
                        {
                            return;
                        }
                    }
                }
            }
        }
Example #4
0
 private void cmbWard_SelectedIndexChanged(object sender, EventArgs e)
 {
     txtinpatientNo.Text = InpatientNo.GetEmptyZyh();
 }