Example #1
0
        private void CshHzGrid(TrasenClasses.GeneralControls.DataGridEx xcjwDataGrid)
        {
            #region 添加汇总的列
            List <ColumnDefine> columns = new List <ColumnDefine>();
            columns.Add(PubClass.NewColumnDefine("序号", "序号", 35, true, 0));
            columns.Add(PubClass.NewColumnDefine("剂型", "剂型", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("品名", "品名", 150, true, 0));
            columns.Add(PubClass.NewColumnDefine("商品名", "商品名", 150, true, 0));
            columns.Add(PubClass.NewColumnDefine("规格", "规格", 100, true, 0));
            columns.Add(PubClass.NewColumnDefine("厂家", "厂家", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("单价", "单价", 65, true, 0));
            //columns.Add(PubClass.NewColumnDefine("库存数", "库存数", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("领药数", "领药数", 65, true, 0));
            columns.Add(PubClass.NewColumnDefine("缺药数", "缺药数", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("单位", "单位", 40, true, 0));
            columns.Add(PubClass.NewColumnDefine("药库单位", "药库单位", 75, true, 0));
            columns.Add(PubClass.NewColumnDefine("金额", "金额", 75, true, 0));
            columns.Add(PubClass.NewColumnDefine("货号", "货号", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("cjid", "cjid", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("dwbl", "dwbl", 0, true, 0));
            //columns.Add(PubClass.NewColumnDefine("领药科室", "领药科室", 0, true, 0));

            DataTable dtTmp = new DataTable();
            dtTmp.TableName = "tbhz";
            int index = 0;
            foreach (ColumnDefine cd in columns)
            {
                DataGridEnableTextBoxColumn colText = new DataGridEnableTextBoxColumn(index);
                colText.HeaderText        = cd.HeaderText;
                colText.MappingName       = cd.MappingName;
                colText.Width             = cd.ColWidth;
                colText.NullText          = "";
                colText.ReadOnly          = cd.ColReadOnly;
                colText.CheckCellEnabled += new TrasenClasses.GeneralControls.DataGridEnableTextBoxColumn.EnableCellEventHandler(myDataGrid2_CheckCellEnabled);
                xcjwDataGrid.TableStyles[0].GridColumnStyles.Add(colText);
                DataColumn datacol;
                if (cd.MappingName.Trim() == "ypsl" || cd.MappingName == "金额")
                {
                    datacol = new DataColumn(cd.MappingName, Type.GetType("System.Decimal"));
                }
                else
                {
                    datacol = new DataColumn(cd.MappingName);
                }

                dtTmp.Columns.Add(datacol);

                index++;
            }
            xcjwDataGrid.DataSource = dtTmp;
            xcjwDataGrid.TableStyles[0].MappingName = "tbhz";
            #endregion
        }
Example #2
0
        private void CshMxGrid(TrasenClasses.GeneralControls.ButtonDataGridEx xcjwDataGrid)
        {
            #region 添加明细的列------------------
            List <ColumnDefine> columns = new List <ColumnDefine>();
            columns.Add(PubClass.NewColumnDefine("序号", "序号", 30, true, 1));
            columns.Add(PubClass.NewColumnDefine("发药", "发药", 30, true, 0));
            columns.Add(PubClass.NewColumnDefine("床号", "床号", (IsVisable("床号", true) ? 30 : 0), true, 0));    //住院+床号  或者  门诊
            columns.Add(PubClass.NewColumnDefine("姓名", "姓名", (IsVisable("姓名", true) ? 50 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("住院号", "住院号", (IsVisable("住院号", true) ? 60 : 0), true, 0)); //住院号或者门诊号
            columns.Add(PubClass.NewColumnDefine("性别", "性别", (IsVisable("性别", true) ? 30 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("年龄", "年龄", (IsVisable("年龄", false) ? 40 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("剂型", "剂型", (IsVisable("剂型", false) ? 50 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("商品名", "商品名", (IsVisable("商品名", true) ? 60 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("品名", "品名", (IsVisable("品名", true) ? 100 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("规格", "规格", (IsVisable("规格", true) ? 100 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("厂家", "厂家", (IsVisable("厂家", false) ? 100 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("单价", "单价", (IsVisable("单价", true) ? 80 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("库存数", "库存数", (IsVisable("库存数", false) ? 50 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("数量", "数量", (IsVisable("数量", true) ? 60 : 0), true, 0));
            //update code by py 7-1 18:40
            columns.Add(PubClass.NewColumnDefine("单位", "单位", (IsVisable("单位", true) ? 35 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("剂数", "剂数", (IsVisable("剂数", true) ? 55 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("金额", "金额", (IsVisable("金额", true) ? 70 : 0), true, 0));

            columns.Add(PubClass.NewColumnDefine("煎药", "煎药", (IsVisable("煎药", true) ? 60 : 0), true, 0));

            columns.Add(PubClass.NewColumnDefine("用法", "用法", (IsVisable("用法", true) ? 50 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("频次", "频次", (IsVisable("频次", true) ? 45 : 0), true, 0));

            columns.Add(PubClass.NewColumnDefine("剂量", "剂量", (IsVisable("剂量", true) ? 45 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("剂量单位", "剂量单位", (IsVisable("剂量单位", false) ? 45 : 0), true, 0));

            columns.Add(PubClass.NewColumnDefine("货号", "货号", (IsVisable("货号", false) ? 50 : 0), true, 0));

            columns.Add(PubClass.NewColumnDefine("处方日期", "处方日期", (IsVisable("处方日期", true) ? 110 : 0), true, 0));//住院:处方日期  门诊:录入日期
            columns.Add(PubClass.NewColumnDefine("记费日期", "记费日期", (IsVisable("记费日期", true) ? 77 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("记费员", "记费员", (IsVisable("记费员", true) ? 70 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("发药日期", "发药日期", (IsVisable("发药日期", true) ? 60 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("发药员", "发药员", (IsVisable("发药员", true) ? 70 : 0), true, 0));

            //columns.Add(PubClass.NewColumnDefine("配药员", "配药员", (IsVisable("配药员", false) ? 45 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("处方号", "处方号", (IsVisable("处方号", true) ? 100 : 0), true, 0));

            columns.Add(PubClass.NewColumnDefine("zy_id", "zy_id", 0, true, 0));     //cfmxid
            columns.Add(PubClass.NewColumnDefine("cjid", "cjid", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("dept_id", "dept_id", 0, true, 0)); //KSDM
            columns.Add(PubClass.NewColumnDefine("doc_id", "doc_id", 0, true, 0));   //YSDM
            //columns.Add(PubClass.NewColumnDefine("unitrate", "unitrate", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("ypsl", "ypsl", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("zxdw", "zxdw", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("dwbl", "dwbl", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("inpatient_id", "inpatient_id", 0, true, 0));//PATID
            columns.Add(PubClass.NewColumnDefine("批发价", "批发价", (IsVisable("批发价", false) ? 75 : 0), true, 0));
            columns.Add(PubClass.NewColumnDefine("批发金额", "批发金额", (IsVisable("批发金额", false) ? 75 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("charge_bit", "charge_bit", 0, true, 0));
            //columns.Add(PubClass.NewColumnDefine("discharge_bit", "discharge_bit", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("医生", "医生", (IsVisable("批发金额", true) ? 75 : 0), true, 0)); //医生名字
            columns.Add(PubClass.NewColumnDefine("dept_ly", "dept_ly", 0, true, 0));                        //科室名字
            //columns.Add(PubClass.NewColumnDefine("诊断", "诊断", 0, true, 0));
            //columns.Add(PubClass.NewColumnDefine("中医诊断", "中医诊断", (IsVisable("中医诊断", false) ? 100 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("中医症型", "中医症型", (IsVisable("中医症型", false) ? 100 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("STATITEM_CODE", "STATITEM_CODE", 0, true, 0));
            //columns.Add(PubClass.NewColumnDefine("家庭地址", "家庭地址", (IsVisable("家庭地址", false) ? 100 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("联系方式", "联系方式", (IsVisable("联系方式", false) ? 75 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("身份证", "身份证", (IsVisable("身份证", false) ? 100 : 0), true, 0));
            //columns.Add(PubClass.NewColumnDefine("cz_id", "cz_id", 0, true, 0));
            //columns.Add(PubClass.NewColumnDefine("kcid", "kcid", 0, true, 0));
            //columns.Add(PubClass.NewColumnDefine("execdept_id", "execdept_id", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("hwh", "hwh", 0, true, 0));
            columns.Add(PubClass.NewColumnDefine("特殊用法", "tsyf", 150, true, 0));
            columns.Add(PubClass.NewColumnDefine("剂量单位数量", "剂量单位数量", 0, true, 0));

            DataTable dtTmp = new DataTable();
            dtTmp.TableName = "tbmx";
            int index = 0;
            foreach (ColumnDefine cd in columns)
            {
                //DataGridEnableBoolColumn
                if (cd.ColBoolButton == 0)
                {
                    DataGridEnableTextBoxColumn colText = new DataGridEnableTextBoxColumn(index);
                    colText.HeaderText        = cd.HeaderText;
                    colText.MappingName       = cd.MappingName;
                    colText.Width             = cd.ColWidth;
                    colText.NullText          = "";
                    colText.ReadOnly          = cd.ColReadOnly;
                    colText.CheckCellEnabled += new TrasenClasses.GeneralControls.DataGridEnableTextBoxColumn.EnableCellEventHandler(myDataGrid1_CheckCellEnabled);

                    xcjwDataGrid.TableStyles[0].GridColumnStyles.Add(colText);
                    DataColumn datacol;
                    if (cd.MappingName.Trim() == "ypsl" || cd.MappingName == "金额")
                    {
                        datacol = new DataColumn(cd.MappingName, Type.GetType("System.Decimal"));
                    }
                    else
                    {
                        datacol = new DataColumn(cd.MappingName);
                    }

                    dtTmp.Columns.Add(datacol);
                }
                else
                {
                    DataGridButtonColumn btnCol = new DataGridButtonColumn(index);
                    btnCol.HeaderText  = cd.HeaderText;
                    btnCol.MappingName = cd.MappingName;
                    btnCol.Width       = cd.ColWidth;

                    btnCol.CellButtonClicked += new DataGridCellButtonClickEventHandler(btnCol_CellButtonClicked);
                    xcjwDataGrid.TableStyles[0].GridColumnStyles.Add(btnCol);

                    this.myDataGrid1.MouseDown += new MouseEventHandler(btnCol.HandleMouseDown);
                    this.myDataGrid1.MouseUp   += new MouseEventHandler(btnCol.HandleMouseUp);

                    DataColumn datacol;
                    datacol = new DataColumn(cd.MappingName);
                    dtTmp.Columns.Add(datacol);
                }
                index++;
            }

            xcjwDataGrid.DataSource = dtTmp;
            xcjwDataGrid.TableStyles[0].MappingName = "tbmx";

            if (ss.网络内容显示商品名 == true)
            {
                xcjwDataGrid.TableStyles[0].GridColumnStyles["商品名"].Width = 100;
            }
            else
            {
                xcjwDataGrid.TableStyles[0].GridColumnStyles["商品名"].Width = 0;
            }

            if ((new SystemCfg(8007)).Config == "0")
            {
                this.myDataGrid1.TableStyles[0].GridColumnStyles["医生"].Width = 0;
            }
            #endregion
        }