示例#1
0
        private void Copy2NyFakturaToolStripButton_Click(object sender, EventArgs e)
        {
            bool bVareforbrug = true;
            tblactebisfaktura recActebisfaktura = bsTblactebisfaktura.Current as tblactebisfaktura;

            if (recActebisfaktura.leveringsadresse.ToUpper().Contains("HAFSJOLD"))
            {
                DialogResult result = DotNetPerls.BetterDialog.ShowDialog(
                    "Trans2SummaHDA",                                                              //titleString
                    " JA: Dette er en Hafsjold Data ApS anskaffelse.\nNEJ: Dette et vareforbrug.", //bigString
                    null,                                                                          //smallString
                    "JA",                                                                          //leftButton == OK
                    "NEJ",                                                                         //rightButton == Cancel
                    global::Trans2SummaHDA.Properties.Resources.Message_info);                     //iconSet

                if (result == DialogResult.OK)
                {
                    bVareforbrug = false;
                }
            }
            tblwfak recWfak = new tblwfak
            {
                sk               = "K",
                dato             = recActebisfaktura.ordredato,
                konto            = 200064,
                kreditorbilagsnr = recActebisfaktura.fakturanr
            };

            foreach (tblactebisordre recActebisordre in recActebisfaktura.tblactebisordres)
            {
                tblwfaklin recWfaklin = new tblwfaklin
                {
                    antal      = recActebisordre.antal,
                    enhed      = "stk",
                    pris       = recActebisordre.stkpris,
                    varenr     = recActebisordre.varenr.ToString(),
                    nettobelob = recActebisordre.antal * recActebisordre.stkpris,
                    tekst      = getVaretekst(recActebisfaktura, recActebisordre, bVareforbrug),
                    konto      = getVarenrKonto(recActebisordre.varenr, bVareforbrug),
                    momskode   = KarKontoplan.getMomskode(getVarenrKonto(recActebisordre.varenr, bVareforbrug))
                };
                recWfak.tblwfaklins.Add(recWfaklin);
            }

            FrmMain frmMain = this.ParentForm as FrmMain;

            try
            {
                FrmNyfaktura frmNyfaktura = frmMain.GetChild("Ny faktura") as FrmNyfaktura;
                frmNyfaktura.AddNyActebisFaktura(recWfak);
            }
            catch
            {
                Program.dbDataTransSumma.tblwfaks.InsertOnSubmit(recWfak);
                Program.dbDataTransSumma.SubmitChanges();
            }
        }
示例#2
0
 private void nyFakturaToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (!FocusChild("Ny faktura"))
     {
         FrmNyfaktura m_Nyfaktura = new FrmNyfaktura();
         m_Nyfaktura.MdiParent = this;
         m_Nyfaktura.Show();
     }
 }
示例#3
0
        private void cmdKopier_Click(object sender, EventArgs e)
        {
            FrmMain frmMain = this.ParentForm as FrmMain;

            try
            {
                FrmNyfaktura frmNyfaktura = frmMain.GetChild("Ny faktura") as FrmNyfaktura;
                tblfak       recFak       = this.bsTblfak.Current as tblfak;
                frmNyfaktura.AddNyFaktura(recFak);
            }
            catch { }
        }