Пример #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     foreach (Member member in members)
     {
         member.AttendStatus          = false;
         _context.Entry(member).State = System.Data.Entity.EntityState.Modified;
         _context.SaveChanges();
     }
 }
Пример #2
0
        private void EditBtn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Rule Selected = ((Rule)RulesGrid.SelectedItem);

                RuleName.Text    = Selected.Name.ToString();
                Description.Text = Selected.Description.ToString();
                FirstFin.Text    = Selected.FirstFin.ToString();
                SecondFin.Text   = Selected.SecondFin.ToString();
                FinalFin.Text    = Selected.LastFin.ToString();
                _context.Entry(Selected).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();
            }
            catch (Exception)
            {
            }
        }
Пример #3
0
        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            _context.Entry(Selected).State = System.Data.Entity.EntityState.Deleted;
            _context.SaveChanges();
            SuccessMessage sm = new SuccessMessage();

            sm.MessageText.Text = "Deleted Successfully";
            this.Hide();
            sm.Show();
        }
Пример #4
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (Account.Password == PasswordBox.ToString())
     {
         if (NewPass.ToString() == Confirm.ToString())
         {
             Account.Password = NewPass.Password;
             _context.Entry(Account).State = System.Data.Entity.EntityState.Modified;
             _context.SaveChanges();
             SuccessMessage sm = new SuccessMessage();
             sm.MessageText.Text = "Password Changed";
             sm.Show();
         }
     }
 }
Пример #5
0
        private void EditBtn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MahiberEvent selected = ((MahiberEvent)EventGrid.SelectedItem);
                selected.Name        = EventName.Text.Trim();
                selected.Date        = Convert.ToDateTime(EventDate.Text);
                selected.Time        = Convert.ToDateTime(EventTime.Text);
                selected.Place       = EventPlace.Text.Trim();
                selected.Description = Description.Text.Trim();
                selected.Fin         = Convert.ToDouble(EventFin.Text);

                _context.Entry(selected).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();
            }
            catch (Exception)
            {
            }
        }
Пример #6
0
        private void UpdateBtn_Click(object sender, RoutedEventArgs e)
        {
            member = ((Member)MemGrid.SelectedItem);
            try
            {
                member.FirstName   = MemName.Text.Trim();
                member.LastName    = MemLastName.Text.Trim();
                member.PhoneNumber = Convert.ToInt64(Phone.Text);
                member.Kebele      = Convert.ToInt64(Kebele.Text);
                member.Woreda      = Convert.ToInt64(Woreda.Text);
                if (MarriageStat.IsChecked.GetValueOrDefault())
                {
                    member.SpouseName    = MemSpouseName.Text.Trim();
                    member.MariageStatus = true;
                }
                else
                {
                    member.MariageStatus = false;
                }
                if (GenderBtn.IsChecked.GetValueOrDefault())
                {
                    member.Gender = "male";
                }
                else
                {
                    member.Gender = "female";
                }
                SelectedSubcity = Subcity.SelectedIndex;

                if (SelectedSubcity == 0)
                {
                    member.SubCity = "Arada";
                }
                else if (SelectedSubcity == 1)
                {
                    member.SubCity = "Akaki/Kality";
                }
                else if (SelectedSubcity == 2)
                {
                    member.SubCity = "Bole";
                }
                else if (SelectedSubcity == 3)
                {
                    member.SubCity = "Kolfe Keraniyo";
                }
                else if (SelectedSubcity == 4)
                {
                    member.SubCity = "Yeka";
                }
                else if (SelectedSubcity == 5)
                {
                    member.SubCity = "Gulele";
                }
                else if (SelectedSubcity == 6)
                {
                    member.SubCity = "Ledeta";
                }
                else if (SelectedSubcity == 7)
                {
                    member.SubCity = "Nefas Silk";
                }
                else if (SelectedSubcity == 8)
                {
                    member.SubCity = "Kirkos";
                }
                else if (SelectedSubcity == 9)
                {
                    member.SubCity = "Addis Ketema";
                }
                member.Debit                 = 0;
                member.HouseNummber          = HouseNum.Text.Trim();
                _context.Entry(member).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();
            }
            catch (Exception)
            {
            }
        }