예제 #1
0
        private void btn_invoicewin_click(object sender, RoutedEventArgs e)
        {
            win_invoice w_invoice = new win_invoice();

            w_invoice.Win_type = 1;
            w_invoice.ShowDialog();
        }
        private void btn_newInvoice_Click(object sender, RoutedEventArgs e)
        {
            win_invoice w_i = new win_invoice();

            w_i.Win_type = 1;
            w_i.ShowDialog();
            ShowInvoiceInfo(SearchStatement);
        }
        private void btn_editInvoice_Click(object sender, RoutedEventArgs e)
        {
            object      item = dataGrid_showinvoice.SelectedItem;
            win_invoice w_i  = new win_invoice();

            if (item == null)
            {
                return;
            }
            else
            {
                w_i.Win_type             = 2;//////////edit
                w_i.InvoiceId            = Convert.ToInt32((dataGrid_showinvoice.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text);
                w_i.CustomerName         = (dataGrid_showinvoice.SelectedCells[1].Column.GetCellContent(item) as TextBlock).Text;
                w_i.InvoiceDate          = (dataGrid_showinvoice.SelectedCells[5].Column.GetCellContent(item) as TextBlock).Text;
                w_i.InvoicePrice_foroosh = Convert.ToInt64((dataGrid_showinvoice.SelectedCells[6].Column.GetCellContent(item) as TextBlock).Text);
                w_i.InvoicePrice_kharid  = Convert.ToInt64((dataGrid_showinvoice.SelectedCells[7].Column.GetCellContent(item) as TextBlock).Text);
                w_i.ShowDialog();
            }



            ShowInvoiceInfo(SearchStatement);
        }