Exemplo n.º 1
0
        private void dtGVBillManagement_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            IDBill = dtGVBillManagement.CurrentRow.Cells["clIDBill"].Value.ToString();
            DialogResult dialog = MessageBox.Show("Bạn muốn xem đơn hàng chi tiết?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (dialog == DialogResult.OK)
            {
                this.pnBillDetail.Visible = true;
                this.ptBOpacity.Visible   = true;
                DataTable dtBillDetail = ManagementController.OrderManagementDetail(UserName, PassWord, IDBill).Tables[0];
                dtGVBillDetailManagement.Rows.Clear();
                foreach (DataRow dr in dtBillDetail.Rows)
                {
                    string ImageTemp = dr["Image"].ToString();
                    string appPath   = Application.StartupPath.Substring(0, (Application.StartupPath.Length - 10)) + @"\images\imagesProduct\";
                    string FileName  = appPath + ImageTemp;
                    image = Image.FromFile(FileName);
                    image = new Bitmap(image, new Size(70, 70));
                    string ItemName    = dr["ItemName"].ToString();
                    string Description = dr["Description"].ToString();
                    string Quantity    = dr["Quantity"].ToString();
                    string PaidPrice   = dr["PaidPrice"].ToString() + "₫";
                    dtGVBillDetailManagement.Rows.Add(image, ItemName, Description, Quantity, PaidPrice);
                }
            }
        }