Exemplo n.º 1
0
        public TableControl(Cfhead dr)
        {
            InitializeComponent();
            List <Cfhead> lst;

            if (string.IsNullOrEmpty(dr.did))
            {
                lst = new CfheadManager().GetListByPatientAndAddress(dr.patient, dr.address);
            }
            else
            {
                lst = new CfheadManager().GetListByDid(dr.did);
            }
            this.gridControl1.DataSource = lst;
            Cfhead first = lst.First();

            txtPatient.Text = first.patient;
            txtAge.Text     = first.age;

            txtPhone.Text   = first.phone.Replace(first.phone.Substring(4, 4), "****");
            txtId.Text      = string.IsNullOrEmpty(first.did)? "无": first.did.Replace(first.did.Substring(first.did.Length - 4, 4), "****");
            txtAddress.Text = first.address;
            int    tianShu = lst.Select(item => item.pid).Distinct().Count();
            int    ciShu   = lst.Count();
            double?price   = lst.Select(item => item.totalprice).Sum();

            lblXJ.Text      = string.Format("处方数量:{0:N0}张,就诊天数:{1:N0}天,总金额:{2:N2}元", ciShu, tianShu, price);
            txtAddress.Size = new Size(400, 20);
            lblXJ.Size      = new Size(400, 20);
            this.tableLayoutPanel1.SetColumnSpan(txtAddress, 2);
            this.tableLayoutPanel1.SetColumnSpan(lblXJ, 3);
            this.gridView1.OptionsView.ColumnAutoWidth = true;
            this.gridView1.FocusedRowChanged          += ShowDetail;
            int index = lst.FindIndex(item => item.opertime == dr.opertime);

            System.Diagnostics.Debug.WriteLine(index.ToString());
            if (index == 0)
            {
                LoadDetail(0);
            }
            else
            {
                gridView1.MoveBy(index);
            }
        }
Exemplo n.º 2
0
        private void IninConfig()
        {
            SplashScreenManager.ShowForm(typeof(SplashScreen1));
            string maxTime = new CfheadManager().GetMaxTime();

            SplashScreenManager.Default.SendCommand(null, string.Format("最新更新时间为{0},1", maxTime));

            string maxDate = maxTime.Split(' ')[0].Replace("-", "").Trim();

            new ImportData().AutoImport();


            SplashScreenManager.Default.SendCommand(null, "内容面板预加载,开始,10");
            UserControlFactory.CreateInstance("");
            SplashScreenManager.Default.SendCommand(null, "内容面板预加载,结束,50");

            SplashScreenManager.Default.SendCommand(null, "数据更新完成,100");
            SplashScreenManager.CloseForm();
        }
Exemplo n.º 3
0
        public void Query()
        {
            SelectRow = null;
            cfhead    = new CfheadManager().GetListByCondition(BeginTime, EndTime, Doctor, Patient);
            if (this.IsAll)
            {
                cfhead = new CfheadManager().GetSame(BeginTime, EndTime, Doctor, Patient);
            }

            Dv         = new HuiZongManager().GetListByCondition(this.BeginTime, this.EndTime, this.Patient, this.Doctor);
            HzByDoctor = new HzByDoctor().GetDataTable(BeginTime, EndTime, Doctor, Patient);

            if (HzByDoctor.Rows.Count == 0)
            {
                return;
            }
            HZ = new HuiZong()
            {
                Riqi       = cfhead.Select(it => it.opertime).Min() + "至" + cfhead.Select(it => it.opertime).Max(),
                MaxDate    = cfhead.Select(it => it.opertime).Max().Split()[0],
                TotalPrice = Convert.ToDouble(HzByDoctor.Compute("sum(金额)", "")),
                MaxPrice   = Convert.ToDouble(HzByDoctor.Compute("MAX(最大金额)", "")),
                MinPrice   = Convert.ToDouble(HzByDoctor.Compute("MIN(最小金额)", "")),
                AvgPrice   = Convert.ToDouble(HzByDoctor.Compute("Avg(平均金额)", "")),
                CfCount    = Convert.ToInt32(HzByDoctor.Compute("sum(处方数)", "")),
                MzCount    = Convert.ToInt32(HzByDoctor.Compute("sum(人次数)", "")),
                YbCount    = Convert.ToInt32(HzByDoctor.Compute("sum(医保)", "")),
                ZfCount    = Convert.ToInt32(HzByDoctor.Compute("sum(自费)", "")),
                ZcyCount   = Convert.ToInt32(HzByDoctor.Compute("sum(中成药)", "")),
                JdCount    = Convert.ToInt32(HzByDoctor.Compute("sum(静滴)", "")),
                JeCount    = Convert.ToInt32(HzByDoctor.Compute("sum(精二)", "")),
                EkCount    = Convert.ToInt32(HzByDoctor.Compute("sum(儿科)", "")),
                JsCount    = Convert.ToInt32(HzByDoctor.Compute("sum(激素)", "")),
                KjyCount   = Convert.ToInt32(HzByDoctor.Compute("sum(抗菌素)", "")),
                JzCount    = Convert.ToInt32(HzByDoctor.Compute("sum(急诊)", "")),
            };
            Huizong = HZ.ToString();
            //JSDT = new HzByDoctor().GetDataTable02(BeginTime, EndTime, Doctor, Patient,"精二");
            GetJS();
        }