Example #1
0
 /// <summary>
 /// 加载引用对象
 /// </summary>
 public override void LoadRefrenceObject()
 {
     try
     {
         _CELLObj = Method.GetEtCellInfoByID(_CELLID);
     }
     catch (Exception ex)
     {
         JLog.Instance.Error(ex.Message, MethodBase.GetCurrentMethod().Name,
                             MethodBase.GetCurrentMethod().Module.Name);
     }
 }
Example #2
0
 /// <summary>
 /// 拷贝对象内容
 /// </summary>
 /// <param name="Oject"></param>
 protected void DeepCopy(EtCellInfo Oject)
 {
     try
     {
         if (Oject != null)
         {
             this._CELLID    = Oject.CELLID;
             this._StationID = Oject.StationID;
             this._GUID      = Oject.GUID;
         }
     }
     catch (Exception ex)
     {
         JLog.Instance.MethodName = MethodBase.GetCurrentMethod().Name;
         JLog.Instance.Error(ex.Message);
     }
 }
Example #3
0
        /****1个主键***/
        /// <summary>
        /// 根据主键获取对象
        /// </summary>
        /// <param name="id"></param>
        internal EtCellInfo(int id)
        {
            using (SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString))
            {
                EtCellInfo Relse = null;
                /****1个主键***/
                string sql = "SELECT * FROM [CellInfo] WHERE CELLID = '" + id.ToString() + "'";

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