protected void Page_Show(object sender, EventArgs e)
        {
            Utility.buildListBox(ddlType.Items, "select typeID,Name from bm_PavilionType", "typeID", "Name", null, "");
            Utility.buildListBox(ddlSunny.Items, "select ID,Name from bm_Sunny", "ID", "Name", null, "");

            if (p_theID.Value.Length > 0)
            {
                string sWhere = "";

                sWhere += "paID=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                string         sSQL      = "select * from Pavilion where " + sWhere;
                SqlDataAdapter dsCommand = new SqlDataAdapter(sSQL, Utility.Connection);
                DataSet        ds        = new DataSet();
                DataRow        row;

                if (dsCommand.Fill(ds, 0, 1, "Table") > 0)
                {
                    row         = ds.Tables[0].Rows[0];
                    theID.Value = CCUtility.GetValue(row, "paID");
                    //System.Web.UI.WebControls.TextBox[] tempBox={tbName,tb,btNote,btP1,btP2,btPhone,btMemo};
                    tbName.Text      = CCUtility.GetValue(row, "Name");
                    tbHigh.Text      = CCUtility.GetValue(row, "High");
                    tbArea.Text      = CCUtility.GetValue(row, "Area");
                    tbLayer.Text     = CCUtility.GetValue(row, "Layer");
                    tbBuildDate.Text = CCUtility.GetValue(row, "BuildDate");
                    tbMemo.Text      = CCUtility.GetValue(row, "Memo");
                    //类型
                    string s = CCUtility.GetValue(row, "typeID");
                    try
                    {
                        ddlType.SelectedIndex = ddlType.Items.IndexOf(ddlType.Items.FindByValue(s));
                    }
                    catch {}
                    //朝向
                    s = CCUtility.GetValue(row, "sunnyID");
                    try
                    {
                        ddlSunny.SelectedIndex = ddlSunny.Items.IndexOf(ddlSunny.Items.FindByValue(s));
                    }
                    catch {}
                }
            }
        }
Esempio n. 2
0
        private void Search_Show()
        {
            Utility.buildListBox(ddlDMList.Items, "select ID,Name from bm_bm", "ID", "Name", null, "");
            string s = Utility.GetParam("paID");

            try
            {
                ddlDMList.SelectedIndex = ddlDMList.Items.IndexOf(ddlDMList.Items.FindByValue(s));
            }
            catch { }
        }
Esempio n. 3
0
        void Search_Show()
        {
            Utility.buildListBox(ddlPavilion.Items, "select paID,Name from Pavilion ", "paID", "Name", "请选择", "");

            string s;

            s           = Utility.GetParam("search");
            tbRoom.Text = s;

            s = Utility.GetParam("paID");
            try
            {
                ddlPavilion.SelectedIndex = ddlPavilion.Items.IndexOf(ddlPavilion.Items.FindByValue(s));
            }
            catch { }
        }
        protected void Page_Show(object sender, EventArgs e)
        {
            Utility.buildListBox(ddlCell.Items, "select ID,Name from bm_Cell", "ID", "Name", null, "");
            Utility.buildListBox(ddlSunny.Items, "select ID,Name from bm_Sunny", "ID", "Name", null, "");
            Utility.buildListBox(ddlType.Items, "select ID,Name from bm_Indoor", "ID", "Name", null, "");
            //楼名称
            tbPaName.Text    = Utility.Dlookup("pavilion", "Name", "paID=" + CCUtility.ToSQL(paID.Value, FieldTypes.Number));
            tbPaName.Enabled = false;

            if (p_theID.Value.Length > 0)
            {
                string sWhere = "";

                sWhere += "hoID=" + CCUtility.ToSQL(p_theID.Value, FieldTypes.Number);

                string         sSQL      = "select * from House where " + sWhere;
                SqlDataAdapter dsCommand = new SqlDataAdapter(sSQL, Utility.Connection);
                DataSet        ds        = new DataSet();
                DataRow        row;

                if (dsCommand.Fill(ds, 0, 1, "Table") > 0)
                {
                    row         = ds.Tables[0].Rows[0];
                    theID.Value = CCUtility.GetValue(row, "hoID");
                    paID.Value  = CCUtility.GetValue(row, "paID");

                    tbRoom.Text  = CCUtility.GetValue(row, "hoRoom");
                    tbLayer.Text = CCUtility.GetValue(row, "hoFloor");
                    tbArea.Text  = CCUtility.GetValue(row, "hoArchArce");
                    tbArea2.Text = CCUtility.GetValue(row, "hoUseArce");

                    tbClientName.Text = CCUtility.GetValue(row, "Client_Name");
                    tbClientID.Text   = CCUtility.GetValue(row, "CLIENT_CARD");
                    tbPhone.Text      = CCUtility.GetValue(row, "CLIENT_PHONE");
                    tbClientCard.Text = CCUtility.GetValue(row, "CLIENT_ACCOUNT_NUMBER");
                    tbUseDate.Text    = CCUtility.GetValue(row, "USE_DATE");
                    tbUnit.Text       = CCUtility.GetValue(row, "COMPANY_NAME");

                    tbMemo.Text = CCUtility.GetValue(row, "Memo");
                    //类型
                    string s = CCUtility.GetValue(row, "indoorID");
                    try
                    {
                        ddlType.SelectedIndex = ddlType.Items.IndexOf(ddlType.Items.FindByValue(s));
                    }
                    catch { }
                    //单元
                    s = CCUtility.GetValue(row, "cellID");
                    try
                    {
                        ddlCell.SelectedIndex = ddlCell.Items.IndexOf(ddlCell.Items.FindByValue(s));
                    }
                    catch { }
                    //朝向
                    s = CCUtility.GetValue(row, "sunnyID");
                    try
                    {
                        ddlSunny.SelectedIndex = ddlSunny.Items.IndexOf(ddlSunny.Items.FindByValue(s));
                    }
                    catch { }
                }
            }
        }