CBase.cs

来源:互联网 发布:关键字怎么优化 编辑:程序博客网 时间:2024/05/01 14:06

// CBase.cs
//

namespace learn.cs
{

 using System;
 using System.Configuration;

 /// <summary>
 /// CBase 的摘要说明。
 /// </summary>

 //----------------------------------基础类CBase-----------------------------------

 public class CBase
 {

  /// <summary>
  /// Creates a new instance of CBase
  /// </summary>

  public  int  ISDebug =1;
  protected string strConnectString;
  protected string strLastError;
  protected int strRETURN_VALUE;


  //构造函数
  public CBase()
  {

   if (System.Web.HttpContext.Current.Application["ConnectString"]!=null)
   {
    strConnectString=System.Web.HttpContext.Current.Application["ConnectString"].ToString();
   }

   else
   {
    strConnectString = ConfigurationSettings.AppSettings["test"];
   }
  }


  public  string ConnectionString
  {
   set
   {
    if(value !=null)
     this.strConnectString=value;
   }

   get
   {
    return strConnectString;
   }

  }


  public string LastError
  {
   get{return strLastError;}
  }

  public void ErrorLog(string ErrorMessage,string FunctionName )
  {

  }
  public int RETURN_VALUE
  {
   get{return strRETURN_VALUE;}
   set{strRETURN_VALUE=value;}
  }

 }

 //---------------------------------CBase类结束--------------------------------------------------
}

原创粉丝点击