Exemplo n.º 1
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dtgItems.SelectedItem != null)
                {
                    PartsDetail oPartsDetail = (PartsDetail)dtgItems.SelectedItem;

                    ucAddEditPartsDetail oucAddEditPartsDetail = new ucAddEditPartsDetail(oPartsDetail, true);

                    winDialog oDialog = new winDialog(oucAddEditPartsDetail)
                    {
                        ShowInTaskbar = true,
                        WindowTitle   = "Edit Parts",
                        Height        = 240,
                        Width         = 560
                    };
                    oDialog.ShowDialog();

                    dtgItems.Items.Refresh();
                }
                else
                {
                    MessageBox.Show("Please select a parts");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Can not add parts");
            }
        }
Exemplo n.º 2
0
        private void btnAddPartsDetail_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PartsDetail oPartsDetail = new PartsDetail();

                ucAddEditPartsDetail oucAddEditPartsDetail = new ucAddEditPartsDetail(oPartsDetail, false);

                winDialog oDialog = new winDialog(oucAddEditPartsDetail)
                {
                    ShowInTaskbar = true,
                    WindowTitle   = "Add a new Parts",
                    Height        = 240,
                    Width         = 560
                };
                oDialog.ShowDialog();

                dtgItems.Items.Refresh();
            }
            catch (Exception)
            {
                MessageBox.Show("Can not add parts");
            }
        }
Exemplo n.º 3
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dtgItems.SelectedItem != null)
                {
                    PartsDetail oPartsDetail = (PartsDetail)dtgItems.SelectedItem;

                    ucAddEditPartsDetail oucAddEditPartsDetail = new ucAddEditPartsDetail(oPartsDetail, true);

                    winDialog oDialog = new winDialog(oucAddEditPartsDetail)
                    {
                        ShowInTaskbar = true,
                        WindowTitle = "Edit Parts",
                        Height = 240,
                        Width = 560
                    };
                    oDialog.ShowDialog();

                    dtgItems.Items.Refresh();
                }
                else
                {
                    MessageBox.Show("Please select a parts");
                }

            }
            catch (Exception)
            {

                MessageBox.Show("Can not add parts");
            }
        }
Exemplo n.º 4
0
        private void btnAddPartsDetail_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PartsDetail oPartsDetail = new PartsDetail();

                ucAddEditPartsDetail oucAddEditPartsDetail = new ucAddEditPartsDetail(oPartsDetail,false);

                winDialog oDialog = new winDialog(oucAddEditPartsDetail)
                {
                    ShowInTaskbar = true,
                    WindowTitle = "Add a new Parts",
                    Height = 240,
                    Width = 560
                };
                oDialog.ShowDialog();

                dtgItems.Items.Refresh();

            }
            catch (Exception)
            {

                MessageBox.Show("Can not add parts");
            }
        }