Ejemplo n.º 1
0
 public ChangeComment(DBWork.dbReader reader_)
 {
     InitializeComponent();
     reader  =reader_;
     Conn.SQLDA.SelectCommand.CommandText = "select * from Readers..AbonementMemo where IDReader = " + reader.id;
     DataSet DS = new DataSet();
     int c = Conn.SQLDA.Fill(DS, "tmp");
     if (c == 0) return;
     textBox1.Text = DS.Tables["tmp"].Rows[0]["Comment"].ToString();
 }
Ejemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     //MessageBox.Show();
     if (comboBox1.SelectedIndex == 0)
     {
         MessageBox.Show("�������� ��� ���������� ��� ������� \"������\"", "��������!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     DBWork db = new DBWork();
     db.SetReaderAbonement(this.idr, comboBox1.SelectedValue.ToString());
     MessageBox.Show("��� ���������� ������� ������!", "����������", MessageBoxButtons.OK, MessageBoxIcon.Information);
     abon = comboBox1.Text;
     Form1.FireAbon(this, EventArgs.Empty);
     Close();
 }
Ejemplo n.º 3
0
        public LostBook(string reader,Form1 f1,DataGridView frm)
        {
            this.read = reader;
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            db = new DBWork();
               /* DataSet tmp = db.getBooksForReader(reader);
            if (tmp.Tables["booksonreader"].Rows.Count == 0)
            {
                MessageBox.Show("За читателем не числится книг");
                return;
            }*/

            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.DataSource = frm.DataSource;
                //tmp.Tables["booksonreader"];
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dataGridView1.RowHeadersVisible = false;
            dataGridView1.RowTemplate.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridView1.MultiSelect = false;
            dataGridView1.ReadOnly = true;
            dataGridView1.Columns[0].Width = 250;
            dataGridView1.Columns[0].HeaderText = "Заглавие";
            dataGridView1.Columns[1].Width = 145;
            dataGridView1.Columns[1].HeaderText = "Автор";
            dataGridView1.Columns[2].Visible = false;
            dataGridView1.Columns[3].Visible = false;
            dataGridView1.Columns[4].Visible = false;
            dataGridView1.Columns[5].Visible = false;
            dataGridView1.Columns[6].Visible = false;
            dataGridView1.Columns[7].Visible = false;
            dataGridView1.Columns[8].Visible = false;
            dataGridView1.Columns[9].Visible = false;
            dataGridView1.Columns[10].Visible = false;
            dataGridView1.Columns[11].Visible = false;
            dataGridView1.Columns[12].Visible = false;
            //dataGridView1.Columns[13].Visible = false;

            //dataGridView1.Columns[4].Visible = false;
            //dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count-1);
            dataGridView1.AllowUserToAddRows = false;
        }
 public ReaderRegistrationInMoscow(DBWork.dbReader reader_)
 {
     InitializeComponent();
     reader = reader_;
 }
Ejemplo n.º 5
0
 public bool OldBase(DBWork.dbReader rdr)
 {
     Conn.SQLDA.SelectCommand.CommandText = "select IDOldAbonement from Readers..Main where NumberReader = " + rdr.id;
     DataSet DS = new DataSet();
     Conn.SQLDA.Fill(DS, "iswas");
     bool d = (bool)DS.Tables["iswas"].Rows[0][0];
     if (!d)
     {
         Form10 f10 = new Form10(rdr);
         if (f10.canShow)
         {
             f10.ShowDialog();
             button4_Click(button4, new EventArgs());
         }
         else
         {
             button4_Click(button4, new EventArgs());
         }
         return true;
     }
     else
     {
         return false;
     }
 }
Ejemplo n.º 6
0
        public Form1()
        {
            //System.Collections.Generic.List<int> f = new List<int>(3);

            f2 = new Form2(this);
            InitializeComponent();
            dbw = new DBWork(this);
            dbw.SetPenaltyAll();
            dbw.DeleteExceededOrders();
            //ReaderRecord = new DBWork.dbReader("9643907728022200024 " + "07020077");
            //sc = new _BarcScan(this);
            //this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
            //this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.label16 = new System.Windows.Forms.Label();
            //this.Controls.Add(RndPrg);
            //
            // label16
            //
            this.Controls.Add(this.label16);
            f2.ShowDialog();

            /*if (EmpID == null)
            {
                MessageBox.Show("�� �� ������������! ��������� ��������� ���� ������.", "������!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }*/
            Form1.Scanned += new ScannedEventHandler(Form1_Scanned);
            Form1.AbonChanged += new AbonChangedEventHandler(Form1_AbonChanged);
            //dataGridView1.Rows.RemoveAt(0);// .Remove(dataGridView1.Rows[0].);
            //ReaderRecord = new DBWork.dbReader();
            //BookRecord = new DBWork.dbBook();
            this.button2.Enabled = false;
            this.button4.Enabled = false;
            label4.Text = "������ ������� " + DateTime.Now.ToShortDateString() + ":";
            //this.Controls.Add(this.panel1);
            //this.tabPage3.Controls.Remove(this.panel1);
            //MessageBox.Show(tabControl1.SelectedTab.ToString());// = tabControl1.TabPages[1];
            this.label16.AutoSize = true;
            this.label16.BringToFront();
            this.label16.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.label16.Location = new System.Drawing.Point(328, 458);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(355, 39);
            this.label16.TabIndex = 0;
            this.label16.Text = "�������� ��������";
            this.label16.Visible = false;
            this.label16.ForeColor = Color.Green;
            Formular.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            Formular.Columns.Clear();

            port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
            port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
            port.Handshake = Handshake.RequestToSend;
            port.NewLine = Convert.ToChar(13).ToString();

            try
            {
                port.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }