Пример #1
0
    public string BusMasterMetaName(string Code)
    {
        string Name = "";
        string ConnectionDBStr = ((DatabaseSettings)ConfigurationManager.GetSection("dataConfiguration")).DefaultDatabase;
        MaintainBusMasterMeta BCO = new MaintainBusMasterMeta(ConnectionDBStr);

        ArrayList ParameterList = new ArrayList();
        ParameterList.Clear();
        ParameterList.Add(Code);
        ParameterList.Add("");

        if (Code != "")
        {
            DataTable Dt = BCO.QueryForSLP(ParameterList);

            if (Dt.Rows.Count > 0)
            {
                Name = Dt.Rows[0]["Name"].ToString().Trim();
            }
            else
            {
                Name = "查無資料";
            }
        }

        return Name;
    }
        }//Initiziatoin_Component

        private void dataget()
        {
            ParameterList.Clear();
            SYSModel.MaintainBusMasterMeta BCO = new SYSModel.MaintainBusMasterMeta(ConntionDB);
            ParameterList.Add(_Code);
            ParameterList.Add("");

            if (_Code != "")
            {
                DataTable Dt = BCO.QueryForSLP(ParameterList);
                //DataTable Dt = BCO.QuerySwitch(SYSModel.MaintainBusMasterMeta.QueryType.CODE,
                //                          ParameterList
                //                          );
                if (Dt.Rows.Count > 0)
                {
                    _Name = Dt.Rows[0]["Name"].ToString().Trim();
                }
                else
                {
                    _Name = "查無資料";
                }
            }

            HiddenField1.Value = _Name;
            TextBoxName.Text = _Name;

        }//dataget