123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- //using System.Linq;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- //using System.Xml.Linq;
- namespace Com.Jpsoft.Hospital.Web.Module.jp_druginfo
- {
- public partial class Detail : Com.Jpsoft.Hospital.Web.Common.BasePage//System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- SetDDL();
- if (Request.Params["id"] != null || Request.Params["id"].Trim() != "")
- {
- string id = Request.Params["id"];
- ShowInfo(int.Parse(id));
- }
- }
- }
- #region
- /// <summary>
- /// 显示药品详情
- /// </summary>
- /// <param name="id"></param>
- private void ShowInfo(int id)
- {
- Com.Jpsoft.Hospital.BLL.jp_druginfo bll = new Com.Jpsoft.Hospital.BLL.jp_druginfo();
- Com.Jpsoft.Hospital.Model.jp_druginfo model = bll.GetModel(id);
- this.txtdrugname.Value = model.drugname;
- this.txtbusinessname.Value = model.businessname;
-
- Com.Jpsoft.Hospital.BLL.jp_drugtype tpbll = new Com.Jpsoft.Hospital.BLL.jp_drugtype();
- Com.Jpsoft.Hospital.Model.jp_drugtype tpmode = tpbll.GetModel(model.drugtype);
- DropDownList1.SelectedValue = tpmode.fatherid.ToString();
- SetDDLChild(tpmode.fatherid.ToString());
- this.DropDownList2.SelectedValue = model.drugtype.ToString();
- this.txtapprovalnumber.Value = model.approvalnumber;
- this.txtstandard.Value = model.standard;
- this.txtmanufacturer.Value = model.manufacturer;
- this.txtcompany.Value = model.company;
- this.txtintroduction.Value = model.introduction;
- this.txtgoodinfo.Value = model.goodinfo;
- //this.txtimgpath.Value = model.imgpath;
- this.Image1.ImageUrl = "~/Upload/drugimg/" + model.imgpath;
- this.txtingredients.Value = model.ingredients;
- this.txttraits.Value = model.traits;
- this.txtusedosage.Value = model.usedosage;
- this.txtdrugaffect.Value = model.drugaffect;
- this.txtfunctions.Value = model.functions;
- this.txtbadreaction.Value = model.badreaction;
- this.txttaboo.Value = model.taboo;
- this.txtnotice.Value = model.notice;
- this.txtvalidity.Value = model.validity;
- }
- /// <summary>
- /// 绑定父类别
- /// </summary>
- private void SetDDL()
- {
- Jpsoft.Hospital.BLL.jp_drugtype bll = new Com.Jpsoft.Hospital.BLL.jp_drugtype();
- DataTable dt = bll.GetList(" fatherid=0 ").Tables[0];
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- DropDownList1.Items.Add(new ListItem(dt.Rows[i]["typename"].ToString(), dt.Rows[i]["id"].ToString()));
- }
- DropDownList1.Items.Insert(0, new ListItem("--请选择一级类别--", "0"));
- }
- /// <summary>
- /// 绑定子类别
- /// </summary>
- private void SetDDLChild(string id)
- {
- string where = string.Empty;
- if (id != "" )
- {
- where = " fatherid='" + id + "' ";
- }
- DropDownList2.Items.Clear();
- if (DropDownList1.SelectedValue != "0")
- {
- Jpsoft.Hospital.BLL.jp_drugtype bll = new Com.Jpsoft.Hospital.BLL.jp_drugtype();
- DataTable dt = bll.GetList(where).Tables[0];
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- DropDownList2.Items.Add(new ListItem(dt.Rows[i]["typename"].ToString(), dt.Rows[i]["id"].ToString()));
- }
- }
- DropDownList2.Items.Insert(0, new ListItem("--请选择一级类别--", "0"));
- }
- #endregion
- }
- }
|