private void Binding() { DataSet data = new purchaseCRUD().cekBudget(PONO); DtGrid.DataSource = data; DtGrid.DataMember = "tblpurchase"; }
private void RecordTSB_Click(object sender, EventArgs e) { DataSet data = new purchaseCRUD().getData(txtPONO.Text); DtGrid.DataSource = data; DtGrid.DataMember = "tblpurchase"; }
private void cmdPONO_Click(object sender, EventArgs e) { frmPurchaseSearch f = new frmPurchaseSearch(); f.AddItemCallback = new frmPurchaseSearch.AddPurchaseDelegate(this.SetPurchaseCallBack); f.ShowDialog(); //txtCostingNo.Text if (GStrCode != "") { DataSet dsHeader = new purchaseCRUD().getData(GStrCode); txtPONO.Text = GStrCode; cbDIV.SelectedValue = dsHeader.Tables[0].Rows[0]["GDIV"]; dateCreated.Value = (DateTime)dsHeader.Tables[0].Rows[0]["DATE"]; txtRemarks.Text = dsHeader.Tables[0].Rows[0]["REMARKS"].ToString(); txtCustomerID.Text = dsHeader.Tables[0].Rows[0]["CUSTVENDID"].ToString(); DataSet dsSupplier = new mcustvendCRUD().getData(txtCustomerID.Text, "", ""); if (dsSupplier.Tables[0].Rows.Count > 0) { txtCustomerDesc.Text = dsSupplier.Tables[0].Rows[0]["NAME"].ToString(); txtAddress.Text = dsSupplier.Tables[0].Rows[0]["ADDRESS"].ToString(); } txtAddress.Text = dsHeader.Tables[0].Rows[0]["DELIVERYTOADDRESS"].ToString(); //txtRefer.Text = dsHeader.Tables[0].Rows[0]["REFERTO"].ToString(); cbStore.Text = dsHeader.Tables[0].Rows[0]["COURIER"].ToString(); DataSet dsDetail = new purchasedetailCRUD().getDataGrn(GStrCode); cbJENIS.Text = "RAW"; dtGrid.Rows.Clear(); for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++) { dtGrid.Rows.Add(); dtGrid.Rows[i].HeaderCell.Value = "#"; dtGrid.Rows[i].Cells["hStyleID"].Value = dsDetail.Tables[0].Rows[i]["STYLEID"].ToString(); GStrCode = dsDetail.Tables[0].Rows[i]["COSTINGNO"].ToString(); dtGrid.Rows[i].Cells["hItemsID"].Value = dsDetail.Tables[0].Rows[i]["ITEMSID"]; dtGrid.Rows[i].Cells["hPONO"].Value = dsDetail.Tables[0].Rows[i]["PONO"].ToString(); dtGrid.Rows[i].Cells["hID"].Value = dsDetail.Tables[0].Rows[i]["ID"].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["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString(); dtGrid.Rows[i].Cells["hQtyPurchase"].Value = dsDetail.Tables[0].Rows[i]["QTYPURCHASE"].ToString(); dtGrid.Rows[i].Cells["hUOMPurchase"].Value = dsDetail.Tables[0].Rows[i]["UOMPURCHASE"].ToString(); //dtGrid.Rows[i].Cells["hPricePurchase"].Value = dsDetail.Tables[0].Rows[i]["PRICEPURCHASE"].ToString(); dtGrid.Rows[i].Cells["hConvert"].Value = dsDetail.Tables[0].Rows[i]["CONVER"]; //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["hStyleID"].Value = dsDetail.Tables[0].Rows[i]["STYLEID"].ToString(); } SimpanTSB.Enabled = true; UbahTSB.Enabled = false; dtGrid.Enabled = true; } }
private void Print_Click(object sender, EventArgs e) { DataSet data = new purchaseCRUD().prPONO(txtPONO.Text); Application.DoEvents(); data.WriteXml("C:\\MyGarmentReport\\pono.xml", XmlWriteMode.WriteSchema); //data.WriteXmlSchema(Application.StartupPath + "\\costing.xsd"); //data.WriteXmlSchema(Application.StartupPath + "\\costing1.xml"); Form f = new PrintPO(); //f.MdiParent = MainMenu.ActiveForm; f.Show(); }
private void RecordTSB_Click(object sender, EventArgs e) { frmPurchaseSearch f = new frmPurchaseSearch(); f.AddItemCallback = new frmPurchaseSearch.AddPurchaseDelegate(this.SetPurchaseCallBack); f.ShowDialog(); //txtCostingNo.Text if (GStrCode != "") { DataSet dsHeader = new purchaseCRUD().getData(GStrCode); txtPONO.Text = GStrCode; cbDIV.SelectedValue = dsHeader.Tables[0].Rows[0]["GDIV"]; dateCreated.Value = (DateTime)dsHeader.Tables[0].Rows[0]["DATE"]; txtRemarks.Text = dsHeader.Tables[0].Rows[0]["REMARKS"].ToString(); cbCurrency.Text = dsHeader.Tables[0].Rows[0]["CURRENCYID"].ToString(); txtKurs.Text = dsHeader.Tables[0].Rows[0]["KURS"].ToString(); //txtPPN.Text=dsHeader.Tables[0].Rows[0]["PPN"].ToString(); txtCustomerID.Text = dsHeader.Tables[0].Rows[0]["CUSTVENDID"].ToString(); txtDeliveryTo.Text = dsHeader.Tables[0].Rows[0]["DELIVERYTO"].ToString(); // txtAddress.Text = dsHeader.Tables[0].Rows[0]["DELIVERYTOADDRESS"].ToString(); txtRefer.Text = dsHeader.Tables[0].Rows[0]["REFERTO"].ToString(); cbCourier.Text = dsHeader.Tables[0].Rows[0]["SHIPMODA"].ToString(); txtAddresTo.Text = dsHeader.Tables[0].Rows[0]["DELIVERYTOADDRESS"].ToString(); dateDue.Value = (DateTime)dsHeader.Tables[0].Rows[0]["DUEDATE"]; dateETA.Value = (DateTime)dsHeader.Tables[0].Rows[0]["ETA"]; dateETD.Value = (DateTime)dsHeader.Tables[0].Rows[0]["ETD"]; cbTerms.Text = dsHeader.Tables[0].Rows[0]["TERMOFPAYMENT"].ToString(); //txtDiscount.Text = dsHeader.Tables[0].Rows[0]["DISCOUNT"].ToString(); //MessageBox.Show("testttt"); DataSet dsDetail = new purchasedetailCRUD().getData(GStrCode); dtGrid.Rows.Clear(); for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++) { dtGrid.Rows.Add(); dtGrid.Rows[i].HeaderCell.Value = "V"; dtGrid.Rows[i].Cells["hCostingNo"].Value = dsDetail.Tables[0].Rows[i]["COSTINGNO"].ToString(); // cari items costing GStrCode = dsDetail.Tables[0].Rows[i]["COSTINGNO"].ToString(); DataSet dsDetailtemp = new costingdetailCRUD().getData(GStrCode); if (dsDetailtemp.Tables[0].Rows.Count > 0) { DataGridViewComboBoxCell dtgCol = dtGrid.Rows[i].Cells["hCostingID"] as DataGridViewComboBoxCell; dtgCol.DataSource = dsDetailtemp.Tables[0]; dtgCol.DisplayMember = "DESCRIPTION"; dtgCol.ValueMember = "ID"; } dtGrid.Rows[i].Cells["hItemsID"].Value = dsDetail.Tables[0].Rows[i]["ITEMSID"]; dtGrid.Rows[i].Cells["hCostingID"].Value = dsDetail.Tables[0].Rows[i]["COSTINGID"]; dtGrid.Rows[i].Cells["hPONO"].Value = dsDetail.Tables[0].Rows[i]["PONO"].ToString(); dtGrid.Rows[i].Cells["hID"].Value = dsDetail.Tables[0].Rows[i]["ID"].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["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString(); dtGrid.Rows[i].Cells["hQtyPurchase"].Value = dsDetail.Tables[0].Rows[i]["QTYPURCHASE"].ToString(); dtGrid.Rows[i].Cells["hUOMPurchase"].Value = dsDetail.Tables[0].Rows[i]["UOMPURCHASE"].ToString(); dtGrid.Rows[i].Cells["hPricePurchase"].Value = dsDetail.Tables[0].Rows[i]["PRICEPURCHASE"].ToString(); // dtGrid.Rows[i].Cells["hPPN"].Value = dsDetail.Tables[0].Rows[i]["PPN"]; //dtGrid.Rows[i].Cells["hDiscount"].Value = dsDetail.Tables[0].Rows[i]["DISCOUNT"]; dtGrid.Rows[i].Cells["hConvert"].Value = dsDetail.Tables[0].Rows[i]["CONVER"]; dtGrid.Rows[i].Cells["hCurrency"].Value = dsDetail.Tables[0].Rows[i]["CURRENCYID"].ToString(); dtGrid.Rows[i].Cells["hKurs"].Value = dsDetail.Tables[0].Rows[i]["KURS"].ToString(); } SimpanTSB.Enabled = false; UbahTSB.Enabled = true; dtGrid.Enabled = true; } }