public Snapshot(RegularSchedule parent) { UniqueID = Guid.NewGuid(); Programs = new List <SnapshotProgram>(); ActiveWeeks = new List <DateRange>(); ContractSettings = new ContractSettings(); }
protected ScheduleSection(ProgramSchedule parent) { Parent = parent; UniqueID = Guid.NewGuid(); Index = parent.Sections.Any() ? parent.Sections.Max(s => s.Index) + 1 : 0; Programs = new List <Program>(); Summary = new SectionSummary(this); ContractSettings = new ContractSettings(); #region Options ShowTime = true; ShowDaypart = true; ShowDay = true; ShowStation = true; ShowProgram = true; ShowLenght = false; ShowSpots = true; ShowEmptySpots = false; ShowCost = true; ShowLogo = false; ShowTotalPeriods = true; ShowTotalSpots = true; ShowAverageRate = true; ShowTotalRate = true; ShowNetRate = false; ShowDiscount = false; #endregion }
private IEnumerable <Shape> GetContractInfoShapes(ContractSettings contractSettings, Presentation templatePresentation) { var shapes = new List <Shape>(); foreach (Slide slide in templatePresentation.Slides) { foreach (Shape shape in slide.Shapes) { for (var i = 1; i <= shape.Tags.Count; i++) { var addShape = false; var tagName = shape.Tags.Name(i); if ((tagName == "APPROVAL1" || tagName == "SIGLINE1") && contractSettings.ShowSignatureLine) { addShape = true; } else if (tagName == "RATESEXPIRE" && contractSettings.RateExpirationDate.HasValue) { shape.TextFrame.TextRange.Text = String.Format("{0} {1}", shape.TextFrame.TextRange.Text, contractSettings.RateExpirationDate.Value.ToString("MM/dd/yy")); addShape = true; } else if (tagName == "DISCLAMIER" && contractSettings.ShowDisclaimer) { addShape = true; } if (addShape) { shapes.Add(shape); } } } } return(shapes); }
public OptionSet(RegularSchedule parent) { UniqueID = Guid.NewGuid(); TotalPeriods = 1; Programs = new List <OptionProgram>(); ContractSettings = new ContractSettings(); }
protected ScheduleSection(ProgramScheduleContent parent) { Parent = parent; UniqueID = Guid.NewGuid(); Index = parent.Sections.Any() ? parent.Sections.Max(s => s.Index) + 1 : 0; Programs = new List <Program>(); DigitalInfo = new MediaDigitalInfo(); Summary = new SectionSummary(this); ContractSettings = new ContractSettings(); #region Options ShowRating = ParentScheduleSettings.UseDemo & !String.IsNullOrEmpty(ParentScheduleSettings.Demo); ShowTime = true; ShowDaypart = true; ShowDay = true; ShowStation = true; ShowProgram = true; ShowLenght = false; ShowCPP = ParentScheduleSettings.UseDemo & !String.IsNullOrEmpty(ParentScheduleSettings.Demo); ShowGRP = ParentScheduleSettings.UseDemo & !String.IsNullOrEmpty(ParentScheduleSettings.Demo); ShowSpots = true; ShowEmptySpots = false; ShowCost = true; ShowLogo = false; ShowTotalPeriods = true; ShowTotalSpots = true; ShowTotalGRP = ParentScheduleSettings.UseDemo & !String.IsNullOrEmpty(ParentScheduleSettings.Demo); ShowTotalCPP = ParentScheduleSettings.UseDemo & !String.IsNullOrEmpty(ParentScheduleSettings.Demo); ShowAverageRate = true; ShowTotalRate = true; ShowNetRate = false; ShowDiscount = false; #endregion }
public void SetByModel(TenantModel tenantModel) { TenantName = tenantModel.TenantName; Title = tenantModel.Title; Body = tenantModel.Body; ContractSettings = tenantModel.ContractSettings; ContractDeadline = tenantModel.ContractDeadline; DisableAllUsersPermission = tenantModel.DisableAllUsersPermission; DisableStartGuide = tenantModel.DisableStartGuide; LogoType = tenantModel.LogoType; HtmlTitleTop = tenantModel.HtmlTitleTop; HtmlTitleSite = tenantModel.HtmlTitleSite; HtmlTitleRecord = tenantModel.HtmlTitleRecord; Comments = tenantModel.Comments; Creator = tenantModel.Creator; Updator = tenantModel.Updator; CreatedTime = tenantModel.CreatedTime; UpdatedTime = tenantModel.UpdatedTime; VerUp = tenantModel.VerUp; Comments = tenantModel.Comments; ClassHash = tenantModel.ClassHash; NumHash = tenantModel.NumHash; DateHash = tenantModel.DateHash; DescriptionHash = tenantModel.DescriptionHash; CheckHash = tenantModel.CheckHash; AttachmentsHash = tenantModel.AttachmentsHash; }
public ERC20(ContractSettings settings) { eth = new Ethereum(settings.ContractAddress, settings.Abi, settings.SenderAddress, settings.SenderPrimaryKey, settings.EthNode); }
public void AssignLevelSettings(ContractSettings contract) { this._currentSpawnCondition = contract.contractSpawnConditions; this._clientRules = new List <ClientRules>(contract.allClientRules); this._defaultContractSpawnInterval = contract.defaultContractSpawnInterval; this._timedContracts = contract.timedContracts; this._completionTime = contract.completionTimeInSeconds; }
public SimpleSummaryState() { ShowAdvertiser = true; ShowDecisionMaker = true; ShowPresentationDate = true; ShowFlightDates = true; ItemsState = new List <SimpleSummaryItemState>(); ContractSettings = new ContractSettings(); }
public void FillContractInfo(Design design, ContractSettings contractSettings, StorageDirectory folder) { var templateFile = new StorageFile(folder.RelativePathParts.Merge(contractSettings.TemplateName)); var templatePresentation = _powerPointObject.Presentations.Open(Path.Combine(templateFile.LocalPath, contractSettings.TemplateName), WithWindow: MsoTriState.msoFalse); foreach (var shape in GetContractInfoShapes(contractSettings, templatePresentation)) { shape.Copy(); design.SlideMaster.Shapes.Paste(); } templatePresentation.Close(); }
public BaseSummarySettings() { ShowAdvertiser = true; ShowDecisionMaker = true; ShowPresentationDate = true; ShowFlightDates = true; ShowMonthly = false; ShowTotal = false; SlideHeader = string.Empty; ContractSettings = new ContractSettings(); }
public Ethereum(string contractAddress, string abi, string senderAddress, string senderPrimaryKey, string node) { contractSettings = new ContractSettings() { ContractAddress = contractAddress, Abi = abi, SenderAddress = senderAddress, SenderPrimaryKey = senderPrimaryKey, EthNode = node }; _web3 = new Web3(node); }
public void SetByModel(TenantModel tenantModel) { TenantName = tenantModel.TenantName; Title = tenantModel.Title; Body = tenantModel.Body; ContractSettings = tenantModel.ContractSettings; ContractDeadline = tenantModel.ContractDeadline; Comments = tenantModel.Comments; Creator = tenantModel.Creator; Updator = tenantModel.Updator; CreatedTime = tenantModel.CreatedTime; UpdatedTime = tenantModel.UpdatedTime; VerUp = tenantModel.VerUp; Comments = tenantModel.Comments; }
private void SetContractSettings() { var dataRow = Rds.ExecuteTable( context: this, statements: Rds.SelectTenants( column: Rds.TenantsColumn() .ContractSettings() .ContractDeadline(), where : Rds.TenantsWhere().TenantId(TenantId))) .AsEnumerable() .FirstOrDefault(); ContractSettings = dataRow?.String("ContractSettings").Deserialize <ContractSettings>() ?? new ContractSettings(); ContractSettings.Deadline = dataRow?.DateTime("ContractDeadline"); }
public void AfterCreate() { if (DigitalInfo == null) { DigitalInfo = new MediaDigitalInfo(); } DigitalInfo.AfterCreate(); if (Summary == null) { Summary = new SectionSummary(this); } Summary.AfterCreate(); if (ContractSettings == null) { ContractSettings = new ContractSettings(); } }
public void SetByModel(TenantModel tenantModel) { TenantName = tenantModel.TenantName; Title = tenantModel.Title; Body = tenantModel.Body; ContractSettings = tenantModel.ContractSettings; ContractDeadline = tenantModel.ContractDeadline; LogoType = tenantModel.LogoType; HtmlTitleTop = tenantModel.HtmlTitleTop; HtmlTitleSite = tenantModel.HtmlTitleSite; HtmlTitleRecord = tenantModel.HtmlTitleRecord; Comments = tenantModel.Comments; Creator = tenantModel.Creator; Updator = tenantModel.Updator; CreatedTime = tenantModel.CreatedTime; UpdatedTime = tenantModel.UpdatedTime; VerUp = tenantModel.VerUp; Comments = tenantModel.Comments; }
private void Set(DataRow dataRow) { AccessStatus = Databases.AccessStatuses.Selected; foreach (DataColumn dataColumn in dataRow.Table.Columns) { var name = dataColumn.ColumnName; switch (name) { case "TenantId": if (dataRow[name] != DBNull.Value) { TenantId = dataRow[name].ToInt(); SavedTenantId = TenantId; } break; case "Ver": Ver = dataRow[name].ToInt(); SavedVer = Ver; break; case "TenantName": TenantName = dataRow[name].ToString(); SavedTenantName = TenantName; break; case "Title": Title = new Title(dataRow, "TenantId"); SavedTitle = Title.Value; break; case "Body": Body = dataRow[name].ToString(); SavedBody = Body; break; case "ContractSettings": ContractSettings = GetContractSettings(dataRow); SavedContractSettings = ContractSettings?.RecordingJson(); break; case "ContractDeadline": ContractDeadline = dataRow[name].ToDateTime(); SavedContractDeadline = ContractDeadline; break; case "Comments": Comments = dataRow["Comments"].ToString().Deserialize <Comments>() ?? new Comments(); SavedComments = Comments.ToJson(); break; case "Creator": Creator = SiteInfo.User(dataRow.Int(name)); SavedCreator = Creator.Id; break; case "Updator": Updator = SiteInfo.User(dataRow.Int(name)); SavedUpdator = Updator.Id; break; case "CreatedTime": CreatedTime = new Time(dataRow, "CreatedTime"); SavedCreatedTime = CreatedTime.Value; break; case "UpdatedTime": UpdatedTime = new Time(dataRow, "UpdatedTime"); Timestamp = dataRow.Field <DateTime>("UpdatedTime").ToString("yyyy/M/d H:m:s.fff"); SavedUpdatedTime = UpdatedTime.Value; break; case "IsHistory": VerType = dataRow[name].ToBool() ? Versions.VerTypes.History : Versions.VerTypes.Latest; break; } } }
public OptionSummary(OptionsContent parent) { Parent = parent; if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots) { SpotType = SpotType.Week; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots) { SpotType = SpotType.Month; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) { SpotType = SpotType.Total; } else { SpotType = SpotType.Week; } ApplySettingsForAll = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.UniversalToggles;; ContractSettings = new ContractSettings(); #region Options ShowLineId = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowLineId; ShowLogo = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowLogo; ShowCampaign = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowCampaign; ShowComments = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowComments; ShowTotalCost = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTotalCost; ShowTallySpots = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTallySpots; ShowTallyCost = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTallyCost; ShowSpotsX = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowSpotsX; UseDecimalRates = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.UseDecimalRates; #endregion UpdateSpotType(true); }
public SimpleSummaryState() { SaveFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "closing summary" })); TemplatesFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "closing summary", "templates" })); ShowAdvertiser = true; ShowDecisionMaker = true; ShowPresentationDate = true; ShowFlightDates = true; ShowMonthly = false; ShowTotal = false; SlideHeader = string.Empty; Advertiser = string.Empty; DecisionMaker = string.Empty; PresentationDate = DateTime.MinValue; FlightDatesStart = DateTime.MinValue; FlightDatesEnd = DateTime.MinValue; ItemsState = new List <SimpleSummaryItemState>(); ContractSettings = new ContractSettings(); }
public SnapshotSummary(SnapshotContent parent) { Parent = parent; ApplySettingsForAll = MediaMetaData.Instance.ListManager.DefaultSnapshotSettings.UniversalToggles; ContractSettings = new ContractSettings(); #region Options ShowLineId = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowLineId; ShowLogo = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowLogo; ShowCampaign = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowCampaign; ShowComments = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowComments; ShowSpots = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowSpots; ShowCost = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowCost; ShowTotalWeeks = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowTotalWeeks; ShowTotalCost = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowTotalCost; ShowTallySpots = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowTallySpots; ShowTallyCost = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowTallyCost; ShowSpotsX = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.ShowSpotsX; UseDecimalRates = MediaMetaData.Instance.ListManager.DefaultSnapshotSummarySettings.UseDecimalRates; #endregion }
private void Set(Context context, SiteSettings ss, 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 "TenantId": if (dataRow[column.ColumnName] != DBNull.Value) { TenantId = dataRow[column.ColumnName].ToInt(); SavedTenantId = TenantId; } break; case "Ver": Ver = dataRow[column.ColumnName].ToInt(); SavedVer = Ver; break; case "TenantName": TenantName = dataRow[column.ColumnName].ToString(); SavedTenantName = TenantName; break; case "Title": Title = new Title(dataRow, "TenantId"); SavedTitle = Title.Value; break; case "Body": Body = dataRow[column.ColumnName].ToString(); SavedBody = Body; break; case "ContractSettings": ContractSettings = GetContractSettings(dataRow); SavedContractSettings = ContractSettings?.RecordingJson(); break; case "ContractDeadline": ContractDeadline = dataRow[column.ColumnName].ToDateTime(); SavedContractDeadline = ContractDeadline; break; case "DisableAllUsersPermission": DisableAllUsersPermission = dataRow[column.ColumnName].ToBool(); SavedDisableAllUsersPermission = DisableAllUsersPermission; break; case "DisableStartGuide": DisableStartGuide = dataRow[column.ColumnName].ToBool(); SavedDisableStartGuide = DisableStartGuide; break; case "LogoType": LogoType = (LogoTypes)dataRow[column.ColumnName].ToInt(); SavedLogoType = LogoType.ToInt(); break; case "HtmlTitleTop": HtmlTitleTop = dataRow[column.ColumnName].ToString(); SavedHtmlTitleTop = HtmlTitleTop; break; case "HtmlTitleSite": HtmlTitleSite = dataRow[column.ColumnName].ToString(); SavedHtmlTitleSite = HtmlTitleSite; break; case "HtmlTitleRecord": HtmlTitleRecord = dataRow[column.ColumnName].ToString(); SavedHtmlTitleRecord = HtmlTitleRecord; break; case "Comments": Comments = dataRow[column.ColumnName].ToString().Deserialize <Comments>() ?? new Comments(); SavedComments = Comments.ToJson(); break; case "Creator": Creator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName)); SavedCreator = Creator.Id; break; case "Updator": Updator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName)); SavedUpdator = Updator.Id; break; case "CreatedTime": CreatedTime = new Time(context, dataRow, column.ColumnName); SavedCreatedTime = CreatedTime.Value; break; case "UpdatedTime": UpdatedTime = new Time(context, 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.Bool(column.ColumnName) ? Versions.VerTypes.History : Versions.VerTypes.Latest; break; default: switch (Def.ExtendedColumnTypes.Get(column.Name)) { case "Class": Class( columnName: column.Name, value: dataRow[column.ColumnName].ToString()); SavedClass( columnName: column.Name, value: Class(columnName: column.Name)); break; case "Num": Num( columnName: column.Name, value: dataRow[column.ColumnName].ToDecimal()); SavedNum( columnName: column.Name, value: Num(columnName: column.Name)); break; case "Date": Date( columnName: column.Name, value: dataRow[column.ColumnName].ToDateTime()); SavedDate( columnName: column.Name, value: Date(columnName: column.Name)); break; case "Description": Description( columnName: column.Name, value: dataRow[column.ColumnName].ToString()); SavedDescription( columnName: column.Name, value: Description(columnName: column.Name)); break; case "Check": Check( columnName: column.Name, value: dataRow[column.ColumnName].ToBool()); SavedCheck( columnName: column.Name, value: Check(columnName: column.Name)); break; case "Attachments": Attachments( columnName: column.Name, value: dataRow[column.ColumnName].ToString() .Deserialize <Attachments>() ?? new Attachments()); SavedAttachments( columnName: column.Name, value: Attachments(columnName: column.Name).ToJson()); break; } break; } } } }
public virtual void Dispose() { ContractSettings = null; }
public Ethereum(ContractSettings settings) { contractSettings = settings; _web3 = new Web3(settings.EthNode); }
public OptionSet(OptionsContent parent) { Parent = parent; UniqueID = Guid.NewGuid(); Index = parent.Options.Any() ? parent.Options.Max(s => s.Index) + 1 : 0; Logo = MediaMetaData.Instance.ListManager.Images.Where(g => g.IsDefault).Select(g => g.Images.FirstOrDefault(i => i.IsDefault)).FirstOrDefault()?.Clone <ImageSource, ImageSource>(); TotalPeriods = 1; Programs = new List <OptionProgram>(); DigitalInfo = new MediaDigitalInfo(); ContractSettings = new ContractSettings(); #region Options ShowLineId = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLineId; ShowLogo = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLogo; ShowStation = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowStation; ShowProgram = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowProgram; ShowDay = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowDay; ShowTime = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTime; ShowSpots = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots; ShowRate = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowRate; ShowLenght = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLenght; ShowCost = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowCost; ShowTotalSpots = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTallySpots; ShowTotalCost = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTallyCost; ShowAverageRate = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowAverageRate; ShowSpotsX = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowSpotsX; UseDecimalRates = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.UseDecimalRates; DefaultColumnPositions = true; if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowStation) { PositionStation = DefaultPositionStation; } else { PositionStation = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowProgram) { PositionProgram = DefaultPositionProgram; } else { PositionProgram = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowDay) { PositionDay = DefaultPositionDay; } else { PositionDay = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTime) { PositionTime = DefaultPositionTime; } else { PositionTime = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLenght) { PositionLenght = DefaultPositionLenght; } else { PositionLenght = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) { PositionSpots = DefaultPositionSpots; } else { PositionSpots = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowRate) { PositionRate = DefaultPositionRate; } else { PositionRate = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowCost) { PositionCost = DefaultPositionCost; } else { PositionCost = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots) { SpotType = SpotType.Week; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots) { SpotType = SpotType.Month; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) { SpotType = SpotType.Total; } else { SpotType = SpotType.Week; } #endregion }
public void Deserialize(XmlNode node) { foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "UniqueID": { Guid temp; if (Guid.TryParse(childNode.InnerText, out temp)) { UniqueID = temp; } } break; case "Index": { double temp; if (Double.TryParse(childNode.InnerText, out temp)) { Index = temp; } } break; case "Name": Name = childNode.InnerText; break; case "Logo": Logo = new ImageSource(); Logo.Deserialize(childNode); break; case "Comment": Comment = childNode.InnerText; break; case "TotalPeriods": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { TotalPeriods = temp; } } break; case "ShowLineId": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowLineId = temp; } } break; case "ShowLogo": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowLogo = temp; } } break; case "ShowStation": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowStation = temp; } } break; case "ShowProgram": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowProgram = temp; } } break; case "ShowDay": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowDay = temp; } } break; case "ShowLenght": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowLenght = temp; } } break; case "ShowTime": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowTime = temp; } } break; case "ShowRate": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowRate = temp; } } break; case "ShowSpots": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowSpots = temp; } } break; case "ShowCost": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowCost = temp; } } break; case "ShowTotalSpots": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowTotalSpots = temp; } } break; case "ShowTotalCost": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowTotalCost = temp; } } break; case "ShowAverageRate": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowAverageRate = temp; } } break; case "ShowSpotsX": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { ShowSpotsX = temp; } } break; case "UseDecimalRates": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { UseDecimalRates = temp; } } break; case "PositionStation": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionStation = temp; } } break; case "PositionProgram": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionProgram = temp; } } break; case "PositionDay": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionDay = temp; } } break; case "PositionLenght": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionLenght = temp; } } break; case "PositionTime": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionTime = temp; } } break; case "PositionRate": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionRate = temp; } } break; case "PositionSpots": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionSpots = temp; } } break; case "PositionCost": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { PositionCost = temp; } } break; case "SpotType": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { SpotType = (SpotType)temp; } } break; case "Programs": foreach (XmlNode programNode in childNode.ChildNodes) { var program = new OptionProgram(); program.Deserialize(programNode); Programs.Add(program); } break; case "ContractSettings": ContractSettings.Deserialize(childNode); break; } } }
public SnapshotSummary(RegularSchedule parent) { ApplySettingsForAll = false; ContractSettings = new ContractSettings(); }
private void Set(IContext context, SiteSettings ss, 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 "TenantId": if (dataRow[column.ColumnName] != DBNull.Value) { TenantId = dataRow[column.ColumnName].ToInt(); SavedTenantId = TenantId; } break; case "Ver": Ver = dataRow[column.ColumnName].ToInt(); SavedVer = Ver; break; case "TenantName": TenantName = dataRow[column.ColumnName].ToString(); SavedTenantName = TenantName; break; case "Title": Title = new Title(dataRow, "TenantId"); SavedTitle = Title.Value; break; case "Body": Body = dataRow[column.ColumnName].ToString(); SavedBody = Body; break; case "ContractSettings": ContractSettings = GetContractSettings(dataRow); SavedContractSettings = ContractSettings?.RecordingJson(); break; case "ContractDeadline": ContractDeadline = dataRow[column.ColumnName].ToDateTime(); SavedContractDeadline = ContractDeadline; break; case "LogoType": LogoType = (LogoTypes)dataRow[column.ColumnName].ToInt(); SavedLogoType = LogoType.ToInt(); break; case "HtmlTitleTop": HtmlTitleTop = dataRow[column.ColumnName].ToString(); SavedHtmlTitleTop = HtmlTitleTop; break; case "HtmlTitleSite": HtmlTitleSite = dataRow[column.ColumnName].ToString(); SavedHtmlTitleSite = HtmlTitleSite; break; case "HtmlTitleRecord": HtmlTitleRecord = dataRow[column.ColumnName].ToString(); SavedHtmlTitleRecord = HtmlTitleRecord; break; case "Comments": Comments = dataRow[column.ColumnName].ToString().Deserialize <Comments>() ?? new Comments(); SavedComments = Comments.ToJson(); break; case "Creator": Creator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName)); SavedCreator = Creator.Id; break; case "Updator": Updator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName)); SavedUpdator = Updator.Id; break; case "CreatedTime": CreatedTime = new Time(context, dataRow, column.ColumnName); SavedCreatedTime = CreatedTime.Value; break; case "UpdatedTime": UpdatedTime = new Time(context, 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 void Deserialize(XmlNode node) { bool tempBool; foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "SpotType": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { SpotType = (SpotType)temp; } } break; case "ApplySettingsForAll": if (bool.TryParse(childNode.InnerText, out tempBool)) { ApplySettingsForAll = tempBool; } break; case "ContractSettings": ContractSettings.Deserialize(childNode); break; #region Options case "ShowLineId": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowLineId = tempBool; } break; case "ShowLogo": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowLogo = tempBool; } break; case "ShowCampaign": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowCampaign = tempBool; } break; case "ShowComments": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowComments = tempBool; } break; case "ShowSpots": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowSpots = tempBool; } break; case "ShowCost": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowCost = tempBool; } break; case "ShowTotalPeriods": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalPeriods = tempBool; } break; case "ShowTotalCost": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalCost = tempBool; } break; case "ShowTallySpots": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTallySpots = tempBool; } break; case "ShowTallyCost": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTallyCost = tempBool; } break; case "ShowSpotsX": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowSpotsX = tempBool; } break; case "UseDecimalRates": if (bool.TryParse(childNode.InnerText, out tempBool)) { UseDecimalRates = tempBool; } break; #endregion } } }
public OptionSummary() { ApplySettingsForAll = false; ContractSettings = new ContractSettings(); }
public void Deserialize(XmlNode node) { bool tempBool; foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "UniqueID": { Guid temp; if (Guid.TryParse(childNode.InnerText, out temp)) { UniqueID = temp; } } break; case "Index": { double temp; if (Double.TryParse(childNode.InnerText, out temp)) { Index = temp; } } break; case "Name": Name = childNode.InnerText; break; case "ShowAverageRate": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowAverageRate = tempBool; } break; case "ShowCPP": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowCPP = tempBool; } break; case "ShowCost": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowCost = tempBool; } break; case "ShowDay": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowDay = tempBool; } break; case "ShowDaypart": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowDaypart = tempBool; } break; case "ShowDiscount": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowDiscount = tempBool; } break; case "ShowGRP": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowGRP = tempBool; } break; case "ShowLenght": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowLenght = tempBool; } break; case "ShowLogo": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowLogo = tempBool; } break; case "ShowNetRate": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowNetRate = tempBool; } break; case "ShowRate": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowRate = tempBool; } break; case "ShowRating": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowRating = tempBool; } break; case "ShowStation": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowStation = tempBool; } break; case "ShowProgram": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowProgram = tempBool; } break; case "ShowTime": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTime = tempBool; } break; case "ShowSpots": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowSpots = tempBool; } break; case "ShowEmptySpots": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowEmptySpots = tempBool; } break; case "ShowTotalCPP": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalCPP = tempBool; } break; case "ShowTotalGRP": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalGRP = tempBool; } break; case "ShowTotalPeriods": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalPeriods = tempBool; } break; case "ShowTotalRate": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalRate = tempBool; } break; case "ShowTotalSpots": if (bool.TryParse(childNode.InnerText, out tempBool)) { ShowTotalSpots = tempBool; } break; case "OutputPerQuater": if (bool.TryParse(childNode.InnerText, out tempBool)) { OutputPerQuater = tempBool; } break; case "OutputMaxPeriods": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { OutputMaxPeriods = temp; } } break; case "OutputNoBrackets": if (bool.TryParse(childNode.InnerText, out tempBool)) { OutputNoBrackets = tempBool; } break; case "UseDecimalRates": if (bool.TryParse(childNode.InnerText, out tempBool)) { UseDecimalRates = tempBool; } break; case "UseGenericDateColumns": if (bool.TryParse(childNode.InnerText, out tempBool)) { UseGenericDateColumns = tempBool; } break; case "Programs": foreach (XmlNode programNode in childNode.ChildNodes) { var program = new Program(this); program.Deserialize(programNode); Programs.Add(program); } break; case "Summary": Summary.Deserialize(childNode); break; case "ContractSettings": ContractSettings.Deserialize(childNode); break; } } }