Ejemplo n.º 1
0
        public MemberInfo(DataTable data, Library_Manager.Employee employee)
        {
            InitializeComponent();
            this.employee       = employee;
            txtName.Text        = data.Rows[0][1].ToString();
            txtEmail.Text       = data.Rows[0][2].ToString();
            txtPhoneNumber.Text = data.Rows[0][3].ToString().Substring(2);
            txtPreNumber.Text   = data.Rows[0][3].ToString().Substring(0, 2);
            txtStartDate.Text   = data.Rows[0][5].ToString();
            txtEndDate.Text     = data.Rows[0][6].ToString();
            remainingDates.Text = (DateTime.Parse(txtEndDate.Text) - DateTime.Now).Days.ToString() + " Days";
            if ((DateTime.Parse(txtEndDate.Text) - DateTime.Now).Days <= 0)
            {
                remainingDates.Foreground = new SolidColorBrush(Colors.MediumVioletRed);
            }

            books = new ObservableCollection <Book>();
            DataTable data2 = DataBaseManager.MyBooks(txtName.Text);

            if (data2.Rows.Count != 0)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    books.Add(new Book()
                    {
                        Name = data2.Rows[i][0].ToString(), Author = data2.Rows[i][1].ToString(), Genre = data2.Rows[i][2].ToString(), PrintNumber = data2.Rows[i][3].ToString(), Count = int.Parse(data2.Rows[i][4].ToString())
                    });
                }
            }

            DataContext = this;
        }
 public editEmployee(Library_Manager.Employee emp)
 {
     InitializeComponent();
     txtName.Text         = emp.Name;
     txtEmail.Text        = emp.Email;
     txtPassword.Password = emp.Password;
     txtPhoneNumber.Text  = emp.PhoneNumber;
 }
 private void Addbutton_Click(object sender, RoutedEventArgs e)
 {
     if (ValidateFields())
     {
         Library_Manager.Employee NewEmployee = new Library_Manager.Employee(txtName.Text, txtPhoneNumber.Text, txtEmail.Text, txtPassword.Password, ImageFile);
         if (DataBaseManager.isEmployeeExists(NewEmployee.Name, NewEmployee.Email, NewEmployee.PhoneNumber) &&
             DataBaseManager.isMemberExists(NewEmployee.Name, NewEmployee.Email, NewEmployee.PhoneNumber))
         {
             DataBaseManager.updateEmployee(NewEmployee);
         }
     }
 }
Ejemplo n.º 4
0
        public members(Library_Manager.Employee employee)
        {
            InitializeComponent();
            this.employee = employee;
            users         = new ObservableCollection <User>();
            DataTable data = DataBaseManager.MemberList();

            for (int i = 0; i < data.Rows.Count; i++)
            {
                users.Add(new User()
                {
                    Name = data.Rows[i][1].ToString(), Email = data.Rows[i][2].ToString(), PhoneNumber = data.Rows[i][3].ToString()
                });
            }
            data        = new DataTable();
            DataContext = this;
        }
Ejemplo n.º 5
0
 public wallet(Library_Manager.Employee employee)
 {
     InitializeComponent();
     CurrentEmployee = employee;
     UpdatePrice();
 }