Beispiel #1
0
        /// <summary>
        /// 根据入院登记ID显示发票号记录信息
        /// </summary>
        private void m_mthShowInvonoInfo()
        {
            DataTable dt;

            clsDcl_Charge objCharge = new clsDcl_Charge();
            long          l         = objCharge.m_lngGetInvoiceInfoByRegID(RegID, 1, out dt);

            if (l > 0)
            {
                this.Cursor = Cursors.WaitCursor;
                this.lsvInvoice.BeginUpdate();
                this.lsvInvoice.Items.Clear();

                //状态 0-作废 1-有效 2-退票 3-恢复
                string[] status = new string[4] {
                    "作废", "有效", "退票", "恢复"
                };

                Hashtable has = new Hashtable();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr     = dt.Rows[i];
                    string  invono = dr["invoiceno_vchr"].ToString();

                    if (!has.ContainsKey(invono))
                    {
                        has.Add(invono, dr);
                    }
                    else
                    {
                        if (dr["status_int"].ToString() == "2")
                        {
                            has[invono] = dr;
                        }
                    }
                }

                ArrayList invoarr = new ArrayList();
                invoarr.AddRange(has.Values);

                for (int i = 0; i < invoarr.Count; i++)
                {
                    DataRow dr = invoarr[i] as DataRow;

                    int          num    = int.Parse(dr["status_int"].ToString());
                    ListViewItem lvitem = new ListViewItem();
                    lvitem.SubItems.Add(status[num]);
                    lvitem.SubItems.Add(dr["invoiceno_vchr"].ToString());

                    if (num == 2)
                    {
                        lvitem.ForeColor = Color.Red;
                    }
                    lvitem.ImageIndex = 0;
                    lvitem.Tag        = dr;
                    this.lsvInvoice.Items.Add(lvitem);
                }

                this.lsvInvoice.EndUpdate();
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 根据入院登记ID显示发票号记录信息
        /// </summary>
        private void m_mthShowInvonoInfo()
        {
            DataTable dt;

            clsDcl_Charge objCharge = new clsDcl_Charge();
            long          l         = objCharge.m_lngGetInvoiceInfoByRegID(RegID, 2, out dt);

            if (l > 0)
            {
                this.Cursor = Cursors.WaitCursor;
                this.lsvInvoice.BeginUpdate();
                this.lsvInvoice.Items.Clear();

                Hashtable has = new Hashtable();

                DataView dv = new DataView(dt);
                dv.Sort = "invono asc";

                foreach (DataRowView drv in dv)
                {
                    string invono = drv["invono"].ToString();

                    if (!has.ContainsKey(invono))
                    {
                        has.Add(invono, drv);
                    }
                    else
                    {
                        if (drv["status_int"].ToString() == "2")
                        {
                            has[invono] = drv;
                        }
                    }
                }

                ArrayList invoarr = new ArrayList();
                invoarr.AddRange(has.Values);

                for (int i = 0; i < invoarr.Count; i++)
                {
                    DataRowView drv = invoarr[i] as DataRowView;

                    ListViewItem lvitem = new ListViewItem();

                    string status = drv["status"].ToString().Trim();
                    if (status == "0")
                    {
                        status = "作废";
                    }
                    else if (status == "1")
                    {
                        status = "正常";
                    }
                    else if (status == "2")
                    {
                        status = "退票";
                    }
                    else if (status == "3")
                    {
                        status = "恢复";
                    }
                    else if (status == "999")
                    {
                        status = "重打";
                    }

                    lvitem.SubItems.Add(status);


                    lvitem.SubItems.Add(drv["invono"].ToString());

                    lvitem.ImageIndex = 0;
                    lvitem.Tag        = drv;
                    this.lsvInvoice.Items.Add(lvitem);
                }

                this.lsvInvoice.EndUpdate();
                this.Cursor = Cursors.Default;
            }
        }