Beispiel #1
0
        /// <summary>
        /// Prints the antrian.
        /// </summary>
        /// <param name="layananid">The layananid.</param>
        private void PrintNomorAntrian(string layananid)
        {
            string session = EnvironmentRepository.GetLocalSession();

            var nomor = new Kasir
                            {
                                LayananID = layananid,
                                Session = session
                            };

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

            if (nResult == 1)
            {
                Kasir 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(layananid);

                    try
                    {
                        switch (Settings.Default.PrintingLayout)
                        {
                            case 0: // ESC
                                QWPrinting.PrintWithESC(nocetak, "KASIR-FOTO-WAWANCARA", layanan.Copies, this);
                                break;
                            case 1: // CR
                                QWPrinting.PrintWithCRLayout(nocetak, "KASIR-FOTO-WAWANCARA", layanan.Copies, this);
                                break;
                        }
                    }
                    catch (NullReferenceException)
                    {
                    }
                }
                catch (NullReferenceException)
                {
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles the MouseUp event of the qwButton2 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void qwButton2_MouseUp(object sender, MouseEventArgs e)
        {
            if (_stillProcessing) return;

            _stillProcessing = true;

            Layanan r = new LayananBase().GetById("C");

            if (r == null) return;

            // lock cek
            if (r.IsLocked)
            {
                var tLocked = new Thread(TLocked);
                tLocked.Start();

                Thread.Sleep(100);

                _stillProcessing = false;

                return;
            }

            var t = new Thread(PrintNomorAntrianKodeC);
            t.Start();
            Thread.Sleep(250);

            _stillProcessing = false;
        }
Beispiel #3
0
        /// <summary>
        /// Handles the Validated event of the txtID control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void txtID_Validated(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtID.Text.Trim())) return;

            Layanan r = new LayananBase().GetById(txtID.Text.Trim());

            try
            {
                txtDescription.Text = r.LayananDescription;
                chkLocked.Checked = r.IsLocked;
                cboCopies.SelectedIndex = r.Copies - 1;
                txtID.Enabled = false;
            }
            catch (NullReferenceException)
            {
                MessageBox.Show(@"ID tidak dikenal !", @"Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ResetData();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Handles the Click event of the btnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                var r = new Layanan
                            {
                                LayananID = txtID.Text.Trim(),
                                LayananDescription = txtDescription.Text.Trim(),
                                IsLocked = chkLocked.Checked,
                                Copies = cboCopies.SelectedIndex + 1
                            };

                // --- Confirm
                if (Confirm("Do you want to save this data?") != DialogResult.Yes) return;

                DialogResult dlg;
                using (var f = new LogonPresentation())
                {
                    dlg = f.ShowDialog(this);
                }

                if (dlg == DialogResult.OK)
                {
                    IDataAccess<Layanan> db = new LayananBase();
                    if (db.Update(r) == 1) ResetData();
                }
            }
            catch (ArgumentNullException ex)
            {
                MessageBox.Show(ex.Message, @"Warning!",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, @"Warning!",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
Beispiel #5
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)
                    {
                    }
                }
            }
        }