Ejemplo n.º 1
0
        /// <summary>
        /// 添加方法
        /// </summary>
        public void AddNew()
        {
            int       a      = ht.Count;
            ArrayList tempal = new ArrayList();

            int[] temparray  = new int[a];
            int   countindex = 0;

            foreach (FarsiLibrary.Win.FATabStripItem ft in this.TabControl1.Items)
            {
                temparray[countindex] = Neusoft.FrameWork.Function.NConvert.ToInt32(ft.Title.Substring(ft.Title.LastIndexOf('(') + 1).Replace(')', ' '));
                countindex++;
            }
            item = new FarsiLibrary.Win.FATabStripItem();
            int lastNumber = 0;

            if (temparray.Length > 0)
            {
                lastNumber = ebullition(temparray);
                item.Title = System.DateTime.Today.Date.ToString("yyyy-MM-dd") + "(" + Neusoft.FrameWork.Function.NConvert.ToInt32(lastNumber + 1) + ")";
            }
            else
            {
                item.Title = System.DateTime.Today.Date.ToString("yyyy-MM-dd") + "(" + lastNumber + ")";
            }

            #region  初始化COMBOX

            ht.Add(Neusoft.FrameWork.Function.NConvert.ToInt32(item.Title.Substring(item.Title.LastIndexOf('(') + 1).Replace(')', ' ')), item);

            this.cmdDiseaseSelect.Items.Add(item.Title);

            #endregion

            controlOne = new ucDiseaseInputOne();
            controlOne.DateTimePickerChange += new ucDiseaseInputOne.DateTimePickerChanged(control_DateTimePickerChange);
            controlOne.Size = new Size(569, 480);
            Container tempC = new Container();
            foreach (Control t in controlOne.Controls)
            {
                string str = t.GetType().Name;

                if (t.GetType() == typeof(Neusoft.FrameWork.EPRControl.emrMultiLineTextBox))
                {
                    t.Font = f;
                    //if (tr)//false副主任,主任。true主治
                    //{
                    //    ((Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)t).IsShowModify = false;
                    //}
                    //else
                    //{
                    //    ((Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)t).IsShowModify = true;
                    //}
                }
                if (t.GetType() != typeof(Label))
                {
                    tempC.Add(t);
                }
            }
            this.ucUserText1.SetControl(tempC);//设置组套

            item.Controls.Add(controlOne);
            item.Tag = controlOne;

            this.TabControl1.AddTab(item);
            this.TabControl1.AlwaysShowClose = false;
            this.TabControl1.Refresh();
            this.TabControl1.SelectedItem = item;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化UC窗体(from xml)
        /// </summary>
        private void initialUC()
        {
            if (File.Exists(Neusoft.FrameWork.WinForms.Classes.Function.CurrentPath + Neusoft.FrameWork.WinForms.Classes.Function.TempPath + @"\EprDisease.xml"))
            {
                XmlDocument  dt = new XmlDocument();
                StreamReader sr = File.OpenText(Neusoft.FrameWork.WinForms.Classes.Function.CurrentPath + Neusoft.FrameWork.WinForms.Classes.Function.TempPath + @"\EprDisease.xml");

                string str = sr.ReadToEnd();
                sr.Close();
                if (str == "")
                {
                    return;
                }
                try
                {
                    dt.LoadXml(str);
                }catch (Exception em) { MessageBox.Show(em.Message); }

                XmlNodeList nodeList = dt.SelectNodes(@"//病程记录//PatientInfo");
                ht.Clear();
                Container tempC = new Container();
                foreach (XmlNode xNode in nodeList)
                {
                    FarsiLibrary.Win.FATabStripItem ft = new FarsiLibrary.Win.FATabStripItem();
                    ucDiseaseInputOne contrOne         = new ucDiseaseInputOne();
                    contrOne.DateTimePickerChange += new ucDiseaseInputOne.DateTimePickerChanged(control_DateTimePickerChange);
                    contrOne.Size = new Size(569, 480);
                    ft.Title      = xNode.Attributes ["Title"].Value;


                    ft.Controls.Add(contrOne);
                    this.TabControl1.AddTab(ft);

                    #region  给各控件赋值
                    foreach (Control c in contrOne.Controls)
                    {
                        int a = Neusoft.FrameWork.Function.NConvert.ToInt32(c.Tag);
                        if (c.GetType() == typeof(Neusoft.FrameWork.EPRControl.emrMultiLineTextBox))
                        {
                            c.Font = f;
                            tempC.Add(c);
                        }
                        if (a == 1)
                        {
                            ((DateTimePicker)c).Text = xNode.Attributes ["Date"].Value;
                        }
                        else if (a == 2)
                        {
                            ((TextBox)c).Text = xNode.Attributes["DocUpName"].Value;
                        }
                        else if (a == 3)
                        {
                            ((ComboBox )c).Text = xNode.Attributes["DocUpType"].Value;
                        }
                        else if (a == 4)
                        {
                            //if (tr)//false副主任,主任。true主治
                            //{
                            //    ((Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)c).IsShowModify = false ;
                            //}
                            //else
                            //{
                            //    ((Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)c).IsShowModify = true ;
                            //}
                            ((RichTextBox)c).Rtf = xNode.InnerText;
                        }
                        else if (a == 5)
                        {
                            ((TextBox)c).Text = xNode.Attributes["DocSign"].Value;
                        }
                        else if (a == 6)
                        {
                            ((TextBox)c).Text = xNode.Attributes ["DocUpSign"].Value;
                        }
                    }

                    #endregion

                    //if (tr)
                    //{
                    //    if (xNode.Attributes["IsUpSubMission"].Value == "1")
                    //    {
                    //        contrOne.Enabled = false;
                    //    }
                    //}
                    contrOne.IsUpDocSign    = xNode.Attributes["IsUpDocSign"].Value;
                    contrOne.IsUpSubmission = xNode.Attributes["IsUpSubMission"].Value;

                    int    tmpName = Neusoft.FrameWork.Function.NConvert.ToInt32(ft.Title.LastIndexOf('('));
                    string tt      = ft.Title.Substring(tmpName + 1).Replace(')', ' ');
                    ht.Add(Neusoft.FrameWork.Function.NConvert.ToInt32(tt), ft);
                }

                this.ucUserText1.SetControl(tempC);
                this.TabControl1.AlwaysShowClose = false;
                this.TabControl1.Refresh();
            }
        }