protected void Page_Show(object sender, EventArgs e)
        {
            Utility.buildListBox(ddl_Type.Items, "select typeID,Name from bm_PlaceType order by 1", "typeID", "Name", null, "");

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

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

                string         sSQL      = "select * from AreaKK 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, "ID");
                    System.Web.UI.WebControls.TextBox[] tempBox = { btName, btAllName, btNote, btP1, btP2, btPhone, btMemo };
                    for (int i = 0; i < 7; i++)
                    {
                        tempBox[i].Text = row[i + 1].ToString();
                    }
                    //类型
                    string s = CCUtility.GetValue(row, "typeID");
                    try
                    {
                        ddl_Type.SelectedIndex = ddl_Type.Items.IndexOf(ddl_Type.Items.FindByValue(s));
                    }
                    catch { }
                }
            }
        }
Пример #2
0
        protected void Page_Show(object sender, EventArgs e)
        {
            if (p_theID.Value.Length > 0)
            {
                string sWhere = "";

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

                string         sSQL      = "select * from Area 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, "ID");
                    System.Web.UI.WebControls.TextBox[] tempBox = { TextBox1,  TextBox2,  TextBox3,  TextBox4,  TextBox5,  TextBox6,
                                                                    TextBox7,  TextBox8,  TextBox9,  TextBox10, TextBox11, TextBox12,
                                                                    TextBox13, TextBox14, TextBox15, TextBox16, TextBox17, TextBox18 };
                    for (int i = 0; i < 18; i++)
                    {
                        tempBox[i].Text = row[i + 1].ToString();
                    }
                }
            }
        }
Пример #3
0
        protected void Page_Show(object sender, EventArgs e)
        {
            if (p_theID.Value.Length > 0)
            {
                string sWhere = "";

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

                string         sSQL      = "select * from Carbarn 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, "ID");
                    tbNO.Text     = CCUtility.GetValue(row, "theNO");
                    tbCarNO.Text  = CCUtility.GetValue(row, "carNO");
                    tbType.Text   = CCUtility.GetValue(row, "carType");
                    tbArea.Text   = CCUtility.GetValue(row, "area");
                    tbPlace.Text  = CCUtility.GetValue(row, "Place");
                    tbMaster.Text = CCUtility.GetValue(row, "Master");
                    tbMemo.Text   = CCUtility.GetValue(row, "Memo");
                }
            }
        }
Пример #4
0
        protected void Page_Show(object sender, EventArgs e)
        {
            Utility.buildListBox(ddl_Level.Items, "select ID,Name from bm_sLevel", "ID", "Name", null, "");
            if (p_theID.Value.Length > 0)
            {
                string sWhere = "";

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

                string         sSQL      = "select * from Members 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];
                    tbLogin.Text    = CCUtility.GetValue(row, "member_login");
                    tbPassWord.Text = CCUtility.GetValue(row, "member_password");
                    tbName.Text     = CCUtility.GetValue(row, "name");
                    tbMemo.Text     = CCUtility.GetValue(row, "Memo");
                    string s = CCUtility.GetValue(row, "security_level_id");
                    try
                    {
                        ddl_Level.SelectedIndex = ddl_Level.Items.IndexOf(ddl_Level.Items.FindByValue(s));
                    }
                    catch {}
                }
            }
        }
        void Page_Show(object sender, System.EventArgs e)
        {
            // EditMeter Show begin
            Utility.buildListBox(ddl_Pavilion.Items, "select paID,Name from pavilion order by 1", "paID", "Name", null, "");
            //string cSQL="select hoID,hoRoom from House where paID="+CCUtility.ToSQL(Utility.GetParam("ddl_Pavilion"), FieldTypes.Number) ;

            if (p_theID.Value.Length == 0)
            {
                string ssSQL = "select hoID,hoRoom from House where paID=" + Utility.GetParam("paID");
                Utility.buildListBox(ddl_House.Items, ssSQL, "hoID", "hoRoom", null, "");
            }

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

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

                // EditMeter Open Event begin
                // EditMeter Open Event end
                string         sSQL      = "select * from Phone where " + sWhere;
                SqlDataAdapter dsCommand = new SqlDataAdapter(sSQL, Utility.Connection);
                DataSet        ds        = new DataSet();
                DataRow        row;

                if (dsCommand.Fill(ds, 0, 1, "EditMeter") > 0)
                {
                    row = ds.Tables[0].Rows[0];

                    theID.Value  = CCUtility.GetValue(row, "ID");
                    paID.Value   = CCUtility.GetValue(row, "paID");
                    tbPhone.Text = CCUtility.GetValue(row, "phone");                    //电话
                    tb_Memo.Text = CCUtility.GetValue(row, "memo");                     //注解

                    string s;
                    s = CCUtility.GetValue(row, "paID");                  //楼宇
                    try
                    {
                        ddl_Pavilion.SelectedIndex = ddl_Pavilion.Items.IndexOf(ddl_Pavilion.Items.FindByValue(s));
                    }
                    catch {}

                    sSQL = "select hoID,hoRoom from House where paID=" + s;
                    Utility.buildListBox(ddl_House.Items, sSQL, "hoID", "hoRoom", null, "");
                    s = CCUtility.GetValue(row, "hoID");                  //房间号
                    try
                    {
                        ddl_House.SelectedIndex = ddl_House.Items.IndexOf(ddl_House.Items.FindByValue(s));
                    }
                    catch {}
                }
            }
            ddl_Pavilion.Enabled = false;
        }
        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 {}
                }
            }
        }
        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 { }
                }
            }
        }