GetServiceVersion.cs 1.7 KB
using System;
using System.Collections.Generic;
using System.Text;
using Comm;
using BizFacade;

namespace App
{
    /// <summary>
    /// GetServiceVersion 的摘要说明。

    /// </summary>
    public class GetServiceVersion
    {
        private string _AllowWebServiceVersion = Const.AllowWebServiceVersion;
        private string _CurrentWebServiceVersion;
        private bool _CanCheckClientVersion = false;
        private bool _CanCheckWebServiceVersion = true;
        public GetServiceVersion()
        {
            try
            {
                string f_TemString;
                BaseSystem f_BaseSystem = new BaseSystem();
                f_TemString = f_BaseSystem.GetServiceVersion();
                f_TemString = f_TemString.Substring(0, f_TemString.LastIndexOf(@"."));
                f_TemString = f_TemString.Substring(0, f_TemString.LastIndexOf(@"."));
                this._CurrentWebServiceVersion = f_TemString;

            }
            catch (Exception ex)
            {
                this._CurrentWebServiceVersion = "";
                this._CanCheckWebServiceVersion = false;
            }
        }

        public bool CompareWebServiceVersion()
        {
            if (this._AllowWebServiceVersion == this._CurrentWebServiceVersion)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public string CurrentWebServiceVersion
        {
            get
            {
                return _CurrentWebServiceVersion;
            }
        }

        public bool CanCheckWebServiceVersion
        {
            get
            {
                return _CanCheckWebServiceVersion;
            }
        }
    }
}