Exemplo n.º 1
0
        /// <summary>
        /// Prints the nomor penyerahan berkas.
        /// </summary>
        private void PrintNomorPenyerahanBerkas()
        {
            if (InvokeRequired)
            {
                var o = new DelegateThis(PrintNomorPenyerahanBerkas);
                Invoke(o);
            }
            else
            {
                string session = EnvironmentRepository.GetLocalSession();

                var nomor = new Berkas
                                {
                                    LayananID = "A",
                                    Session = session
                                };

                var db = new BerkasBase();
                int nResult = db.SaveByDml(nomor);

                if (nResult == 1)
                {
                    Berkas rs = db.GetById(session);

                    try
                    {
                        string nocetak =
                            string.Format("{0}-{1}", rs.LayananID,
                                          rs.LayananNomor.ToString().Trim().PadLeft(3, '0'));

                        /* ---------------------------
                         *  get copies configuration
                         * --------------------------- */
                        Layanan layanan = new LayananBase().GetById("A");

                        try
                        {
                            switch (Settings.Default.PrintingLayout)
                            {
                                case 0: // ESC
                                    QWPrinting.PrintWithESC(nocetak, "PENYERAHAN BERKAS", layanan.Copies, this);
                                    break;
                                case 1: // CR
                                    QWPrinting.PrintWithCRLayout(nocetak, "PENYERAHAN BERKAS", layanan.Copies, this);
                                    break;
                            }
                        }
                        catch (NullReferenceException)
                        {
                        }
                    }
                    catch (NullReferenceException)
                    {
                    }
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Ts the base.
 /// </summary>
 private void TBase()
 {
     _dbBerkas = new BerkasBase();
     _dbKasir = new KasirBase();
 }