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);
        }
Beispiel #3
0
 public ReminderDto(Reminder reminder)
 {
     ReminderId   = reminder.Id;
     EventId      = reminder.EventId;
     TimeBefore   = reminder.TimeBefore;
     ReminderType = reminder.ReminderType;
 }
Beispiel #4
0
        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();
        }
Beispiel #5
0
 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);
        }
Beispiel #7
0
 public RaidReminder(ReminderType type, string message, double hoursBeforeRaid, ulong channelId = 0)
 {
     Type            = type;
     Message         = message;
     HoursBeforeRaid = hoursBeforeRaid;
     ChannelId       = channelId;
 }
Beispiel #8
0
 /// <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;
 }
Beispiel #9
0
 /// <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);
     }
 }
Beispiel #11
0
        public ActionResult DeleteConfirmed(int id)
        {
            ReminderType reminderType = db.ReminderTypes.Find(id);

            db.ReminderTypes.Remove(reminderType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #12
0
        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)));
        }
Beispiel #13
0
 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));
 }
Beispiel #14
0
 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));
 }
Beispiel #15
0
        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));
        }
Beispiel #17
0
        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));
        }
Beispiel #18
0
        /// <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;
        }
Beispiel #19
0
        // 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);
            }
        }
Beispiel #21
0
 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));
     }
 }
Beispiel #22
0
        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();
        }
Beispiel #23
0
        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);
        }
Beispiel #24
0
        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);
        }
Beispiel #26
0
        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();
        }
Beispiel #27
0
 public void AddReminder(Raid raid, ReminderType reminderType, double hoursBeforeRaid, string[] text, ulong channelId = 0)
 {
     AddReminder(raid, reminderType, hoursBeforeRaid, string.Join(' ', text), channelId);
 }
Beispiel #28
0
 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!");
 }
Beispiel #29
0
 public Achievement()
 {
     achivedInt = 0;
     type       = ReminderType.BOOLEAN;
 }
Beispiel #30
0
 private static void ProcessReminder(ReminderType reminder)
 {
     Console.WriteLine("  Processing reminder.....");
 }
Beispiel #31
0
 public virtual void AddReminder(ReminderType reminderType, ReminderTimeType reminderTimeType,
     RepeatingType repeatingType, int customReminderTime)
 {
     Reminder = new Reminder(reminderType, reminderTimeType, repeatingType, customReminderTime);
 }
Beispiel #32
0
        /// <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;
                }
            }
        }
Beispiel #33
0
        //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));
        }