Exemple #1
0
 public static void Update(this RecordModel oldItem, RecordItem newItem)
 {
     foreach (var f in newItem.Fields)
     {
         oldItem[f.Name] = f.Value;
     }
 }
Exemple #2
0
 public static void CopyField(this RecordVersionModel recordTarget, RecordItem recordFrom)
 {
     foreach (var field in recordFrom.Fields)
     {
         recordTarget.AddField(field);
     }
 }
Exemple #3
0
        /// <summary>
        /// 数据是否更改验证
        /// </summary>
        /// <param name="rowID"></param>
        /// <param name="autoKey"></param>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public static CheckRecordChangedResult CheckRecordChanged(Guid rowID, int autoKey, string tableName)
        {
            CheckRecordChangedResult result = CheckRecordChangedResult.NotChanged;
            string     queryString          = string.Format("select RowID from {0} where AutoKey = @AutoKey", tableName);
            RecordItem record = DataCenter.ExecuteOneRecord <RecordItem>(queryString, "AutoKey", autoKey);

            if (record == null)
            {
                result = CheckRecordChangedResult.RecordNotFound;
            }
            else if (!string.Equals(record["RowID"].ToString(), rowID.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                result = CheckRecordChangedResult.Changed;
            }
            return(result);
        }