public void Connect(string ConnectionString)
 {
     this.mConnection = new Connection_Wcf();
     this.mConnection.Connect(ConnectionString);
 }
 public void Close()
 {
     this.mConnection = null;
 }
 public void Connect()
 {
     this.mConnection = new Connection_Wcf();
     this.mConnection.Connect();
 }
        public void SetSystemParameter(string ParameterName, string ParameterValue)
        {
            Connection_Wcf Cn = null;
            if (this.mConnection == null)
            {
                Cn = new Connection_Wcf();
                Cn.Connect();
            }
            else
            { Cn = this.mConnection; }

            this.SetSystemParameter(Cn, ParameterName, ParameterValue);
        }
        Connection_Wcf GetConnection()
        {
            Connection_Wcf Cn = null;
            if (this.mConnection == null)
            {
                Cn = new Connection_Wcf();
                Cn.Connect();
            }
            else
            { Cn = this.mConnection; }

            return Cn;
        }
        public DataTable Load_TableDetails(string ObjectName, Keys Keys, string Condition, List<Do_Constants.Str_ForeignKeyRelation> ForeignKeys)
        {
            Connection_Wcf Cn = null;
            if (this.mConnection == null)
            {
                Cn = new Connection_Wcf();
                Cn.Connect();
            }
            else
            { Cn = this.mConnection; }

            Do_Constants.Str_Request_Load Rl = new Do_Constants.Str_Request_Load();
            Rl.ObjectName = ObjectName;
            Rl.ForeignKeys = ForeignKeys;
            Rl.Condition = Condition;
            Rl.Key = Keys;
            Rl.ConnectionString = Cn.pConnectionString;

            Do_Constants.Str_Request_Session Rs = new Do_Constants.Str_Request_Session();
            Rs.SessionID = ClsDataAccess_Wcf_Session.Instance.pSessionID;

            Client_WcfService Client = Client_WcfService.CreateObject();
            String ResponseData = Client.Load_TableDetails(Rs, Rl);

            SimpleDataTable Sdt = SimpleDataTable.Deserialize(ResponseData);
            return Sdt.ToDataTable();
        }
        public DataTable GetTableDef(string TableName)
        {
            Connection_Wcf Cn = null;
            if (this.mConnection == null)
            {
                Cn = new Connection_Wcf();
                Cn.Connect();
            }
            else
            { Cn = this.mConnection; }

            Do_Constants.Str_Request_List Rl = new Do_Constants.Str_Request_List();
            Rl.ObjectName = TableName;
            Rl.ConnectionString = Cn.pConnectionString;

            Do_Constants.Str_Request_Session Rs = new Do_Constants.Str_Request_Session();
            Rs.SessionID = ClsDataAccess_Wcf_Session.Instance.pSessionID;

            Client_WcfService Client = Client_WcfService.CreateObject();
            string ResponseData = Client.GetTableDef(Rs, Rl);

            SimpleDataTable Sdt = SimpleDataTable.Deserialize(ResponseData);
            return Sdt.ToDataTable();
        }
        public string GetSystemParameter(string ParameterName, string DefaultValue = "")
        {
            //Connection_Wcf Cn = new Connection_Wcf();

            //try
            //{
            //    Cn.Connect();
            //    return this.GetSystemParameter(Cn, ParameterName, DefaultValue);
            //}
            //catch (Exception ex)
            //{ throw ex; }

            //[-]

            Connection_Wcf Cn = null;
            if (this.mConnection == null)
            {
                Cn = new Connection_Wcf();
                Cn.Connect();
            }
            else
            { Cn = this.mConnection; }

            return this.GetSystemParameter(Cn, ParameterName, DefaultValue);
        }
 public void Dispose()
 {
     if (this.mConnection != null)
     { this.mConnection = null; }
 }
        public PreparedQuery CreatePreparedQuery(string Query = "", List<QueryParameter> Parameters = null)
        {
            Connection_Wcf Cn = this.mConnection;
            if (Cn == null)
            {
                Cn = new Connection_Wcf();
                Cn.Connect();
            }

            return new PreparedQuery_Wcf(Cn, Query, Parameters);
        }