Example #1
0
        ///// <summary>
        ///// 获得数据库的初始状态
        ///// </summary>
        ///// <param name="param"></param>
        ///// <returns></returns>
        //protected override int OnRead(string param)
        //{
        //    Console.WriteLine("SettingDatasetService::OnRead");
        //    if (null != socket && socket.IsAvailable)
        //    {
        //        Console.WriteLine(datasetData.ToJson());
        //        socket.Send(new Message(Message.MessageType.READ, datasetData.ToJson()).ToJson());
        //    }
        //    return ReturnCode.SUCCESS;
        //}
        // /// <summary>
        // /// 增加一个设备
        // /// </summary>
        // /// <param name="param">数据库的名字</param>
        // /// <returns></returns>
        //protected override int OnAdd(string param)
        //{
        //    Console.WriteLine("SettingVideoAddressService::OnAdd");
        //    DataAngine.Model.table table = new DataAngine.Model.table();
        //    DataAngine.BLL.table tablebll = new DataAngine.BLL.table();
        //    table.name = param;

        //    if (true == tablebll.Add(table))
        //    {
        //        return ReturnSuccessMessage();
        //    }
        //    return ReturnFailMessage();
        //}

        /// <summary>
        /// 设置 选择设备
        /// </summary>
        /// <param name="param">Device类型Json</param>
        /// <returns></returns>
        protected override int OnSet(string param)
        {
            Console.WriteLine("SettingDatasetService::OnSet");

            selectedDevice = Device.CreateDeviceFromJSON(param);
            DatasetData.SaveSelectedDataSetName(param);
            return(ReturnSuccessMessage());
        }
Example #2
0
        // /// <summary>
        // /// 增加一个数据库
        // /// </summary>
        // /// <param name="param">数据库的名字</param>
        // /// <returns></returns>
        //protected override int OnAdd(string param)
        //{
        //    Console.WriteLine("SettingVideoAddressService::OnAdd");
        //    DataAngine.Model.table table = new DataAngine.Model.table();
        //    DataAngine.BLL.table tablebll = new DataAngine.BLL.table();
        //    table.name = param;

        //    if (true == tablebll.Add(table))
        //    {
        //        return ReturnSuccessMessage();
        //    }
        //    return ReturnFailMessage();
        //}

        /// <summary>
        /// 设置 选择哪个数据库
        /// </summary>
        /// <param name="param">DatasetName</param>
        /// <returns></returns>
        protected override int OnSet(string param)
        {
            Console.WriteLine("SettingDatasetService::OnSet");


            if (ReturnCode.SUCCESS == fa.LoadData(param))
            {
                DatasetData.SaveSelectedDataSetName(param);
                return(ReturnSuccessMessage());
            }
            else
            {
                return(ReturnFailMessage());
            }
        }