예제 #1
0
        private void lstItems(string _type)
        {
            if ("ALL".Equals(_type))
            {
                lvItem.Items.Clear();
                txtNum.Text = "";
                tpnmonitor.TPNItem item = null;
                foreach (DataRow row in this.tblTPNItem.Rows)
                {
                    item = new tpnmonitor.TPNItem(Convert.ToInt32(row["TPNItemID"].ToString()),
                                                  getTypeName(row["ItemType"].ToString()), row["ItemCode"].ToString(),
                                                  row["ItemName"].ToString(), ftmExpress(row["Express"].ToString()),
                                                  row["Unit"].ToString(),
                                                  row.IsNull("SeqNo") ? -1 : Convert.ToInt32(row["SeqNo"].ToString()));
                    item.NormalValue = row["NormalValue"].ToString();
                    lvItem.Items.Add(item);
                }
                txtNum.Text = "项目数:" + lvItem.Items.Count.ToString();
            }
            else
            {
                string select = "";
                if ("check".Equals(_type))
                {
                    select = "ItemType='bodychk' OR ItemType='lischk'";
                }
                else
                {
                    select = "ItemType='" + _type + "'";
                }

                filterItem(select);
            }
        }
예제 #2
0
        private void filterItem(string _condition)
        {
            lvItem.Items.Clear();
            txtNum.Text = "";

            tpnmonitor.TPNItem item = null;
            DataRow[]          rows = this.tblTPNItem.Select(_condition);
            foreach (DataRow row in rows)
            {
                item = new tpnmonitor.TPNItem(Convert.ToInt32(row["TPNItemID"].ToString()),
                                              getTypeName(row["ItemType"].ToString()), row["ItemCode"].ToString(),
                                              row["ItemName"].ToString(), ftmExpress(row["Express"].ToString()),
                                              row["Unit"].ToString(),
                                              row.IsNull("SeqNo") ? -1 : Convert.ToInt32(row["SeqNo"].ToString()));
                item.NormalValue = row["NormalValue"].ToString();
                lvItem.Items.Add(item);
            }

            /*   lvItem.Items.Add(new tpnmonitor.TPNItem(Convert.ToInt32(row["TPNItemID"].ToString()),
             *                                 getTypeName(row["ItemType"].ToString()), row["ItemCode"].ToString(),
             *                                 row["ItemName"].ToString(), ftmExpress(row["Express"].ToString()),
             *                                 row["Unit"].ToString(),
             *                                 row.IsNull("SeqNo") ? -1 : Convert.ToInt32(row["SeqNo"].ToString())));
             */
            txtNum.Text = "项目数:" + lvItem.Items.Count.ToString();
        }
예제 #3
0
        private void btnSet_Click(object sender, RoutedEventArgs e)
        {
            if (null == lvItem.SelectedItem)
            {
                BLPublic.Dialogs.Alert("请选择要设置的项目.");
                return;
            }

            tpnmonitor.TPNItem item = (tpnmonitor.TPNItem)lvItem.SelectedItem;

            string input = WinInput.getInput(this, "TPN项目关联", "请输入关联的检查项目编码", item.Value);

            if (null == input)
            {
                return;
            }

            if (!string.IsNullOrWhiteSpace(input))
            {
                input = "[" + input + "]";
            }

            if (AppConst.db.ExecSQL(string.Format(SQL.SET_TPNTEIM_EXP, input, item.ID)))
            {
                DataRow row = this.tblTPNItem.Rows.Find(item.ID);
                if (null != row)
                {
                    row["Express"] = input;
                }

                item.Value = input;
                lvItem.Items.Refresh();
                BLPublic.Dialogs.Info("设置成功.");
            }
            else
            {
                BLPublic.Dialogs.Error("设置项目关联内容失败:" + AppConst.db.Error);
            }
        }
예제 #4
0
 public TPNItemModel(tpnmonitor.TPNItem _item) :
     base(_item.ID, _item.Type, _item.Code, _item.Name, _item.Value, _item.Unit, 0)
 {
     this.IsSelected = false;
 }