Example #1
0
        public void iAddAntenna(Antenna antenna) //向数据库中增加天线信息
        {
            string         cnStr = ConfigurationManager.ConnectionStrings["sqlProviderParallelTask"].ConnectionString;
            TransmitterLib tm    = new TransmitterLib(cnStr);

            try
            {
                bool     flag         = false;
                string[] antennaNames = tm.GetAntennaNames();
                if (antennaNames != null)
                {
                    foreach (string name in antennaNames)
                    {
                        if (name == antenna.Name)
                        {
                            flag = true;
                            break;
                        }
                    }
                }
                if (!flag)
                {
                    tm.AddAntenna(antenna);
                }
            }
            catch (SqlException e)
            {
                WcfException ex = new WcfException();
                ex.message = e.Message;
                throw new FaultException <WcfException>(ex, ex.message);
            }
        }
Example #2
0
        public string[] iGetAllAntenna(string type) //返回选中的天线类型所有的天线名称,在天线窗口中使用
        {
            string         cnStr = ConfigurationManager.ConnectionStrings["sqlProviderParallelTask"].ConnectionString;
            TransmitterLib tm    = new TransmitterLib(cnStr);

            try
            {
                return(tm.GetAntennaNames(type));
            }
            catch (SqlException e)
            {
                WcfException ex = new WcfException();
                ex.message = e.Message;
                throw new FaultException <WcfException>(ex, ex.message);
            }
        }