Exemple #1
0
 public Form3()
 {
     //this.MaximizeBox = false;
     InitializeComponent();
     this.menuManager      = new SystemMenuManager(this, SystemMenuManager.MenuItemState.Removed);
     conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source = Databasepro.accdb";
 }
        public Form13()
        {
            InitializeComponent();
            this.menuManager      = new SystemMenuManager(this, SystemMenuManager.MenuItemState.Removed);
            conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source = Databasepro.accdb";

            conn.Open();
            try
            {
                OleDbCommand cmd = new OleDbCommand("Select * from Sales_record", conn);

                cmd.CommandType = CommandType.Text;
                OleDbDataAdapter da     = new OleDbDataAdapter(cmd);
                DataTable        scores = new DataTable();
                da.Fill(scores);
                dataGridView1.DataSource = scores;



                // cmd.ExecuteNonQuery();
                // MessageBox.Show("Data Showed");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occur: " + ex);
            }
            conn.Close();
        }
Exemple #3
0
        public Form14()
        {
            conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source = Databasepro.accdb";
            InitializeComponent();
            this.menuManager = new SystemMenuManager(this, SystemMenuManager.MenuItemState.Removed);
            string text1 = ControlID.TextData;

            conn.Open();
            try
            {
                OleDbDataReader dr  = null;
                OleDbCommand    cmd = new OleDbCommand("Select * from Sales_record where Sales_ID=" + text1, conn);
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    label8.Text     = (text1);
                    label14.Text    = (dr["Order_ID"].ToString());
                    cid.Text        = (dr["Client_ID"].ToString());
                    pcode.Text      = (dr["Product_ID"].ToString());
                    odate.Text      = (dr["Order_date"].ToString());
                    ddate.Text      = (dr["Delivery_date"].ToString());
                    pcs.Text        = (dr["Quantity"].ToString());
                    totalprice.Text = (dr["Selling_price"].ToString());
                    pcolor.Text     = (dr["Color"].ToString());
                    psize.Text      = (dr["Size"].ToString());
                    // price.Text = (dr["Single_price"].ToString());
                    pname.Text = (dr["Pname"].ToString());
                    cname.Text = (dr["Cname"].ToString());
                    pcost.Text = (dr["Profit"].ToString());

                    OleDbCommand cmd1 = new OleDbCommand("Select * from Product where Product_ID=" + pcode.Text, conn);
                    dr = cmd1.ExecuteReader();
                    while (dr.Read())
                    {
                        if (dr["Photo"] != System.DBNull.Value)
                        {
                            photo_aray = (byte[])dr["Photo"];
                            MemoryStream ms = new MemoryStream(photo_aray);
                            pictureBox1.Image = Image.FromStream(ms);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occur: " + ex);
            }
            conn.Close();
        }
        public Form5()
        {
            conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source = Databasepro.accdb";
            InitializeComponent();
            this.menuManager = new SystemMenuManager(this, SystemMenuManager.MenuItemState.Removed);
            string text = ControlID.TextData;

            conn.Open();
            try
            {
                OleDbDataReader dr  = null;
                OleDbCommand    cmd = new OleDbCommand("Select * from Product where Product_ID=" + text, conn);
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    label8.Text   = text;
                    textBox2.Text = (dr["P_Name"].ToString());
                    textBox3.Text = (dr["Size"].ToString());
                    textBox4.Text = (dr["Color"].ToString());
                    textBox5.Text = (dr["Weight"].ToString());
                    textBox6.Text = (dr["Cost"].ToString());
                    textBox7.Text = (dr["Type"].ToString());


                    if (dr["Photo"] != System.DBNull.Value)
                    {
                        photo_aray = (byte[])dr["Photo"];
                        MemoryStream ms = new MemoryStream(photo_aray);
                        pictureBox1.Image = Image.FromStream(ms);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occur: " + ex);
            }
            conn.Close();
        }
Exemple #5
0
 public Form4()
 {
     InitializeComponent();
     this.menuManager = new SystemMenuManager(this, SystemMenuManager.MenuItemState.Removed);
 }