public Result(AdStatus stat, string capStr, Bitmap capImg, AdResult adResult) { this.Stat = stat; this.CapStr = capStr; this.AdResult = adResult; this.CapImg = capImg; }
public static int InsertAd(int memberId, int categoryId, string title, string description, string url, decimal price, string location, int numDaysActive, AdLevel adLevel, AdStatus adStatus, AdType adType) { SiteSettings s = SiteSettings.GetSharedSettings(); int numViews = 0, numResponses = 0; DateTime dateCreated = DateTime.Now; DateTime? dateApproved = null; if (numDaysActive > s.MaxAdRunningDays) numDaysActive = s.MaxAdRunningDays; if (numDaysActive < 1) numDaysActive = 1; DateTime expirationDate = DateTime.Today.AddDays(numDaysActive); if (s.AdActivationRequired) { adStatus = AdStatus.ActivationPending; dateApproved = null; } else { adStatus = AdStatus.Activated; dateApproved = dateCreated; } if (adLevel == AdLevel.Unspecified) adLevel = AdLevel.Normal; int adId = DefaultValues.IdNullValue; AdsDataComponent.AdsRow ad = null; return adId; }
/// <summary> /// Производит удаление всех коллекций прогноза /// </summary> public void Dispose() { // Создаем все коллекции ForecastDatas.Clear(); ForecastDatas = null; BaseComponents.Clear(); BaseComponents = null; BaseComponentDirectives.Clear(); BaseComponentDirectives = null; Components.Clear(); Components = null; ComponentDirectives.Clear(); ComponentDirectives = null; AdStatus.Clear(); AdStatus = null; Damages.Clear(); Damages = null; DefferedItems.Clear(); DefferedItems = null; EngineeringOrders.Clear(); EngineeringOrders = null; OutOfPhaseItems.Clear(); OutOfPhaseItems = null; ServiceBulletins.Clear(); ServiceBulletins = null; MaintenanceChecks.Clear(); MaintenanceChecks = null; Kits.Clear(); Kits = null; DirectiveCollections.Clear(); DirectiveCollections = null; }
void Progress_Handle(object adContext, IProgress <AdStatus> progress, AdStatus status) { if (adContext == activeAdContext) { if (status == AdStatus.Unloaded) { TeardownAd(); } progress.Report(status); } }
public Ad(double Price, string Title, AdStatus AdStatus, string Description, DateTime Date, int DogsNumber, int Hours) { this.Price = Price; this.Title = Title; this.AdStatus = AdStatus; this.Description = Description; this.Date = Date; this.DogsNumber = DogsNumber; this.Hours = Hours; }
private Color GetRowColor(AdStatus status) { switch (status) { case AdStatus.Process: return(Color.Yellow); case AdStatus.Success: return(Color.LightGreen); case AdStatus.Failture: return(Color.OrangeRed); case AdStatus.Iddle: return(Color.White); } return(Color.White); }
public static string AdStatusToString(AdStatus adStatus) { switch (adStatus) { case AdStatus.Activated: return "Active"; case AdStatus.ActivationPending: return "Activation Pending"; case AdStatus.Inactive: return "Inactive / Expired"; case AdStatus.Deleted: return "Deleted"; default: return "(other)"; } }
public Ad CreateAd(IAdView AdView, IUserRepository UserRepository, User CurrentUser) { AdView.AdjustCreateView(); double Price = AdView.Price; DateTime Date = DateTime.Now.Date; string Description = AdView.Description; string Title = AdView.Title; AdStatus AdStatus = AdStatus.ACTIVE; int DogsNumber = AdView.DogsNumber; int Hours = AdView.Hours; Ad Ad; if (Description == "" || Title == "") { MessageBox.Show("Obvezno je ispuniti sva polja"); return(null); } if (Price <= 0 || DogsNumber <= 0 || Hours <= 0) { MessageBox.Show("Broj godina/Cijena/Broj pasa ne može manji ili jednak 0"); return(null); } if (CurrentUser.UserType == UserType.WALKER) { Ad = AdFactory.CreateWalkerAd(Price, Title, AdStatus, Description, Date, DogsNumber, Hours, (Walker)CurrentUser); Walker Walker = (Walker)CurrentUser; Walker.AddAd((WalkerAd)Ad); UserRepository.UpdateUser(Walker); } else { Ad = AdFactory.CreateOwnerAd(Price, Title, AdStatus, Description, Date, DogsNumber, Hours, (Owner)CurrentUser); Owner Owner = (Owner)CurrentUser; Owner.AddAd((OwnerAd)Ad); UserRepository.UpdateUser(Owner); } var form = (Form)AdView; form.Hide(); return(Ad); }
/// <summary> /// 根据ID更改物料状态 /// </summary> /// <param name="accountId">账户id</param> /// <param name="groupIds">主键IDs</param> /// <param name="status">状态</param> /// <returns>返回执行后的结果</returns> public IExecuteResult UpdateStatusByIds(ulong accountId, ulong[] groupIds, AdStatus status) { if (groupIds == null || groupIds.Length == 0) { return(ExecuteResult.Fail(SystemErrors.Malformed, "#Illegal groupId")); } try { object[] parameterValues; StringBuilder sGroup = new StringBuilder(); foreach (ulong groupId in groupIds) { sGroup.Append(groupId).Append(','); } string groupString = sGroup.ToString().TrimEnd(','); //获取参数的值 parameterValues = new object[] { accountId, groupString }; //验证CampaignId和AccountId从属关系 uint selectCount = _slaveDB.SpExecuteScalar <uint>(SpName.SpIsNotExistByAccountIdAndGroupId, ParametersObject.IsNotExistByAccountIdAndGroupId, parameterValues); if (selectCount != groupIds.Length) { return(ExecuteResult.Fail(SystemErrors.NotFound, SpName.SpIsNotExistByAccountIdAndGroupId + ":Executed count = 0 #Paramate [AccountId] is " + accountId + " [GroupId] is " + groupString)); } //获取参数的值 parameterValues = new object[] { groupString, status, 0 }; _masterDB.SpExecuteTable(SpName.SpUpdateGroupsStatus, ParametersObject.UpdateGroupsStatus, parameterValues); return(ExecuteResult.Succeed(true)); } catch (Exception ex) { _tracing.Error(ex, null); return(ExecuteResult.Fail(SystemErrors.Unknown, ex.Message)); } }
public static Ad CreateWalkerAd(double Price, string Title, AdStatus AdStatus, string Description, DateTime Date, int DogsNumber, int Hours, Walker Walker) { return(new WalkerAd(Price, Title, AdStatus, Description, Date, DogsNumber, Hours, Walker)); }
public OwnerAd(double Price, string Title, AdStatus AdStatus, string Description, DateTime Date, int DogsNumber, int Hours, Owner Owner) : base(Price, Title, AdStatus, Description, Date, DogsNumber, Hours) { this.Owner = Owner; }
/// <summary> /// 根据指定的编号更新一个或者批量更新Campaign的status /// </summary> /// <param name="userId">用户编号</param> /// <param name="accountId">账号编号</param> /// <param name="campaignIdData">Campaign编号</param> /// <param name="status">Campaign状态</param> /// <returns>返回执行后的结果</returns> /// <exception cref="ArgumentNullException">参数不能为空</exception> public IExecuteResult UpdateCampaignStatus(uint userId, ulong accountId, ulong[] campaignIdData, AdStatus status) { if (userId == 0) { return(ExecuteResult.Fail(SystemErrors.Malformed, "#Illegal user id!")); } if (accountId == 0) { return(ExecuteResult.Fail(SystemErrors.Malformed, "#Illegal account id!")); } if (campaignIdData == null) { throw new ArgumentNullException("campaignIdData"); } try { if (campaignIdData.Length == 1) { StringBuilder campaignId = new StringBuilder(); campaignId = campaignId.Append(campaignIdData[0]); //获取参数的值 object[] parameterValues = new object[] { accountId, campaignId, userId }; //验证CampaignId和AccountId从属关系 DataTable dt = _slaveDB.SpExecuteTable(SpName.SpIsNotExistByAccountIdAndCampaignId, ParametersObject.IsNotExistByAccountIdAndCampaignId, parameterValues); if (dt.Rows.Count == 0) { return(ExecuteResult.Fail(SystemErrors.NotFound, SpName.SpIsNotExistByAccountIdAndCampaignId + ":Executed count = 0")); } //修改一条Campaign status的信息 _masterDB.SpExecuteTable(SpName.SpUpdateCampaignStatusById, new[] { "CampaignID", "Status", "ModifyBy" }, new object[] { campaignId, status, userId }); return(ExecuteResult.Succeed(true)); } else { StringBuilder campaignIds = new StringBuilder(); for (int i = 0; i < campaignIdData.Length; i++) { campaignIds.Append(campaignIdData[i]); if (i != campaignIdData.Length - 1) { campaignIds.Append(','); } } //获取参数的值 object[] parameterValues = new object[] { accountId, campaignIds, userId }; //验证CampaignId和AccountId从属关系 uint selectCount = _slaveDB.SpExecuteScalar <uint>(SpName.SpIsNotExistByAccountIdAndCampaignIds, ParametersObject.IsNotExistByAccountIdAndCampaignIds, parameterValues); if (selectCount != campaignIdData.Length) { return(ExecuteResult.Fail(SystemErrors.NotFound, "Executed count != campaignId.Length")); } //修改一条Campaign status的信息 _masterDB.SpExecuteTable(SpName.SpUpdateCampaignsStatus, new[] { "CampaignIDs", "Status", "ModifyBy" }, new object[] { campaignIds, status, userId }); return(ExecuteResult.Succeed(true)); } } catch (Exception ex) { _tracing.Error(ex, null); return(ExecuteResult.Fail(SystemErrors.Unknown, ex.Message)); } }
public static void RelistAd(int adId, int categoryId, string title, string description, string url, decimal price, string location, int numDaysActive, AdLevel adLevel, AdStatus adStatus, AdType adType, string code, string syn1, string syn2, string syn3, string syn4, string syn5) { SiteSettings s = SiteSettings.GetSharedSettings(); DateTime dateCreated = DateTime.Now; DateTime? dateApproved = null; if (numDaysActive > s.MaxAdRunningDays) numDaysActive = s.MaxAdRunningDays; if (numDaysActive < 1) numDaysActive = 1; DateTime expirationDate = DateTime.Today.AddDays(numDaysActive); if (s.AdActivationRequired) { adStatus = AdStatus.ActivationPending; dateApproved = null; } else { adStatus = AdStatus.Activated; dateApproved = dateCreated; } if (adLevel == AdLevel.Unspecified) adLevel = AdLevel.Normal; AdsDataComponent.AdsRow ad = null; using (AdsDataAdapter db = new AdsDataAdapter()) { db.RelistAd(adId, categoryId, title, description, url, price, location, expirationDate, dateCreated, dateApproved, (int)adLevel, (int)adStatus, (int)adType, code, syn1, syn2, syn3, syn4, syn5); if (s.AdminNotification == AdminNotificationSetting.EachAd) ad = GetFirstRow(db.GetAdById(adId)); } if (ad != null) Maintenance.SendAdNotification(ad); }
public static AdsDataComponent.AdsDataTable GetAdsByStatus(AdStatus adStatus, int memberId) { using (AdsDataAdapter db = new AdsDataAdapter()) { return db.GetAdsByStatus((int)adStatus, memberId); } }
public static void RemoveFromDatabaseByStatus(AdStatus adStatus) { PhotosDB.RemovePhotosOfDeletedAds(); using (AdsDataAdapter db = new AdsDataAdapter()) { db.RemoveAdsByStatus((int)adStatus); } }
public static void UpdateAdStatus(int adId, AdStatus adStatus) { using (AdsDataAdapter db = new AdsDataAdapter()) { db.UpdateAdStatus(adId, (int)adStatus); } }
public static void UpdateAdStatusList(List<int> adIds, AdStatus adStatus) { }
public static AdsDataComponent.AdsDataTable GetAdsByStatus(AdStatus adStatus) { return GetAdsByStatus(adStatus, DefaultValues.IdNullValue); }
public static void UpdateAdStatusList(List<int> adIds, AdStatus adStatus) { using (AdsDataAdapter db = new AdsDataAdapter()) { for (int i = 0; i < adIds.Count; i++) db.UpdateAdStatus(adIds[i], (int)adStatus); } }
public static AdsDataComponent.AdsDataTable GetAdsByStatus(AdStatus adStatus, int memberId) { return null; }
private List <Request> AddRequest(List <Request> requests, List <string> dataList, int sheetId, int rowIndex, bool border, bool boldFont = false, AdStatus status = AdStatus.Start) { List <CellData> values = new List <CellData>(); var borderFormat = border ? GetCellFormat(boldFont) :null; foreach (var s in dataList) { values.Add(new CellData { UserEnteredValue = new ExtendedValue { StringValue = s }, UserEnteredFormat = ((dataList.IndexOf(s) == 3) && (s != "Ролик")) ? GetCellFormat(boldFont, true, status):borderFormat }); } requests.Add(new Request { UpdateCells = new UpdateCellsRequest { Start = new GridCoordinate { SheetId = sheetId, RowIndex = rowIndex, ColumnIndex = 0 }, Rows = new List <RowData> { new RowData { Values = values } }, Fields = "userEnteredValue, userEnteredFormat" } }); requests.Add(new Request { UpdateDimensionProperties = new UpdateDimensionPropertiesRequest { Range = new DimensionRange { SheetId = sheetId, Dimension = "COLUMNS", StartIndex = 3, EndIndex = 4 }, Properties = new DimensionProperties { PixelSize = 450 }, Fields = "pixelSize" } }); return(requests); }
public static void UpdateAdStatus(int adId, AdStatus adStatus) { }
private static CellFormat GetCellFormat(bool bold, bool needColor = false, AdStatus status = AdStatus.Start) { var clr = new Color(); if (status != AdStatus.Start) { clr = new Color { Red = 1 } } ; else { clr = new Color { Green = 1 } }; var color = needColor ? clr : null; return(new CellFormat { TextFormat = new TextFormat { Bold = bold }, Borders = new Borders { Bottom = new Border { Style = "SOLID", Color = new Color { Red = 0.1f, Green = 0.1f, Blue = 0.1f } }, Top = new Border { Style = "SOLID", Color = new Color { Red = 0.1f, Green = 0.1f, Blue = 0.1f } }, Left = new Border { Style = "SOLID", Color = new Color { Red = 0.1f, Green = 0.1f, Blue = 0.1f } }, Right = new Border { Style = "SOLID", Color = new Color { Red = 0.1f, Green = 0.1f, Blue = 0.1f } } }, BackgroundColor = color }); }
public static void RemoveFromDatabaseByStatus(AdStatus adStatus) { PhotosDB.RemovePhotosOfDeletedAds(); }
void Progress_Handle(object adContext, IProgress<AdStatus> progress, AdStatus status) { if (adContext == activeAdContext) { if (status == AdStatus.Unloaded) { TeardownAd(); } progress.Report(status); } }
public static int CountAdsByStatus(AdStatus adStatus) { return 0; }
public static int CountAdsByStatus(AdStatus adStatus) { using (StatsDataAdapter db = new StatsDataAdapter()) { return Convert.ToInt32(db.CountAdsByStatus((int)adStatus, null)); } }