private void RecordTSB_Click(object sender, EventArgs e) { DataSet data = new invoiceCRUD().getData(txtGRNNO.Text, txtPONO.Text, txtOfficer.Text, txtCustomer.Text); DtGrid.DataSource = data; DtGrid.DataMember = "tblinvoice"; }
private void RecordTSB_Click(object sender, EventArgs e) { frminvoiceSearch f = new frminvoiceSearch(); f.AddItemCallback = new frminvoiceSearch.AddPurchaseDelegate(this.SetPurchaseCallBack); f.ShowDialog(); if (GStrCode != "") { DataSet dsHeader = new invoiceCRUD().getData(GStrCode); txtGRNNO.Text = GStrCode; dateCreated.Value = (DateTime)dsHeader.Tables[0].Rows[0]["DATE"]; cbDIV.SelectedValue = dsHeader.Tables[0].Rows[0]["GDIV"]; //RECEIVEFROM di hilangkan txtRemarks.Text = dsHeader.Tables[0].Rows[0]["REMARKS"].ToString(); txtCustomerID.Text = dsHeader.Tables[0].Rows[0]["CUSTVENDCODE"].ToString(); txtRefer.Text = dsHeader.Tables[0].Rows[0]["REFFNO"].ToString(); txtJONO.Text = dsHeader.Tables[0].Rows[0]["PONO"].ToString(); cbJENIS.Text = dsHeader.Tables[0].Rows[0]["JENIS"].ToString(); cbStore.Text = dsHeader.Tables[0].Rows[0]["STOREID"].ToString(); DataSet dsDetail = new invoicedetailCRUD().getData(GStrCode); dtGrid.Rows.Clear(); for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++) { GlobalVariables.GID = GlobalVariables.GID + 1; dtGrid.Rows.Add(); dtGrid.Rows[i].HeaderCell.Value = "V"; //key dtGrid.Rows[i].Cells["hGRNNo1"].Value = dsDetail.Tables[0].Rows[i]["GRNNO"].ToString(); dtGrid.Rows[i].Cells["hID1"].Value = dsDetail.Tables[0].Rows[i]["ID"].ToString(); //end key dtGrid.Rows[i].Cells["hGRNNo"].Value = dsDetail.Tables[0].Rows[i]["GRNNO"].ToString(); dtGrid.Rows[i].Cells["hID"].Value = dsDetail.Tables[0].Rows[i]["ID"].ToString(); dtGrid.Rows[i].Cells["hItemsID"].Value = dsDetail.Tables[0].Rows[i]["ITEMSID"].ToString(); dtGrid.Rows[i].Cells["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString(); dtGrid.Rows[i].Cells["hJenis"].Value = dsDetail.Tables[0].Rows[i]["JENIS"].ToString(); dtGrid.Rows[i].Cells["hColorID"].Value = dsDetail.Tables[0].Rows[i]["COLORID"].ToString(); dtGrid.Rows[i].Cells["hSizeID"].Value = dsDetail.Tables[0].Rows[i]["SIZEID"].ToString(); //if (row[col] == DBNull.Value) dtGrid.Rows[i].Cells["hGrade"].Value = DBNull.Value.Equals(dsDetail.Tables[0].Rows[i]["GRADE"]) ? null : dsDetail.Tables[0].Rows[i]["GRADE"].ToString(); //dtGrid.Rows[i].Cells["hCostingNo"].Value = dsDetail.Tables[0].Rows[i]["COSTINGNO"].ToString(); dtGrid.Rows[i].Cells["hStyleID"].Value = dsDetail.Tables[0].Rows[i]["STYLEID"].ToString(); dtGrid.Rows[i].Cells["hPONO"].Value = dsDetail.Tables[0].Rows[i]["PONO"].ToString(); dtGrid.Rows[i].Cells["hQuantity"].Value = dsDetail.Tables[0].Rows[i]["QUANTITY"].ToString(); dtGrid.Rows[i].Cells["hUOM"].Value = dsDetail.Tables[0].Rows[i]["UOM"].ToString(); // dtGrid.Rows[i].Cells["hPrice"].Value = dsDetail.Tables[0].Rows[i]["PRICE"].ToString(); //dtGrid.Rows[i].Cells["hCurrencyID"].Value = dsDetail.Tables[0].Rows[i]["CURRENCYID"].ToString(); //dtGrid.Rows[i].Cells["hKurs"].Value = dsDetail.Tables[0].Rows[i]["KURS"].ToString(); dtGrid.Rows[i].Cells["hConvert"].Value = dsDetail.Tables[0].Rows[i]["CONVER"].ToString(); //dtGrid.Rows[i].Cells["hRemarks"].Value = dsDetail.Tables[0].Rows[i]["REMARKS"].ToString(); dtGrid.Rows[i].Cells["hQtyPurchase"].Value = dsDetail.Tables[0].Rows[i]["QTYPURCHASE"].ToString(); //dtGrid.Rows[i].Cells["hPricePurchase"].Value = dsDetail.Tables[0].Rows[i]["PRICEPURCHASE"].ToString(); dtGrid.Rows[i].Cells["hUOMPurchase"].Value = dsDetail.Tables[0].Rows[i]["UOMPURCHASE"].ToString(); } SimpanTSB.Enabled = false; UbahTSB.Enabled = true; dtGrid.Enabled = true; } }