Exemplo n.º 1
0
        private void Hyperlink_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            crud_modal.Visibility      = Visibility.Visible;
            pnlPurchaseInvoice         = new cntrl.PanelAdv.pnlPurchaseInvoice();
            pnlPurchaseInvoice._entity = ImpexDB;
            impex impex = (impex)impexViewSource.View.CurrentItem;

            if (sbxContact.ContactID > 0 || impex.id_contact > 0)
            {
                int id_contact = 0;
                if (sbxContact.ContactID > 0)
                {
                    id_contact = sbxContact.ContactID;
                }
                else
                {
                    id_contact = impex.id_contact;
                }
                contact contact = ImpexDB.contacts.Where(x => x.id_contact == id_contact).FirstOrDefault();
                pnlPurchaseInvoice._contact = contact;
                pnlPurchaseInvoice.IsImpex  = true;
            }

            pnlPurchaseInvoice.PurchaseInvoice_Click += PurchaseInvoice_Click;
            crud_modal.Children.Add(pnlPurchaseInvoice);
        }
Exemplo n.º 2
0
        private void btnPurchaseInvoice_Click(object sender, RoutedEventArgs e)
        {
            crud_modal.Visibility      = Visibility.Visible;
            pnlPurchaseInvoice         = new cntrl.PanelAdv.pnlPurchaseInvoice();
            pnlPurchaseInvoice._entity = new ImpexDB();
            //    pnlSalesInvoice.contactViewSource = contactViewSource;
            if (sbxContact.ContactID > 0)
            {
                contact contact = dbContext.contacts.Where(x => x.id_contact == sbxContact.ContactID).FirstOrDefault();
                pnlPurchaseInvoice._contact = contact;
            }

            pnlPurchaseInvoice.PurchaseInvoice_Click += PurchaseInvoice_Click;
            crud_modal.Children.Add(pnlPurchaseInvoice);
        }