Exemple #1
0
        internal void DeleteCLick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            int id = 0;

            Int32.TryParse((string)(sender as PackIcon).DataContext, out id);

            ViewModel.WinMessageBoxItem wmsb = new ViewModel.WinMessageBoxItem((rm as ResourceManager).GetString("Message_Delete_Title"), (rm as ResourceManager).GetString("Message_DeleteContact"), PackIconKind.WarningCircle);
            Windows.WinMessageBox       msb  = new Windows.WinMessageBox(wmsb, (rm as ResourceManager), ResourceNames, true);

            if (msb.ShowDialog() == true)
            {
                if (WPE.Contacts.FirstOrDefault(x => x.Con_ID.Equals(id)) != null)
                {
                    WPE.Dispose();
                    WPE = new Models.WeddingPlannerEntities();
                    var cont = new Models.Contacts {
                        Con_ID = id
                    };
                    WPE.Contacts.Attach(cont);
                    WPE.Contacts.Remove(cont);
                    WPE.SaveChanges();
                    CreateContactList();
                }
            }
        }
Exemple #2
0
 void Page_Loaded(object sender, RoutedEventArgs e)
 {
     WPE = new Models.WeddingPlannerEntities();
     LoadFormats((rm as ResourceManager), ResourceNames);
     BT_ExportToExcel.Visibility = Visibility.Hidden;
     CreateContactList();
 }
Exemple #3
0
        internal void CreateExpenseList(ResourceManager _rm)
        {
            rm = _rm;
            if (CB_Offer.SelectedIndex > -1)
            {
                LB_Expense.IsEnabled = true;
                LB_Cost.IsEnabled    = true;
                LB_Count.IsEnabled   = true;
                BT_Save.IsEnabled    = true;
                TB_Expense.IsEnabled = true;
                TB_Count.IsEnabled   = true;
                TB_Cost.IsEnabled    = true;

                int id = VenueIDs[CB_Offer.SelectedIndex];
                WPE     = new Models.WeddingPlannerEntities();
                expList = WPE.WeddingExpenses.Where(x => x.VenueID.Equals(id)).OrderBy(x => x.ExpenseName).ToList();
                ExpenseItems.Children.Clear();
                foreach (var item in expList)
                {
                    var exp = new ViewModel.Expense(item.ExpenseName.Trim(), f.StringCurrencyFormat(item.Expense.ToString().Trim()), item.ID, f.StringCurrencyFormat(item.Count.ToString().Trim()));
                    ExpenseItems.Children.Add(new UserControls.UserControlExpenses(exp, (rm as ResourceManager), ResourceNames, this));
                }
                Amount_Reload();

                if (ExpenseItems.Children.Count > 0)
                {
                    BT_ExportToExcel.Visibility = Visibility.Visible;
                }
                else
                {
                    BT_ExportToExcel.Visibility = Visibility.Hidden;
                }
            }
        }
Exemple #4
0
 void SaveGuests(object sender)
 {
     WPE = new Models.WeddingPlannerEntities();
     if ((sender as Button).Name == "BT_SaveGroom")
     {
         if (f.IsName(TB_GroomGuests, TB_GroomGuests.Text.Trim(), (rm as ResourceManager)) && f.IsNumber(TB_GroomGuestsCount, f.StringRemoveWhiteSpace(TB_GroomGuestsCount.Text.Trim()), (rm as ResourceManager)))
         {
             Models.Guests gue = new Models.Guests();
             gue.Guest_Name  = TB_GroomGuests.Text.Trim();
             gue.Guest_Count = Convert.ToInt32(f.StringRemoveWhiteSpace(TB_GroomGuestsCount.Text.Trim()));
             gue.Wedding_ID  = Wedding.ID;
             gue.Bride_Groom = 0;
             WPE.Guests.Add(gue);
             WPE.SaveChanges();
             CreateGuestList((rm as ResourceManager));
         }
     }
     else if ((sender as Button).Name == "BT_SaveBride")
     {
         if (f.IsName(TB_BrideGuests, TB_BrideGuests.Text.Trim(), (rm as ResourceManager)) && f.IsNumber(TB_BrideGuestsCount, f.StringRemoveWhiteSpace(TB_BrideGuestsCount.Text.Trim()), (rm as ResourceManager)))
         {
             Models.Guests gue = new Models.Guests();
             gue.Guest_Name  = TB_BrideGuests.Text.Trim();
             gue.Guest_Count = Convert.ToInt32(f.StringRemoveWhiteSpace(TB_BrideGuestsCount.Text.Trim()));
             gue.Wedding_ID  = Wedding.ID;
             gue.Bride_Groom = 1;
             WPE.Guests.Add(gue);
             WPE.SaveChanges();
             CreateGuestList((rm as ResourceManager));
         }
     }
 }
Exemple #5
0
        internal void DeleteExpense(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            int id = 0;

            Int32.TryParse((sender as PackIcon).DataContext.ToString(), out id);

            ViewModel.WinMessageBoxItem wmsb = new ViewModel.WinMessageBoxItem((rm as ResourceManager).GetString("Message_Delete_Title"), (rm as ResourceManager).GetString("Message_DeleteExp"), PackIconKind.WarningCircle);
            Windows.WinMessageBox       msb  = new Windows.WinMessageBox(wmsb, (rm as ResourceManager), ResourceNames, true);

            if (msb.ShowDialog() == true)
            {
                if (WPE.WeddingExpenses.Any(x => x.ID.Equals(id)))
                {
                    WPE.Dispose();
                    WPE = new Models.WeddingPlannerEntities();
                    var ex = new Models.WeddingExpenses {
                        ID = id
                    };
                    WPE.WeddingExpenses.Attach(ex);
                    WPE.WeddingExpenses.Remove(ex);
                    WPE.SaveChanges();
                    CreateExpenseList((rm as ResourceManager));
                }
            }
        }
Exemple #6
0
        void Modification()
        {
            System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            Models.Login _user = WPE.Login.SingleOrDefault(b => b.IDLogin == ActualUser.IDLogin);

            if (_user != null && f.IsYourPassword(T_OldPassword, T_OldPassword.Password, ActualUser, (rm as ResourceManager)))
            {
                if (TB_user.Text != string.Empty)
                {
                    if (f.IsName(TB_user, TB_user.Text.Trim(), (rm as ResourceManager)))
                    {
                        _user.User = TB_user.Text.Trim();
                    }
                }
                if (T_passwd.Password != string.Empty || T_passwdAgain.Password != string.Empty)
                {
                    if (f.IsPassword(T_passwd, T_passwd.Password, (rm as ResourceManager)) && f.IsPasswordAreEqual(T_passwd, T_passwdAgain, T_passwd.Password, T_passwdAgain.Password, (rm as ResourceManager)))
                    {
                        _user.Password = f.Encrypt(T_passwd.Password.Trim());
                    }
                }
                if (TB_email.Text != string.Empty)
                {
                    if (f.IsValidEmail(TB_email, TB_email.Text.Trim(), (rm as ResourceManager)))
                    {
                        _user.EmailAddress = TB_email.Text.Trim();
                    }
                }
                WPE.SaveChanges();
                WPE                    = new Models.WeddingPlannerEntities();
                ActualUser             = _user;
                h.LB_TitleHome.Content = h.LB_TitleHome.Content.ToString().Split(' ')[0] + " " + ActualUser.User.Trim();
            }
            System.Windows.Input.Mouse.OverrideCursor = null;
        }
Exemple #7
0
        internal void CreateGuestList(ResourceManager _rm)
        {
            rm  = _rm;
            WPE = new Models.WeddingPlannerEntities();
            gr  = 0;
            br  = 0;

            guestList = WPE.Guests.Where(x => x.Wedding_ID.Equals(Wedding.ID)).ToList();
            BrideItems.Children.Clear();

            foreach (var item in guestList.Where(x => x.Bride_Groom.Equals(1)).OrderBy(x => x.Guest_Name).ToList())
            {
                var it = new ViewModel.Guest(item.Guest_Name.Trim(), item.Guest_Count, item.Guest_ID.ToString());
                BrideItems.Children.Add(new UserControls.UserControlGuests(it, this, ResourceNames, (rm as ResourceManager)));
                br = br + it.Person;
            }
            GroomItems.Children.Clear();
            foreach (var item in guestList.Where(x => x.Bride_Groom.Equals(0)).OrderBy(x => x.Guest_Name).ToList())
            {
                var it = new ViewModel.Guest(item.Guest_Name.Trim(), item.Guest_Count, item.Guest_ID.ToString());
                GroomItems.Children.Add(new UserControls.UserControlGuests(it, this, ResourceNames, (rm as ResourceManager)));
                gr = gr + it.Person;
            }
            LB_BrideGuestCount.Content = (rm as ResourceManager).GetString("LB_BrideGuestCount") + " " + br;
            LB_GroomGuestCount.Content = (rm as ResourceManager).GetString("LB_GroomGuestCount") + " " + gr;

            if (guestList.Count > 0)
            {
                BT_ExportToExcel.Visibility = Visibility.Visible;
            }
            else
            {
                BT_ExportToExcel.Visibility = Visibility.Hidden;
            }
        }
Exemple #8
0
 internal void RefreshCalendarArray()
 {
     WPE              = new Models.WeddingPlannerEntities();
     CalArray         = WPE.Calendar.Where(x => x.UserID.Equals(ActualUser.IDLogin)).ToArray();
     ClArray          = WPE.CalendarLogEntrys.ToArray();
     significantDates = WPE.Calendar.Where(x => x.UserID.Equals(ActualUser.IDLogin)).Select(x => x.Date).ToArray();
 }
Exemple #9
0
 internal void ShowDates(DateTime?start, DateTime?end)
 {
     WPE = new Models.WeddingPlannerEntities();
     DataViewItems.Children.Clear();
     if (start == null && end == null)
     {
         foreach (var day in Days.Where(x => x.UserID.Equals(User.IDLogin)).OrderBy(x => x.Date).Reverse().ToList())
         {
             var it = new ViewModel.DateView(day.Date, CalEntrys.Where(x => x.CalID.Equals(day.ID)).Select(x => x.LogEntry.Trim()).Reverse().ToList());
             DataViewItems.Children.Add(new UserControls.UsercontrolDates(it, this, h));
         }
     }
     else if (end == null)
     {
         foreach (var day in Days.Where(x => x.UserID.Equals(User.IDLogin) & x.Date >= start).OrderBy(x => x.Date).Reverse().ToList())
         {
             var it = new ViewModel.DateView(day.Date, CalEntrys.Where(x => x.CalID.Equals(day.ID)).Select(x => x.LogEntry.Trim()).Reverse().ToList());
             DataViewItems.Children.Add(new UserControls.UsercontrolDates(it, this, h));
         }
     }
     else
     {
         foreach (var day in Days.Where(x => x.UserID.Equals(User.IDLogin) & x.Date >= start & x.Date <= end).OrderBy(x => x.Date).Reverse().ToList())
         {
             var it = new ViewModel.DateView(day.Date, CalEntrys.Where(x => x.CalID.Equals(day.ID)).Select(x => x.LogEntry.Trim()).Reverse().ToList());
             DataViewItems.Children.Add(new UserControls.UsercontrolDates(it, this, h));
         }
     }
 }
Exemple #10
0
        void DeletePicture(int id)
        {
            ViewModel.WinMessageBoxItem wmsb = new ViewModel.WinMessageBoxItem((rm as ResourceManager).GetString("Message_Delete_Title"), (rm as ResourceManager).GetString("Message_DeletePics"), PackIconKind.WarningCircle);
            Windows.WinMessageBox       msb  = new Windows.WinMessageBox(wmsb, (rm as ResourceManager), ResourceNames, true);

            if (msb.ShowDialog() == true)
            {
                System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

                if (WPE.WeddingVenueImages.Any(x => x.ID.Equals(id)))
                {
                    WPE.Dispose();
                    WPE = new Models.WeddingPlannerEntities();
                    Models.WeddingVenueImages wvi = WPE.WeddingVenueImages.FirstOrDefault(x => x.ID.Equals(id));
                    WPE.WeddingVenueImages.Attach(wvi);
                    WPE.WeddingVenueImages.Remove(wvi);
                    WPE.SaveChanges();
                    int delindex = p.FindIndex(x => x.ID.Equals(wvi.ID));
                    p.Remove(p.FirstOrDefault(x => x.ID.Equals(wvi.ID)));
                    Bitimages.RemoveAt(delindex);
                    PicsBox.ItemsSource = null;
                    PicsBox.ItemsSource = p;
                }
            }
            System.Windows.Input.Mouse.OverrideCursor = null;
        }
Exemple #11
0
        void ShowComparsion()
        {
            System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            if (CB_FirstOffer.SelectedIndex > -1 & CB_SecondOffer.SelectedIndex > -1)
            {
                BT_ExportToExcel.Visibility = Visibility.Visible;
                int firstID  = VenueIDs[CB_FirstOffer.SelectedIndex];
                int secondID = VenueIDs[CB_SecondOffer.SelectedIndex];
                WPE     = new Models.WeddingPlannerEntities();
                expList = WPE.WeddingExpenses.ToList();
                ComparsionItemsFirst.Children.Clear();
                ComparsionItemsSecond.Children.Clear();
                FirstComp.Clear();
                SecondComp.Clear();

                foreach (var item in expList.Where(x => x.VenueID.Equals(firstID)).OrderBy(x => x.ExpenseName.Trim()).ToList())
                {
                    ViewModel.Comparsion com = new ViewModel.Comparsion(item.ExpenseName.Trim(), f.StringCurrencyFormat(item.Expense.ToString()), f.StringCurrencyFormat(item.Count.ToString()));
                    ComparsionItemsFirst.Children.Add(new UserControls.UserControlComparsion(com));
                    FirstComp.Add(com);
                }
                foreach (var item in expList.Where(x => x.VenueID.Equals(secondID)).OrderBy(x => x.ExpenseName.Trim()).ToList())
                {
                    ViewModel.Comparsion com = new ViewModel.Comparsion(item.ExpenseName.Trim(), f.StringCurrencyFormat(item.Expense.ToString().Trim()), f.StringCurrencyFormat(item.Count.ToString().Trim()));
                    ComparsionItemsSecond.Children.Add(new UserControls.UserControlComparsion(com));
                    SecondComp.Add(com);
                }
                Amount_Reload();
            }
            System.Windows.Input.Mouse.OverrideCursor = null;
        }
Exemple #12
0
 public Guests(Models.Login _User, ResourceManager _rm, string[] _Resourcenames)
 {
     InitializeComponent();
     WPE           = new Models.WeddingPlannerEntities();
     rm            = _rm;
     ResourceNames = _Resourcenames;
     User          = _User;
 }
Exemple #13
0
 public DateView(Models.Login _User, ResourceManager _rm, string[] _Resourcenames, Windows.Home _h)
 {
     InitializeComponent();
     WPE           = new Models.WeddingPlannerEntities();
     rm            = _rm;
     ResourceNames = _Resourcenames;
     User          = _User;
     h             = _h;
 }
Exemple #14
0
 public Comparsion(Models.Login _User, ResourceManager _rm, string[] _Resourcenames)
 {
     InitializeComponent();
     TextColor     = LB_FirstOffer.Foreground;
     WPE           = new Models.WeddingPlannerEntities();
     rm            = _rm;
     User          = _User;
     ResourceNames = _Resourcenames;
 }
Exemple #15
0
 public Expenses(Models.Login _User, ResourceManager _rm, string[] _Resourcenames)
 {
     InitializeComponent();
     TextColor     = LB_Offer.Foreground;
     WPE           = new Models.WeddingPlannerEntities();
     rm            = _rm;
     User          = _User;
     ResourceNames = _Resourcenames;
     Windows.RefreshExpenseList re = CreateExpenseList;
 }
Exemple #16
0
 void Tbl_Qoute_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     WPE = new Models.WeddingPlannerEntities();
     if (WPE.WeddingData.Any(x => x.User_ID.Equals(ActualUser.IDLogin)))
     {
         wedd = WPE.WeddingData.FirstOrDefault(x => x.User_ID.Equals(ActualUser.IDLogin));
         Windows.QuoteModify qu = new Windows.QuoteModify((rm as ResourceManager), wedd, ResourceNames, this);
         qu.Show();
     }
 }
Exemple #17
0
 internal void CreateList()
 {
     WPE       = new Models.WeddingPlannerEntities();
     CalEntrys = WPE.CalendarLogEntrys.ToList();
     Items.Children.Clear();
     foreach (var item in CalEntrys.Where(x => x.CalID.Equals(Cal.ID)).Reverse().ToList())
     {
         var it = new ViewModel.CalLogEntry(item.LogEntry.Trim(), item.ID.ToString());
         Items.Children.Add(new UserControls.UserControlCalItems(it, Cal, (rm as ResourceManager), Resourcenames, this));
     }
     h.RefreshCalendarArray();
 }
Exemple #18
0
        bool FirstStepReady()
        {
            bool FirstStep = WPE.WeddingData.Any(x => x.User_ID.Equals(ActualUser.IDLogin));

            if (FirstStep)
            {
                WPE                      = new Models.WeddingPlannerEntities();
                DayOfWedding             = WPE.WeddingData.FirstOrDefault(x => x.User_ID.Equals(ActualUser.IDLogin)).Wedding_Date;
                LB_RemainingDays.Content = LB_RemainingDays.Content.ToString().Split(':')[0] + ": " + (int)(DayOfWedding - DateTime.Now).TotalDays;
            }
            return(FirstStep);
        }
Exemple #19
0
 public FirstSteps(Models.Login _User, ResourceManager _rm, string[] _ResourceNames, Windows.Home _h)
 {
     InitializeComponent();
     WPE                 = new Models.WeddingPlannerEntities();
     rm                  = _rm;
     ResourceNames       = _ResourceNames;
     User                = _User;
     h                   = _h;
     DefaultImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Betrothed.png", UriKind.Absolute));
     Windows.ChangePicture re = BrowsePictures;
     wedd = WPE.WeddingData.FirstOrDefault(x => x.User_ID.Equals(User.IDLogin));
     //TODO DateTimepicker design
 }
Exemple #20
0
 public CalendarItems(Models.Calendar _Cal, ResourceManager _rm, string[] _Resourcenames, Windows.Home _h)
 {
     InitializeComponent();
     WPE           = new Models.WeddingPlannerEntities();
     Cal           = _Cal;
     Resourcenames = _Resourcenames;
     rm            = _rm;
     h             = _h;
     CalEntrys     = WPE.CalendarLogEntrys.ToList();
     LoadFormats((rm as ResourceManager), Resourcenames);
     CreateList((rm as ResourceManager));
     LB_Date.Content = _Cal.Date.ToString("yyyy-MM-dd");
     Windows.RefreshCalendarList re = CreateList;
 }
Exemple #21
0
 internal void CB_Reload()
 {
     WPE = new Models.WeddingPlannerEntities();
     CB_RadioList.Items.Clear();
     RadioStuffs.Clear();
     if (WPE.Radio.Any(x => (x.UserID.Equals(User.IDLogin) || x.UserID.Equals(0))))
     {
         foreach (var item in WPE.Radio.Where(x => (x.UserID.Equals(User.IDLogin) || x.UserID.Equals(0))))
         {
             CB_RadioList.Items.Add(item.ChannelName.Trim());
             RadioStuffs.Add(item);
         }
     }
 }
Exemple #22
0
        void DeleteVenueAndPictures()
        {
            if (CB_Venue.SelectedIndex > -1)
            {
                int VenID = VenueIDs[CB_Venue.SelectedIndex];
                ViewModel.WinMessageBoxItem wmsb = new ViewModel.WinMessageBoxItem((rm as ResourceManager).GetString("Message_Delete_Title"), (rm as ResourceManager).GetString("Message_DeleteVenue"), PackIconKind.WarningCircle);
                Windows.WinMessageBox       msb  = new Windows.WinMessageBox(wmsb, (rm as ResourceManager), ResourceNames, true);

                if (msb.ShowDialog() == true)
                {
                    if (WPE.WeddingVenue.Any(x => x.ID.Equals(VenID)))
                    {
                        WPE.Dispose();
                        WPE = new Models.WeddingPlannerEntities();
                        var ven = new Models.WeddingVenue {
                            ID = VenID
                        };

                        if (WPE.WeddingExpenses.Any(x => x.VenueID.Equals(ven.ID)))
                        {
                            wmsb = new ViewModel.WinMessageBoxItem((rm as ResourceManager).GetString("Message_Delete_Title"), (rm as ResourceManager).GetString("Message_DeleteExpense"), PackIconKind.WarningCircle);
                            msb  = new Windows.WinMessageBox(wmsb, (rm as ResourceManager), ResourceNames, null);

                            if (msb.ShowDialog() == true)
                            {
                                WPE.WeddingExpenses.RemoveRange(WPE.WeddingExpenses.Where(X => X.VenueID.Equals(ven.ID)));
                                WPE.SaveChanges();
                            }
                            else
                            {
                                return;
                            }
                        }
                        if (WPE.WeddingVenueImages.Any(x => x.WeddingVenueID.Equals(ven.ID)))
                        {
                            WPE.WeddingVenueImages.RemoveRange(WPE.WeddingVenueImages.Where(x => x.WeddingVenueID.Equals(ven.ID)));
                            WPE.SaveChanges();
                        }
                        WPE.WeddingVenue.Attach(ven);
                        WPE.WeddingVenue.Remove(ven);
                        p.Clear();
                        Bitimages.Clear();
                        WPE.SaveChanges();
                        CB_Reload();
                    }
                }
            }
        }
Exemple #23
0
        void LoadFormats(bool hun)
        {
            WPE = new Models.WeddingPlannerEntities();
            System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            if (hun)
            {
                rm = new ResourceManager(typeof(Properties.ResourceHu));
                calendarEdit.Language = XmlLanguage.GetLanguage(CultureInfo.GetCultureInfoByIetfLanguageTag("Hu").IetfLanguageTag);
            }
            else
            {
                rm = new ResourceManager(typeof(Properties.ResourceEng));
                calendarEdit.Language = XmlLanguage.GetLanguage(CultureInfo.GetCultureInfoByIetfLanguageTag("Eng").IetfLanguageTag);
            }
            for (int i = 0; i < ResourceNames.Length; i++)
            {
                var it = this.FindName(ResourceNames[i]);

                if (it is CheckBox)
                {
                    (it as CheckBox).Content = rm.GetString(ResourceNames[i]);
                }
                else if (it is Label)
                {
                    (it as Label).Content = rm.GetString(ResourceNames[i]);
                }
                else if (it is Button)
                {
                    (it as Button).Content = rm.GetString(ResourceNames[i]);
                }
                else if (ResourceNames[i] == "Title_Home")
                {
                    this.Title = rm.GetString(ResourceNames[i]);
                }
                else if (it is TextBlock)
                {
                    (it as TextBlock).Text = rm.GetString(ResourceNames[i]);
                }
                else if (it is PackIcon)
                {
                    (it as PackIcon).ToolTip = (rm as ResourceManager).GetString(ResourceNames[i]);
                }
            }
            LB_TitleHome.Content += " " + ActualUser.User.Trim();
            CreateMenu();
            System.Windows.Input.Mouse.OverrideCursor = null;
        }
Exemple #24
0
 internal void CB_Reload(int index)
 {
     WPE = new Models.WeddingPlannerEntities();
     if (WPE.WeddingVenue.Any(x => x.WeddingID.Equals(Wedding.ID)))
     {
         Venues   = WPE.WeddingVenue.Where(x => x.WeddingID.Equals(Wedding.ID)).ToArray();
         VenueIDs = Venues.Select(x => x.ID).ToArray();
         exitems  = new List <ViewModel.VenueItem>();
         for (int i = 0; i < Venues.Length; i++)
         {
             e = new ViewModel.VenueItem(Venues[i].Wedding_Venue, Venues[i].Venue_Address);
             exitems.Add(e);
         }
         CB_Venue.ItemsSource = exitems;
     }
     p.Clear();
     CB_Venue.SelectedIndex = index;
 }
Exemple #25
0
        internal void CreateContactList()
        {
            WPE      = new Models.WeddingPlannerEntities();
            contList = WPE.Contacts.Where(x => x.User_Id.Equals(User.IDLogin)).OrderBy(x => x.Con_Name).ToList();
            ContactItems.Children.Clear();

            foreach (var item in contList)
            {
                ViewModel.Contact it = new ViewModel.Contact(item.Con_Name.Trim(), item.Con_Phone.Trim(), item.Con_Email.Trim(), item.Con_ID.ToString());
                ContactItems.Children.Add(new UserControls.UsercontrolContacts(it, (rm as ResourceManager), ResourceNames, this));
            }
            if (ContactItems.Children.Count > 0)
            {
                BT_ExportToExcel.Visibility = Visibility.Visible;
            }
            else
            {
                BT_ExportToExcel.Visibility = Visibility.Hidden;
            }
        }
Exemple #26
0
        internal void DeleteCLick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            int id = 0;

            Int32.TryParse((string)(sender as PackIcon).DataContext, out id);

            ViewModel.WinMessageBoxItem wmsb = new ViewModel.WinMessageBoxItem((rm as ResourceManager).GetString("Message_Delete_Title"), (rm as ResourceManager).GetString("Message_Delete"), PackIconKind.WarningCircle);
            Windows.WinMessageBox       msb  = new Windows.WinMessageBox(wmsb, (rm as ResourceManager), Resourcenames, true);

            if (msb.ShowDialog() == true)
            {
                if (WPE.CalendarLogEntrys.Any(x => x.ID.Equals(id)))
                {
                    WPE.Dispose();
                    WPE = new Models.WeddingPlannerEntities();
                    var Logentry = WPE.CalendarLogEntrys.FirstOrDefault(x => x.ID.Equals(id));
                    WPE.CalendarLogEntrys.Attach(Logentry);
                    WPE.CalendarLogEntrys.Remove(Logentry);
                    WPE.SaveChanges();

                    if (!WPE.CalendarLogEntrys.Any(x => x.CalID.Equals(Logentry.CalID)))
                    {
                        var cal = WPE.Calendar.FirstOrDefault(x => x.ID.Equals(Logentry.CalID));
                        WPE.Calendar.Attach(cal);
                        WPE.Calendar.Remove(cal);
                        WPE.SaveChanges();

                        int      Userid = Cal.UserID;
                        DateTime Date   = Cal.Date;
                        Cal        = new Models.Calendar();
                        Cal.ID     = 0;
                        Cal.UserID = Userid;
                        Cal.Date   = Date;
                    }
                    CreateList();
                }
            }
        }
Exemple #27
0
        void IconRadioChannelLeft_MouseDown(object sender, MouseButtonEventArgs e)
        {
            WPE = new Models.WeddingPlannerEntities();
            if (WPE.Radio.Any(x => x.UserID.Equals(ActualUser.IDLogin)))
            {
                rad = WPE.Radio.Any(x => x.ID < rad.ID & x.UserID.Equals(ActualUser.IDLogin)) == true?WPE.Radio.Where(x => x.ID < rad.ID& x.UserID.Equals(ActualUser.IDLogin)).OrderByDescending(x => x.ID).First() : WPE.Radio.Where(x => x.UserID.Equals(ActualUser.IDLogin)).OrderByDescending(x => x.ID).First();

                main.PlayMusicFromURL(rad.StreamLink.Trim(), sound);
                main.RadioVolume = rad.Volume != null ? (int)rad.Volume : 100;

                Tbl_Radio.Text = "♫ " + rad.ChannelName.Trim() + " ♫";

                LeftToRightMarquee();
                if (sound)
                {
                    IconVolumeOnOff.Kind = MaterialDesignThemes.Wpf.PackIconKind.VolumeHigh;
                }
                else
                {
                    RadioAnimationStop();
                    IconVolumeOnOff.Kind = MaterialDesignThemes.Wpf.PackIconKind.VolumeOff;
                }
            }
        }
Exemple #28
0
 void Page_Loaded(object sender, RoutedEventArgs e)
 {
     WPE = new Models.WeddingPlannerEntities();
     LoadFormats((rm as ResourceManager), Resourcenames);
     ReadUserDatas();
 }