Exemplo n.º 1
0
        private void mnuPrinter_Click(object sender, EventArgs e)
        {
            FrmPrinter f = new FrmPrinter();

            f.ShowDialog();
            f.Dispose();
        }
Exemplo n.º 2
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            DBConnection conn = null;

            try
            {
                dteBegin.DateTime = dteEnd.DateTime = DateTime.Now;

                string sql = StoredProcedure + "@CMD='GET_MC'";
                conn = new DBConnection(connectionString);
                DBResult result = conn.SelectQuery(sql);
                using (DataTable dt = result.getDataTable())
                {
                    if (dt.Rows.Count > 0)
                    {
                        Meteorite.Controls.ControlsUtils.BindLookUpEdit(lueMC, dt, "MC_NO", "MC_NO", false);
                    }
                }

                mnuOptions.Checked = ReadSavedTestPoints;
                seCopy.EditValue   = NumberOfCopy;

                bool no_printer = true;
                foreach (String printer in PrinterSettings.InstalledPrinters)
                {
                    if (String.Compare(PRINTER, printer, false) == 0)
                    {
                        no_printer = false;
                    }
                }
                if (no_printer)
                {
                    MessageBox.Show("Please select printer.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    FrmPrinter f = new FrmPrinter();
                    f.ShowDialog();
                    f.Dispose();
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.Message);
            }
            finally
            {
                DBHelper.CloseConn(conn);
            }
        }