Beispiel #1
0
 public bool BinarySettings_Updated(Column column = null)
 {
     return(BinarySettings.ToJson() != SavedBinarySettings && BinarySettings.ToJson() != null &&
            (column == null ||
             column.DefaultInput.IsNullOrEmpty() ||
             column.DefaultInput.ToString() != BinarySettings.ToJson()));
 }
Beispiel #2
0
        private void Set(DataRow dataRow, string tableAlias = null)
        {
            AccessStatus = Databases.AccessStatuses.Selected;
            foreach (DataColumn dataColumn in dataRow.Table.Columns)
            {
                var column = new ColumnNameInfo(dataColumn.ColumnName);
                if (column.TableAlias == tableAlias)
                {
                    switch (column.Name)
                    {
                    case "BinaryId":
                        if (dataRow[column.ColumnName] != DBNull.Value)
                        {
                            BinaryId      = dataRow[column.ColumnName].ToLong();
                            SavedBinaryId = BinaryId;
                        }
                        break;

                    case "TenantId":
                        TenantId      = dataRow[column.ColumnName].ToInt();
                        SavedTenantId = TenantId;
                        break;

                    case "ReferenceId":
                        ReferenceId      = dataRow[column.ColumnName].ToLong();
                        SavedReferenceId = ReferenceId;
                        break;

                    case "Guid":
                        Guid      = dataRow[column.ColumnName].ToString();
                        SavedGuid = Guid;
                        break;

                    case "Ver":
                        Ver      = dataRow[column.ColumnName].ToInt();
                        SavedVer = Ver;
                        break;

                    case "BinaryType":
                        BinaryType      = dataRow[column.ColumnName].ToString();
                        SavedBinaryType = BinaryType;
                        break;

                    case "Title":
                        Title      = new Title(dataRow, "BinaryId");
                        SavedTitle = Title.Value;
                        break;

                    case "Body":
                        Body      = dataRow[column.ColumnName].ToString();
                        SavedBody = Body;
                        break;

                    case "Bin":
                        Bin      = dataRow.Bytes("Bin");
                        SavedBin = Bin;
                        break;

                    case "Thumbnail":
                        Thumbnail      = dataRow.Bytes("Bin");
                        SavedThumbnail = Thumbnail;
                        break;

                    case "Icon":
                        Icon      = dataRow.Bytes("Bin");
                        SavedIcon = Icon;
                        break;

                    case "FileName":
                        FileName      = dataRow[column.ColumnName].ToString();
                        SavedFileName = FileName;
                        break;

                    case "Extension":
                        Extension      = dataRow[column.ColumnName].ToString();
                        SavedExtension = Extension;
                        break;

                    case "Size":
                        Size      = dataRow[column.ColumnName].ToInt();
                        SavedSize = Size;
                        break;

                    case "ContentType":
                        ContentType      = dataRow[column.ColumnName].ToString();
                        SavedContentType = ContentType;
                        break;

                    case "BinarySettings":
                        BinarySettings      = dataRow[column.ColumnName].ToString().Deserialize <BinarySettings>() ?? new BinarySettings();
                        SavedBinarySettings = BinarySettings.ToJson();
                        break;

                    case "Comments":
                        Comments      = dataRow[column.ColumnName].ToString().Deserialize <Comments>() ?? new Comments();
                        SavedComments = Comments.ToJson();
                        break;

                    case "Creator":
                        Creator      = SiteInfo.User(dataRow[column.ColumnName].ToInt());
                        SavedCreator = Creator.Id;
                        break;

                    case "Updator":
                        Updator      = SiteInfo.User(dataRow[column.ColumnName].ToInt());
                        SavedUpdator = Updator.Id;
                        break;

                    case "CreatedTime":
                        CreatedTime      = new Time(dataRow, column.ColumnName);
                        SavedCreatedTime = CreatedTime.Value;
                        break;

                    case "UpdatedTime":
                        UpdatedTime      = new Time(dataRow, column.ColumnName); Timestamp = dataRow.Field <DateTime>(column.ColumnName).ToString("yyyy/M/d H:m:s.fff");
                        SavedUpdatedTime = UpdatedTime.Value;
                        break;

                    case "IsHistory": VerType = dataRow[column.ColumnName].ToBool() ? Versions.VerTypes.History : Versions.VerTypes.Latest; break;
                    }
                }
            }
        }
 public bool BinarySettings_Updated()
 {
     return(BinarySettings.ToJson() != SavedBinarySettings && BinarySettings.ToJson() != null);
 }