Esempio n. 1
0
        private void cmdBetal_Click(object sender, EventArgs e)
        {
            string  TilPBSFilename = "Unknown";
            int     AntalBetalinger;
            int     lobnr;
            int     imax;
            string  keyval;
            string  Navn;
            int     Nr;
            string  Kaldenavn;
            string  Email;
            int     faknr;
            decimal advisbelob;
            string  Bank;

            if ((this.cmdBetal.Text == "Afslut"))
            {
                this.Close();
            }
            this.cmdForslag.Visible = false;
            this.cmdCancel.Visible  = false;
            imax = lvwKrdFaktura.Items.Count;
            this.pgmBetal.Maximum = (imax * 4);
            this.pgmBetal.Minimum = 0;
            this.pgmBetal.Value   = 0;
            this.pgmBetal.Visible = true;
            Program.dbData3060.tempBetalforslags.DeleteAllOnSubmit(Program.dbData3060.tempBetalforslags);
            Program.dbData3060.SubmitChanges();
            if ((imax == 0))
            {
                this.Label_Betaltekst.Text    = "Der ikke noget at betale";
                this.Label_Betaltekst.Visible = true;
            }
            else
            {
                nsPbs3060.tempBetalforslag rec_tempBetalforslag = new nsPbs3060.tempBetalforslag
                {
                    betalingsdato = DateTime.Now,
                };
                Program.dbData3060.tempBetalforslags.InsertOnSubmit(rec_tempBetalforslag);
                var i = 0;
                foreach (ListViewItem lvi in lvwKrdFaktura.Items)
                {
                    this.pgmBetal.Value = ++i;
                    keyval     = lvi.Name;
                    Navn       = lvi.Text;
                    Nr         = int.Parse(lvi.SubItems[1].Text);
                    faknr      = int.Parse(lvi.SubItems[4].Text);
                    advisbelob = decimal.Parse(lvi.SubItems[5].Text);
                    Bank       = lvi.SubItems[6].Text;
                    Kaldenavn  = lvi.SubItems[7].Text;
                    Email      = lvi.SubItems[8].Text;
                    nsPbs3060.tempBetalforslaglinie rec_tempBetalforslaglinie = new nsPbs3060.tempBetalforslaglinie
                    {
                        Nr          = Nr,
                        Navn        = Navn,
                        Kaldenavn   = Kaldenavn,
                        Email       = Email,
                        fakid       = int.Parse(keyval),
                        advisbelob  = (decimal)advisbelob,
                        bankregnr   = Bank.Substring(0, 4),
                        bankkontonr = Bank.Substring(5, 10),
                        faknr       = faknr,
                    };
                    rec_tempBetalforslag.tempBetalforslaglinies.Add(rec_tempBetalforslaglinie);
                }
                Program.dbData3060.SubmitChanges();

                clsOverfoersel   objOverfoersel = new clsOverfoersel();
                Tuple <int, int> t = objOverfoersel.kreditor_fakturer_os1(Program.dbData3060);
                AntalBetalinger     = t.Item1;
                lobnr               = t.Item2;
                this.pgmBetal.Value = imax * 2;
                if ((AntalBetalinger > 0))
                {
                    objOverfoersel.krdfaktura_overfoersel_action(Program.dbData3060, lobnr);
                    this.pgmBetal.Value = (imax * 3);
                    //clsSFTP objSFTP = new clsSFTP(Program.dbData3060);
                    //TilPBSFilename = objSFTP.WriteTilSFtp(Program.dbData3060, lobnr);
                    //objSFTP.DisconnectSFtp();
                    //objSFTP = null;
                    clsBankUdbetalingsUdskrift objBankUdbetalingsUdskrift = new clsBankUdbetalingsUdskrift();
                    objBankUdbetalingsUdskrift.BankUdbetalingsUdskrifter(Program.dbData3060, lobnr);
                    objBankUdbetalingsUdskrift = null;
                    objOverfoersel.overfoersel_mail(Program.dbData3060, lobnr);
                    clsSumma objSumma = new clsSumma();
                    objSumma.BogforUdBetalinger(lobnr);
                }
                this.pgmBetal.Value           = (imax * 4);
                cmdBetal.Text                 = "Afslut";
                this.Label_Betaltekst.Text    = ("Leverance til PBS i filen " + TilPBSFilename);
                this.Label_Betaltekst.Visible = true;
                this.pgmBetal.Visible         = false;
            }
        }
Esempio n. 2
0
        private void testToolStripMenuItem_Click(object sender, EventArgs e)
        {
#if (DEBUG)
            // START TEST TEST TEST TEST TEST TEST
            clsBankUdbetalingsUdskrift objBankUdbetalingsUdskrift = new clsBankUdbetalingsUdskrift();
            objBankUdbetalingsUdskrift.BankUdbetalingsUdskrifter(Program.dbData3060, 894);

            /*
             * var rstPusteruns = from p in Program.dbData3060.vPusterummets select p;
             * int count = rstPusteruns.Count();
             * if (count > 0)
             * {
             *  foreach (var rstPusterun in rstPusteruns)
             *  {
             *      int Nr = (int)rstPusterun.Nr;
             *      string Navn = rstPusterun.Navn;
             *      string Adresse = rstPusterun.Adresse;
             *      string Postnr = rstPusterun.Postnr;
             *  }
             * }
             */
            /*
             * string bigString = "BIGSTRING";
             * string smallString = "smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString smallString";
             * DialogResult result = DotNetPerls.BetterDialog.ShowDialog(
             *  "Betalinger fra PBS", //titleString
             *  bigString, //bigString
             *  smallString, //smallString
             *  null, //leftButton
             *  "OK", //rightButton
             *  global::nsPuls3060.Properties.Resources.Message_info); //iconSet
             */
            /*
             * clsPbs686 objPbs686 = new clsPbs686();
             * int Antal686Filer = objPbs686.aftaleoplysninger_fra_pbs(Program.dbData3060);
             * objPbs686 = null;
             */

            /*
             * // case enumTask.KontingentNyeMedlemmer:
             * clsPbs601 objPbs601c = new clsPbs601();
             * Tuple<int, int> tresultc = objPbs601c.kontingent_fakturer_auto(Program.dbData3060);
             * int AntalKontingent = tresultc.Item1;
             * int lobnrc = tresultc.Item2;
             * if ((AntalKontingent > 0))
             * {
             *  objPbs601c.faktura_og_rykker_601_action(Program.dbData3060, lobnrc, fakType.fdfaktura);
             *  clsSFTP objSFTPc = new clsSFTP(Program.dbData3060);
             *  objSFTPc.WriteTilSFtp(Program.dbData3060, lobnrc);
             *  objSFTPc.DisconnectSFtp();
             *  objSFTPc = null;
             * }
             * objPbs601c = null;
             */

            /*
             * //case enumTask.SendEmailRykker:
             * clsPbs601 objPbs601b = new clsPbs601();
             * Tuple<int, int> tresultb = objPbs601b.rykker_auto(Program.dbData3060);
             * int AntalRykker = tresultb.Item1;
             * int lobnrb = tresultb.Item2;
             * if ((AntalRykker > 0))
             *  objPbs601b.rykker_email(Program.dbData3060, lobnrb);
             * objPbs601b = null;
             */


            // S**T TEST TEST TEST TEST TEST TEST
#endif
        }