Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         cn.Open();
         string         qry = "select patientid from hospital_outpatient";
         SqlDataAdapter da  = new SqlDataAdapter(qry, cn);
         DataSet        ds  = new DataSet();
         da.Fill(ds, "hospital_outpatient");
         PID.DataSource    = ds;
         PID.DataTextField = "patientid";
         PID.DataBind();
         cn.Close();
         Calendar1.Visible = false;
         PID.Items.Insert(0, "...Select...");
     }
 }
Example #2
0
        private void InitComboxParent()
        {
            BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL();
            DataSet           ds  = new DataSet();

            ds = bll.GetList("");
            if (ds.Tables.Count > 0)
            {
                DataTable outDT = ds.Tables[0].Copy();
                outDT.Clear();
                Recursion(ds.Tables[0], 0, 0, ref outDT);

                DataRow newRow = outDT.NewRow();
                newRow["CellID"] = "0";
                newRow["Title"]  = "无父类";
                outDT.Rows.InsertAt(newRow, 0);

                PID.DataTextField  = "Title";
                PID.DataValueField = "CellID";
                PID.DataSource     = outDT;
                PID.DataBind();
            }
        }