public Coupon() { CreationDate = DateTime.Now; const int expirationDays = 14; ExpirationDate = CreationDate.AddDays(expirationDays); }
public override ExecutionResult Run(IStepExecutionContext context) { var correctiveAction = new CorrectiveActionWorkflowData(); correctiveAction.WorkflowId = context.Workflow.Id; correctiveAction.CreationDate = CreationDate; correctiveAction.Description = Description; correctiveAction.FindingID = FindingID; correctiveAction.EmitterUserID = EmitterUserID; correctiveAction.PlantLocationID = PlantLocationID; correctiveAction.SectorLocationID = SectorLocationID; correctiveAction.PlantTreatmentID = PlantTreatmentID; correctiveAction.SectorTreatmentID = SectorTreatmentID; correctiveAction.ResponsibleUserID = ResponsibleUserID; correctiveAction.ReviewerUserID = ReviewerUserID; correctiveAction.DeadlineDatePlanification = CreationDate.AddDays(_parametrizationCorrectiveActionRepository.GetByCode(STATE_PARAMETRIZATION_CORRECTIVEACTION_CODE_PLANIFICATION)); correctiveAction.CorrectiveActionStateID = _correctiveActionStateRepository.GetByCode(STATE_OPEN_CODE); CorrectiveActionWorkflowData correctiveActionWorkFlowData = _correctiveActionRepository.Add(correctiveAction); _correctiveActionStateHistoryRepository.Add(correctiveActionWorkFlowData.CorrectiveActionID, correctiveActionWorkFlowData.CorrectiveActionStateID, EmitterUserID); EmailAddresses.AddRange(_userWorkflowRepository.GetUsersEmailResponsibleSGC()); EmailAddresses.Add(_userWorkflowRepository.GetUserEmailByID(ResponsibleUserID)); EmailAddresses.Add(_userWorkflowRepository.GetUserEmailByID(ReviewerUserID)); EmailAddresses.AddRange(_sectorPlantRepository.GetSectorPlantReferredEmail(Convert.ToInt32(correctiveAction.PlantTreatmentID), Convert.ToInt32(correctiveAction.SectorTreatmentID))); correctiveAction = _correctiveActionRepository.GetOneByWorkflowId(correctiveAction.WorkflowId); var emailType = "new"; this.EmailSubject = EmailStrings.GetSubjectCorrectiveAction(emailType); this.EmailMessage = EmailStrings.GetMessageCorrectiveAction(correctiveAction, _emailSettings.Url, emailType); return(ExecutionResult.Next()); }
public Survey(string surveyTitle, DateTime?closingDate = null) { CreationDate = DateTime.Now; SurveyTitle = surveyTitle; ClosingDate = (closingDate == null) ? CreationDate.AddDays(7) : (DateTime)closingDate; SurveyGuid = Guid.NewGuid().ToString(); }
public void CheckDays() { if (CreationDate.AddDays(Convert.ToInt32(new PaidToPromotePack(PackId).Ends.Value)) <= AppSettings.ServerTime) { Finish(); } }
public Coupon(IDateTimeProvider dateTimeProvider) { this.dateTimeProvider = dateTimeProvider; CreationDate = dateTimeProvider.Now; const int expirationDays = 14; ExpirationDate = CreationDate.AddDays(expirationDays); }
public override bool InRangeOfTime(DateTime phraseTime) { var alarmMinDate = CreationDate.AddDays(-Int32.Parse(this.Time)); DateTime timeWithoutSeconds = new DateTime(phraseTime.Year, phraseTime.Month, phraseTime.Day); DateTime minDateWithoutSeconds = new DateTime(alarmMinDate.Year, alarmMinDate.Month, alarmMinDate.Day); DateTime alarmDateWithoutSeconds = new DateTime(CreationDate.Year, CreationDate.Month, CreationDate.Day); return(timeWithoutSeconds >= minDateWithoutSeconds && minDateWithoutSeconds <= alarmDateWithoutSeconds); }
/// <summary> /// Создание этапа. /// </summary> /// <param name="name"> Имя этапа. </param> /// <param name="executor"> Исполнитель этапа. </param> /// <param name="comment"> Комментарий этапа. </param> public Stage(string name, Executor executor, string comment = "") { Name = name; Executor = executor; Comment = comment; CreationDate = DateTime.Now; ExpirationDate = CreationDate.AddDays(2); Status = Status.Created; }
/// <summary> /// Создание проекта. /// </summary> /// <param name="name"> Название проекта. </param> /// <param name="price"> Цена проекта. </param> /// <param name="executor"> Исполнитель проекта. </param> /// <param name="stages"> Этапы проекта. </param> public Project(string name, int price, Executor executor, List <Stage> stages) { Name = name; Price = price; Executor = executor; Stages = stages; CreationDate = DateTime.Now; ExpirationDate = CreationDate.AddDays(30); Status = Status.Created; }
public DateTime GetLastPostingDate() { SavingInterestsPostingEvent lastPosting = (SavingInterestsPostingEvent)Events.OrderByDescending( item => item.Date).FirstOrDefault(item => item is SavingInterestsPostingEvent && !item.Deleted); if (lastPosting == null) { if (Product is SavingsBookProduct) { if (((SavingsBookProduct)Product).InterestFrequency == OSavingInterestFrequency.EndOfDay || ((SavingBookContract)this).UseTermDeposit) { return(CreationDate.AddDays(-1)); } return(CreationDate); } return(CreationDate); } return(lastPosting.Date); }
public bool IsExpired(int valueDaysUntilExpire) { return(CreationDate.AddDays(valueDaysUntilExpire) < DateTime.UtcNow.Date); }
public virtual bool IsExpired(DateTime theDate) { return(CreationDate.AddDays(30) < theDate); }
// Empty constructor for EntityFramework public Survey() { SurveyGuid = Guid.NewGuid().ToString(); CreationDate = DateTime.Now; ClosingDate = CreationDate.AddDays(7); }