private void button1_Click(object sender, EventArgs e) { frmjoborderSearch f = new frmjoborderSearch(); f.AddItemCallback = new frmjoborderSearch.AddCostingDelegate(this.SetCostingCallBack); f.ShowDialog(); if (GStrCode != "") { txtJONO.Text = GStrCode; load_color(GStrCode); load_size(GStrCode); } }
private void button1_Click(object sender, EventArgs e) { frmjoborderSearch f = new frmjoborderSearch(); f.AddItemCallback = new frmjoborderSearch.AddCostingDelegate(this.SetCostingCallBack); f.ShowDialog(); if (GStrCode != "") { DataSet dsHeader = new joborderCRUD().getGarment(GStrCode); cbDIV.SelectedValue = dsHeader.Tables[0].Rows[0]["GDIV"].ToString(); txtCustomerID.Text = dsHeader.Tables[0].Rows[0]["CUSTVENDCODE"].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(); } //isi detail DataSet dsDetail = new joborderdetailCRUD().getData(GStrCode); // var index = dtGrid.Rows.Add(); 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["hID"].Value = i;//dsDetail.Tables[0].Rows[i]["ID"].ToString(); dtGrid.Rows[i].Cells["hItemsID"].Value = Convert.ToString(dsHeader.Tables[0].Rows[0]["ITEMSID"]); dtGrid.Rows[i].Cells["hDescription"].Value = Convert.ToString(dsHeader.Tables[0].Rows[0]["ITEMSID"]); // dtGrid.Rows[i].Cells["hJenis"].Value = dsDetail.Tables[0].Rows[i]["JENIS"].ToString(); dtGrid.Rows[i].Cells["hColorID"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["COLORID"]); dtGrid.Rows[i].Cells["hSizeID"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["SIZEID"]); dtGrid.Rows[i].Cells["hGrade"].Value = "A"; dtGrid.Rows[i].Cells["hStyleID"].Value = Convert.ToString(dsHeader.Tables[0].Rows[0]["ITEMSID"]); dtGrid.Rows[i].Cells["hQuantity"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["QUANTITY"]); dtGrid.Rows[i].Cells["hUOM"].Value = "PCS"; dtGrid.Rows[i].Cells["hConvert"].Value = 1; dtGrid.Rows[i].Cells["hQtyPurchase"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["QUANTITY"]); dtGrid.Rows[i].Cells["hUOMPurchase"].Value = "PCS"; } SimpanTSB.Enabled = true; UbahTSB.Enabled = false; dtGrid.Enabled = true; } }