|
|
|
ดึงข้อมูลจาก gridview ของอีก form มาใส่ textbox แล้วข้อมูลมันไม่แสดงค่ะ |
|
|
|
|
|
|
|
Code (C#)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Data.OleDb;
using System.Drawing.Printing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
string strConn = DBDataConn.strConn;
OleDbConnection Con = new OleDbConnection();
OleDbDataAdapter da;
DataSet ds = new DataSet();
OleDbCommand com;
OleDbDataReader dr;
//BindingSource bd;
PrintDialog printDial = new PrintDialog();
PrintDocument printDoc = new PrintDocument();
DateTime date = DateTime.Now;
string lastMaterialOrderID = "";
bool IsFind = false;
//bool IsFindShop = false;
string pShopID = "";
string pMaterialID = "";
string pMaterialName = "";
double pMaterialPrice = 0.0;
string pUnit = "";
string rShopID = "";
string rNameShop = "";
string rContactName = "";
string rAddress = "";
string rTelephone = "";
private void Form2_Load(object sender, EventArgs e)
{
date = DateTime.Now;
lblOrderDate.Text = date.ToShortDateString();
dtpReceiveDate.Value = date.AddDays(7);
dtpPaidDate.Value = date.AddMonths(1);
lsvMaterial.Columns.Add("รหัสวัตถุดิบ", 70, HorizontalAlignment.Left);
lsvMaterial.Columns.Add("ชื่อวัตถุดิบ", 125, HorizontalAlignment.Left);
lsvMaterial.Columns.Add("จำนวนที่สั่งซื้อ", 85, HorizontalAlignment.Right);
lsvMaterial.Columns.Add("ราคา/หน่วย", 75, HorizontalAlignment.Right);
lsvMaterial.Columns.Add("หน่วนนับ", 70, HorizontalAlignment.Right);
lsvMaterial.Columns.Add("รวมเป็นเงิน", 70, HorizontalAlignment.Right);
lsvMaterial.View = View.Details;
lsvMaterial.GridLines = true;
if (Con.State == ConnectionState.Open)
Con.Close();
Con.ConnectionString = strConn;
Con.Open();
lblMaterialPrice.Text = "0.0";
txtOrderNum.Text = "1";
lblNet.Text = "0.00";
txtDiscountRate.Text = "0";
lblDiscount.Text = "0.00";
printDoc.PrintPage += new PrintPageEventHandler(this.printDocument1_PrintPage);
printDoc.DocumentName = "สั่งซื้อวัตถุดิบ";
printDial.Document = printDoc;
}
}
Tag : .NET, C#
|
|
|
|
|
|
Date :
2012-11-28 01:12:27 |
By :
ladyman |
View :
1082 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอ่อทำได้แล้วค่ะ โทษที
|
|
|
|
|
Date :
2012-11-28 05:20:17 |
By :
ladyman |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2012-11-28 09:29:21 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|