public void indentLoad()
        {
            medicine med = new medicine();

            med.loadStoreIndent();
            dataGridView1.DataSource = med.table;
            dataGridView1.ClearSelection();
            textBox7.Text = dataGridView1.Rows.Count.ToString();
            med.getStoreIndentNo(textBox6.Text);
            textBox8.Text = med.count;
        }
示例#2
0
        public void loadIndent(string indentNo)
        {
            store store = new store();

            store.loadStoreIndentStore(indentNo);
            dataGridView1.DataSource = store.table;
            dataGridView1.ClearSelection();
            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                column.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            medicine med = new medicine();

            med.getStoreIndentNo(label21.Text);
            label24.Text = med.count;
        }
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Graphics g = e.Graphics;

            g.PageUnit = GraphicsUnit.Millimeter;
            Font messageFont = new Font("Times New Roman", 12, System.Drawing.GraphicsUnit.Point);
            int  total;

            if (i == 0)
            {
                g.DrawString("INSTITUTE DISPENSARY", messageFont, Brushes.Black, 75, 5);
                g.DrawString("INDIAN INSTITUTE OF TECHNOLOGY ROORKEE, SAHARANPUR CAMPUS", messageFont, Brushes.Black, 22, 11);
                messageFont = new Font("Times New Roman", 11, System.Drawing.GraphicsUnit.Point);
                g.DrawString("INDENT REQUEST", messageFont, Brushes.Black, 80, 17);
                Pen blackPen = new Pen(Color.Black, 1);
                g.DrawLine(blackPen, 5, 24, 205, 24);
                messageFont = new Font("Times New Roman", 12, System.Drawing.GraphicsUnit.Point);
                medicine med = new medicine();
                med.getStoreIndentNo(textBox6.Text);
                g.DrawString("Indent No.: " + med.count, messageFont, Brushes.Black, 15, 28);
                g.DrawString("Dated: " + DateTime.Today.ToString("dd MMM, yyyy"), messageFont, Brushes.Black, 150, 28);
                total = 26;
            }
            else
            {
                total = 5;
            }
            messageFont = new Font("Times New Roman", 15, System.Drawing.GraphicsUnit.Point);
            g.DrawString("----------------------------------------------------------------------------------------------------------", messageFont, Brushes.Black, 7, total + 7);
            g.DrawString("----------------------------------------------------------------------------------------------------------", messageFont, Brushes.Black, 7, total + 17);
            messageFont = new Font("Times New Roman", 11, System.Drawing.GraphicsUnit.Point);
            g.DrawString("SNo.", messageFont, Brushes.Black, 10, total + 13);
            g.DrawString("Salt Name", messageFont, Brushes.Black, 22, total + 13);
            g.DrawString("Stock", messageFont, Brushes.Black, 152, total + 13);
            g.DrawString("Indent Req.", messageFont, Brushes.Black, 177, total + 13);
            total += 25;
            for (; i < dataGridView1.Rows.Count; i++)
            {
                if (total >= 275)
                {
                    e.HasMorePages = true;
                    return;
                }
                messageFont = new Font("Times New Roman", 10, System.Drawing.GraphicsUnit.Point);
                g.DrawString((i + 1).ToString() + ".", messageFont, Brushes.Black, 10, total);
                g.DrawString(dataGridView1.Rows[i].Cells[1].Value.ToString(), messageFont, Brushes.Black, 22, total);
                g.DrawString(dataGridView1.Rows[i].Cells[2].Value.ToString(), messageFont, Brushes.Black, 156, total);
                g.DrawString(dataGridView1.Rows[i].Cells[3].Value.ToString(), messageFont, Brushes.Black, 180, total);
                messageFont = new Font("Times New Roman", 5, System.Drawing.GraphicsUnit.Point);
                if (i + 1 != dataGridView1.Rows.Count)
                {
                    g.DrawString("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", messageFont, Brushes.Black, 10, total + 4);
                }
                total         += 6;
                e.HasMorePages = false;
            }

            messageFont = new Font("Times New Roman", 15, System.Drawing.GraphicsUnit.Point);
            g.DrawString("----------------------------------------------------------------------------------------------------------", messageFont, Brushes.Black, 7, total);
            messageFont = new Font("Times New Roman", 12, System.Drawing.GraphicsUnit.Point);
            g.DrawString("MEDICAL OFFICER", messageFont, Brushes.Black, 25, total + 25);
            g.DrawString("INDENTOR", messageFont, Brushes.Black, 160, total + 25);
            messageFont = new Font("Times New Roman", 8, System.Drawing.GraphicsUnit.Point);
            g.DrawString("© IMG Labs, IIT Roorkee, SRE", messageFont, Brushes.Black, 87, total + 5);
        }