Exemplo n.º 1
0
        private void btnDelete_Clicked(object sender, RoutedEventArgs e)
        {
            SuplierBUS bus = new SuplierBUS();

            bus.DeleteSuplier(ID);
            this.Close();
        }
Exemplo n.º 2
0
        private void btnSave_Clicked(object sender, RoutedEventArgs e)
        {
            if (txtName.Text.Count() == 0 || txtEmail.Text.Count() == 0 || txtPhone.Text.Count() == 0 || txtAddress.Text.Count() == 0)
            {
                lblNotice.Content    = "Please fill all information.";
                lblNotice.Visibility = Visibility.Visible;
                return;
            }


            int  temp;
            bool isNumeric = Int32.TryParse(txtPhone.Text, out temp);

            if (!isNumeric)
            {
                lblNotice.Content    = "Phone isn't number!";
                lblNotice.Visibility = Visibility.Visible;
                return;
            }



            SuplierBUS bus    = new SuplierBUS();
            SuplierDTO result = new SuplierDTO();

            result.ID      = ID;
            result.Name    = txtName.Text;
            result.Email   = txtEmail.Text;
            result.Phone   = txtPhone.Text;
            result.Address = txtAddress.Text;
            bus.UpdateSuplier(result);
            this.Close();
        }
Exemplo n.º 3
0
        private void LoadInfo(int id)
        {
            SuplierBUS bus    = new SuplierBUS();
            SuplierDTO result = bus.LoadOneSuplier(id);

            txtID.Content   = result.ID.ToString();
            txtName.Text    = result.Name;
            txtEmail.Text   = result.Email;
            txtPhone.Text   = result.Phone;
            txtAddress.Text = result.Address;
        }
Exemplo n.º 4
0
        private void LoadSupliers()
        {
            SuplierBUS            bus      = new SuplierBUS();
            List <SuplierDisplay> list     = new List <SuplierDisplay>();
            List <SuplierDTO>     supliers = bus.LoadAllSuplier();

            for (int i = 0; i < supliers.Count(); i++)
            {
                list.Add(new SuplierDisplay()
                {
                    id = supliers[i].ID, name = supliers[i].Name, email = supliers[i].Email
                });
            }
            listSuplier.ItemsSource = list;

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(listSuplier.ItemsSource);

            view.Filter = UserFilter;
        }