public async Task <IActionResult> Edit(int id, [Bind("ReminderTypeId,Description,RecurrenceHour,RecurrenceDay,RecurrenceMonth,RecurrenceYear")] ReminderType reminderType) { if (id != reminderType.ReminderTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reminderType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReminderTypeExists(reminderType.ReminderTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reminderType)); }
static async Task Main(string[] args) { IConfiguration configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .Build(); var repository = GetRepository(configuration["AzureStorage"]); var reminderTypes = await repository.FindAsync(new AllReminderTypes()); await RenderAsync(reminderTypes); var reminderType = await repository.FindAsync(new ReminderTypeById(new Guid("8806fad8-8b4e-4050-9e60-1a8bc0812c95"))); await RenderAsync(reminderType); var newReminderType = new ReminderType { ClientId = 1203, Id = Guid.NewGuid(), Name = $"Test Reminder Type {Guid.NewGuid().GetHashCode()}", Tags = new List <string> { "test", "todd", "meinershagen" } }; await repository.ExecuteAsync(new AddOrUpdateReminderType(newReminderType)); reminderTypes = await repository.FindAsync(new AllReminderTypes()); await RenderAsync(reminderTypes); }
public ReminderDto(Reminder reminder) { ReminderId = reminder.Id; EventId = reminder.EventId; TimeBefore = reminder.TimeBefore; ReminderType = reminder.ReminderType; }
public void AddReminder(Raid raid, ReminderType reminderType, double hoursBeforeRaid, string message, ulong channelId = 0) { RaidReminder reminder = new RaidReminder(reminderType, message, hoursBeforeRaid, channelId); raid.Reminders.Add(Guid.NewGuid(), reminder); SaveRaids(); }
public Reminder(ReminderType reminderType, ReminderTimeType reminderTimeType, RepeatingType repeatingType, int customReminderTime = 0) { RepeatingType = repeatingType; ReminderType = reminderType; CustomReminderTime = customReminderTime; ReminderTimeType = reminderTimeType; }
public List <Reminder> GetByStatus(ReminderType reminderType, int month, int year) { List <Reminder> reminders = new List <Reminder>(); using (var conn = new SqlCeConnection(Store.ConnectionString)) { conn.Open(); string sql = "SELECT * FROM " + tableName + " WHERE DATEPART(month,DueDate)=@Month " + "AND DATEPART(year,DueDate)=@Year AND Status=@Status"; var cmd = new SqlCeCommand(sql, conn); cmd.Parameters.Add("@Month", SqlDbType.Int).Value = month; cmd.Parameters.Add("@Year", SqlDbType.Int).Value = year; cmd.Parameters.Add("@Status", SqlDbType.NVarChar).Value = reminderType.ToString(); using (var rdr = cmd.ExecuteReader()) { reminders = Mapper.MapList <Reminder>(rdr, new ReminderMapper()); } } return(reminders); }
public RaidReminder(ReminderType type, string message, double hoursBeforeRaid, ulong channelId = 0) { Type = type; Message = message; HoursBeforeRaid = hoursBeforeRaid; ChannelId = channelId; }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> public Reminder(string key, ReminderType type, DateTime time, Action onUpdate) { Key = key; Type = type; _time = time; _onUpdate = onUpdate; }
/// <summary> /// Initializes a new instance of the <see cref="ReminderItem"/> class. /// </summary> /// <param name="m_index">M index.</param> /// <param name="m_type">M type.</param> /// <param name="m_clueIndex">M clue index.</param> /// <param name="m_name">M name.</param> /// <param name="m_content">M content.</param> private ReminderItem(int m_index, int m_type, int m_clueIndex, string m_name, string m_content) { index = m_index; type = (ReminderType)m_type; clueIndex = m_clueIndex; name = m_name; introduction = m_content; }
static async Task RenderAsync(ReminderType reminderType) { if (reminderType != null) { var json = JsonConvert.SerializeObject(reminderType); await Console.Out.WriteLineAsync(json); } }
public ActionResult DeleteConfirmed(int id) { ReminderType reminderType = db.ReminderTypes.Find(id); db.ReminderTypes.Remove(reminderType); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool AddReminder(string key, ReminderType type, DateTime time, Action callback) { if (string.IsNullOrEmpty(key) || reminders.Any(c => c.Key == key)) { return(false); } return(reminders.SafeAdd(new Reminder(key, type, time, callback))); }
public ActionResult Edit([Bind(Include = "tipoRecordatorioId,nombre")] ReminderType reminderType) { if (ModelState.IsValid) { db.Entry(reminderType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(reminderType)); }
public ActionResult Edit([Bind(Include = "ID,Type,Deleted,IPAddress,Longitude,Latitude")] ReminderType reminderType) { if (ModelState.IsValid) { db.Entry(reminderType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(reminderType)); }
public ActionResult Create([Bind(Include = "tipoRecordatorioId,nombre")] ReminderType reminderType) { if (ModelState.IsValid) { db.ReminderTypes.Add(reminderType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(reminderType)); }
public async Task <IActionResult> Create([Bind("ReminderTypeId,Description,RecurrenceHour,RecurrenceDay,RecurrenceMonth,RecurrenceYear")] ReminderType reminderType) { if (ModelState.IsValid) { _context.Add(reminderType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(reminderType)); }
public ActionResult Create([Bind(Include = "ID,Type,Deleted,IPAddress,Longitude,Latitude")] ReminderType reminderType) { if (ModelState.IsValid) { db.ReminderTypes.Add(reminderType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(reminderType)); }
/// <summary> /// Popup for task due alert /// </summary> /// <param name="node"></param> /// <param name="reminderType">should never be None. Acceptable values are First and Final.</param> public TaskReminderDialog(MapNode node, ReminderType reminderType) { InitializeComponent(); TaskView tv = new TaskView(node, DateHelper.GetTimePartString(node.GetDueDate()), onTaskViewEvent, false); tv.Width = 300; Text = "Task Due " + (reminderType == ReminderType.First ? "in " + (node.GetDueDate() - DateTime.Now).Minutes + " mins" : "now"); ClientSize = new Size(tv.Width, tv.Height); Controls.Add(tv); FormClosing += TaskReminderDialog_FormClosing; }
// GET: Baby/ReminderTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReminderType reminderType = db.ReminderTypes.Find(id); if (reminderType == null) { return(HttpNotFound()); } return(View(reminderType)); }
private void spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { int position = e.Position - 1; //pozycja 0 spinnera to wybór wszystkich przypomnień, enum o wartosci 0 to wizyty if (position < 0) { loadData(); } else { reminderType = (ReminderType)position; loadData(reminderType); } }
public static Uri GetReminderImage(ReminderType type) { if (type == ReminderType.EntryObject) { return(new Uri("pack://application:,,,/BodyArchitect.Client.Resources;component/Images/ReminderCalendar32.png", UriKind.Absolute)); } else if (type == ReminderType.ScheduleEntry) { return(new Uri("pack://application:,,,/BodyArchitect.Client.Resources;component/Images/ReminderScheduleEntries32.png", UriKind.Absolute)); } else if (type == ReminderType.Birthday) { return(new Uri("pack://application:,,,/BodyArchitect.Client.Resources;component/Images/Birthday.png", UriKind.Absolute)); } else { return(new Uri("pack://application:,,,/BodyArchitect.Client.Resources;component/Images/Reminder32.png", UriKind.Absolute)); } }
private void Reminder_TaskDue(MindMate.Model.MapNode node, ReminderType reminderType) { if (reminderType == ReminderType.Final) { TaskReminderDialog dialog = GetOpenDialog(node); if (dialog != null) { dialog.Close(); } } TaskReminderDialog dlg = new TaskReminderDialog(node, reminderType); dlg.Left = Screen.PrimaryScreen.Bounds.Width - 50 - dlg.Width; dlg.Top = Screen.PrimaryScreen.Bounds.Height - 100 - dlg.Height; dlg.TaskViewEvent += taskPlugin.OnTaskViewEvent; openDialogs.Add(dlg); dlg.FormClosing += Dlg_FormClosing; dlg.Show(); }
public Reminder AddReminder(ulong guildId, ulong channelID, ulong authorId, string text, DateTime time, ReminderType type = ReminderType.Default) { Reminder r = new Reminder() { GuildId = guildId, TextChannelId = channelID, AuthorId = authorId, ReminderText = text, ReminderTime = time, ReminderType = type }; r.SetDefaultTimeSpans(); // remove the expired ones so we aren't spammed when the reminder is made r.CheckExpiredTimeSpan(); m_database.GetCollection <Reminder>("Reminders") .Insert(r); return(r); }
public DT.Tour CreateTourWithCustomValues(int tourId, int contactsCount, short tourType, short communityId, DateTime tourDate, ReminderType reminderType, DateTime?reminderDate) { DT.Tour tour = new DT.Tour(); tour.Id = tourId; tour.Contacts = new List <Contacts.Contact>(); for (int i = 0; i < contactsCount; i++) { Person person = new Person(); person.Id = i; person.FirstName = "FN" + i; person.LastName = "LN"; tour.Contacts.Add(person); } tour.CommunityID = communityId; tour.TourDate = tourDate; tour.ReminderTypes = new List <ReminderType>() { reminderType }; tour.ReminderDate = reminderDate; return(tour); }
public static ReminderType Create() { var doc = new ReminderType { UBLVersionID = "2.1", ID = "12", IssueDate = "2010-04-14", AccountingSupplierParty = new SupplierPartyType { Party = new PartyType { EndpointID = new IdentifierType { schemeID = "GLN", schemeAgencyID = "9", Value = "1234567890123" }, PartyIdentification = new PartyIdentificationType[] { new PartyIdentificationType { ID = new IdentifierType { schemeID = "ZZZ", Value = "Supp123" } } }, PartyName = new PartyNameType[] { new PartyNameType { Name = "Salescompany ltd." } }, PostalAddress = new AddressType { ID = new IdentifierType { schemeID = "GLN", schemeAgencyID = "9", Value = "1231412341324" }, Postbox = "5467", StreetName = "Main street", AdditionalStreetName = "Suite 123", BuildingNumber = "1", Department = "Revenue department", CityName = "Big city", PostalZone = "54321", CountrySubentityCode = "RegionA", Country = new CountryType { IdentificationCode = new CodeType { listID = "ISO3166-1", listAgencyID = "6", Value = "DK" } } }, PartyTaxScheme = new PartyTaxSchemeType[] { new PartyTaxSchemeType { CompanyID = new IdentifierType { schemeID = "DKVAT", schemeAgencyID = "ZZZ", Value = "DK12345" }, TaxScheme = new TaxSchemeType { ID = new IdentifierType { schemeID = "UN/ECE 5153", schemeAgencyID = "6", Value = "VAT" } } } }, PartyLegalEntity = new PartyLegalEntityType[] { new PartyLegalEntityType { RegistrationName = "The Sellercompany Incorporated", CompanyID = new IdentifierType { schemeID = "CVR", schemeAgencyID = "ZZZ", Value = "5402697509" }, RegistrationAddress = new AddressType { CityName = "Big city", CountrySubentity = "RegionA", Country = new CountryType { IdentificationCode = "DK" } } } }, Contact = new ContactType { Telephone = "4621230", Telefax = "4621231", ElectronicMail = "*****@*****.**" }, Person = new PersonType[] { new PersonType { FirstName = "Antonio", FamilyName = "M", MiddleName = "Salemacher", JobTitle = "Sales manager" } } } }, AccountingCustomerParty = new CustomerPartyType { Party = new PartyType { EndpointID = new IdentifierType { schemeID = "GLN", schemeAgencyID = "9", Value = "1234567987654" }, PartyIdentification = new PartyIdentificationType[] { new PartyIdentificationType { ID = new IdentifierType { schemeID = "ZZZ", Value = "345KS5324" } } }, PartyName = new PartyNameType[] { new PartyNameType { Name = "Buyercompany ltd" } }, PostalAddress = new AddressType { ID = new IdentifierType { schemeID = "GLN", schemeAgencyID = "9", Value = "1238764941386" }, Postbox = "123", StreetName = "Anystreet", AdditionalStreetName = "Back door", BuildingNumber = "8", Department = "Accounting department", CityName = "Anytown", PostalZone = "101", CountrySubentity = "RegionB", Country = new CountryType { IdentificationCode = new CodeType { listID = "ISO3166-1", listAgencyID = "6", Value = "BE" } } }, PartyTaxScheme = new PartyTaxSchemeType[] { new PartyTaxSchemeType { CompanyID = new IdentifierType { schemeID = "BEVAT", schemeAgencyID = "ZZZ", Value = "BE54321" }, TaxScheme = new TaxSchemeType { ID = new IdentifierType { schemeID = "UN/ECE 5153", schemeAgencyID = "6", Value = "VAT" } } } }, PartyLegalEntity = new PartyLegalEntityType[] { new PartyLegalEntityType { RegistrationName = "The buyercompany inc.", CompanyID = new IdentifierType { schemeAgencyID = "ZZZ", schemeID = "ZZZ", Value = "5645342123" }, RegistrationAddress = new AddressType { CityName = "Mainplace", CountrySubentity = "RegionB", Country = new CountryType { IdentificationCode = "BE" } } } }, Contact = new ContactType { Telephone = "5121230", Telefax = "5121231", ElectronicMail = "*****@*****.**" }, Person = new PersonType[] { new PersonType { FirstName = "John", FamilyName = "X", MiddleName = "Doe", JobTitle = "Purchasing manager" } } } }, LegalMonetaryTotal = new MonetaryTotalType { LineExtensionAmount = new AmountType { currencyID = "EUR", Value = 1436.5M }, TaxExclusiveAmount = new AmountType { currencyID = "EUR", Value = 1436.5M }, TaxInclusiveAmount = new AmountType { currencyID = "EUR", Value = 1729M }, AllowanceTotalAmount = new AmountType { currencyID = "EUR", Value = 100M }, ChargeTotalAmount = new AmountType { currencyID = "EUR", Value = 100M }, PrepaidAmount = new AmountType { currencyID = "EUR", Value = 1000M }, PayableRoundingAmount = new AmountType { currencyID = "EUR", Value = 0.30M }, PayableAmount = new AmountType { currencyID = "EUR", Value = 729M } }, ReminderLine = new ReminderLineType[] { new ReminderLineType { ID = "1", BillingReference = new BillingReferenceType[] { new BillingReferenceType { InvoiceDocumentReference = new DocumentReferenceType { ID = "TOSL108" } } } } } }; doc.Xmlns = new System.Xml.Serialization.XmlSerializerNamespaces(new[] { new XmlQualifiedName("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"), new XmlQualifiedName("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"), }); return(doc); }
private void Reminder_TaskDue(MindMate.Model.MapNode node, ReminderType reminderType) { if(reminderType == ReminderType.Final) { TaskReminderDialog dialog = GetOpenDialog(node); if (dialog != null) dialog.Close(); } TaskReminderDialog dlg = new TaskReminderDialog(node, reminderType); dlg.Left = Screen.PrimaryScreen.Bounds.Width - 50 - dlg.Width; dlg.Top = Screen.PrimaryScreen.Bounds.Height - 100 - dlg.Height; dlg.TaskViewEvent += taskPlugin.OnTaskViewEvent; openDialogs.Add(dlg); dlg.FormClosing += Dlg_FormClosing; dlg.Show(); }
public void AddReminder(Raid raid, ReminderType reminderType, double hoursBeforeRaid, string[] text, ulong channelId = 0) { AddReminder(raid, reminderType, hoursBeforeRaid, string.Join(' ', text), channelId); }
public async Task UpdateReminderTypeAuthor([Name("ReminderID")] int id, [Name("Type")] ReminderType type) { _reminderService.UpdateReminderAuthor(Context.Guild.Id, id, Context.User.Id, type: type); await ReplyAsync("Ok!"); }
public Achievement() { achivedInt = 0; type = ReminderType.BOOLEAN; }
private static void ProcessReminder(ReminderType reminder) { Console.WriteLine(" Processing reminder....."); }
public virtual void AddReminder(ReminderType reminderType, ReminderTimeType reminderTimeType, RepeatingType repeatingType, int customReminderTime) { Reminder = new Reminder(reminderType, reminderTimeType, repeatingType, customReminderTime); }
/// <summary> /// Remove a queued item. /// </summary> /// <param name="id"></param> /// <param name="type"></param> public static void RemoveItem(string id, DateTime?date, ReminderType type) { bool found = false; foreach (Toast each in ToastManager.OpenToasts) { each.Dispatcher.Invoke(() => { Reminder _r = each.Tag as Reminder; if (_r.ID == id && _r.ReminderType == type && _r.EventStartDate == date) { (each as Window).Close(); found = true; } }); if (found) { return; } } Toast[] queued = new Toast[ToastManager.QueuedToasts.Count]; ToastManager.QueuedToasts.CopyTo(queued, 0); foreach (Toast each in queued) { each.Dispatcher.Invoke(() => { Reminder _r = each.Tag as Reminder; if (_r.ID == id && _r.ReminderType == type && _r.EventStartDate == date) { RemoveToast(each); found = true; } }); if (found) { return; } } if (_queue == null) { return; } Reminder[] rQueued = new Reminder[_queue.Count]; _queue.CopyTo(rQueued, 0); foreach (Reminder each in rQueued) { if (each.ID == id && each.ReminderType == type && each.EventStartDate == date) { RemoveReminder(each); return; } } }
//public object Convert(object value, Type targetType, object parameter, CultureInfo culture) //{ // ReminderType type = (ReminderType) value; // if(type==ReminderType.EntryObject) // { // return new BitmapImage(new Uri("pack://application:,,,/BodyArchitect.Client.Module.Instructor;component/Images/ReminderCalendar16.png", UriKind.Absolute)); // } // else if(type==ReminderType.ScheduleEntry) // { // return new BitmapImage(new Uri("pack://application:,,,/BodyArchitect.Client.Module.Instructor;component/Images/ScheduleEntries.png", UriKind.Absolute)); // } // else if (type == ReminderType.Birthday) // { // return new BitmapImage(new Uri("pack://application:,,,/BodyArchitect.Client.Resources;component/Images/Birthday.png", UriKind.Absolute)); // } // else // { // return new BitmapImage(new Uri("pack://application:,,,/BodyArchitect.Client.Module.Instructor;component/Images/Reminder16.png", UriKind.Absolute)); // } //} public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { ReminderType type = (ReminderType)value; return(GetReminderImage(type)); }