Beispiel #1
0
 /// <summary>
 /// 加载引用对象
 /// </summary>
 public override void LoadRefrenceObject()
 {
     try
     {
         _EDSObj = Method.GetEtProjectInfoByID(_EDSID);
     }
     catch (Exception ex)
     {
         JLog.Instance.Error(ex.Message, MethodBase.GetCurrentMethod().Name,
                             MethodBase.GetCurrentMethod().Module.Name);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 拷贝对象内容
 /// </summary>
 /// <param name="Oject"></param>
 protected void DeepCopy(EtProjectInfo Oject)
 {
     try
     {
         if (Oject != null)
         {
             this._EDSID       = Oject.EDSID;
             this._CityName    = Oject.CityName;
             this._CityDesc    = Oject.CityDesc;
             this._ProjectName = Oject.ProjectName;
             this._Describe    = Oject.Describe;
         }
     }
     catch (Exception ex)
     {
         JLog.Instance.MethodName = MethodBase.GetCurrentMethod().Name;
         JLog.Instance.Error(ex.Message);
     }
 }
Beispiel #3
0
        /****1个主键***/
        /// <summary>
        /// 根据主键获取对象
        /// </summary>
        /// <param name="id"></param>
        internal EtProjectInfo(int id)
        {
            using (SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString))
            {
                EtProjectInfo Relse = null;
                /****1个主键***/
                string sql = "SELECT * FROM [ProjectInfo] WHERE EDSID = '" + id.ToString() + "'";

                using (var cnn = new SqlConnection(SQLDBHelper.ConnectionString))
                {
                    cnn.Open();
                    Relse = cnn.Query <EtProjectInfo>(sql, null).Single();
                    cnn.Close();
                    if (Relse != null)
                    {
                        DeepCopy(Relse);
                    }
                }
            }
        }