private void load_data(string CostingNo) { DataSet dsHeader = new costingCRUD().getData(CostingNo); txtCostingNo.Text = CostingNo; cbDIV.SelectedValue = dsHeader.Tables[0].Rows[0]["GDIV"].ToString(); cbTypeID.SelectedValue = dsHeader.Tables[0].Rows[0]["TYPEID"].ToString(); txtQty.Text = dsHeader.Tables[0].Rows[0]["QTYORDER"].ToString(); txtCustomerID.Text = dsHeader.Tables[0].Rows[0]["CUSTVENDCODE"].ToString(); txtStyleID.Text = dsHeader.Tables[0].Rows[0]["ITEMSID"].ToString(); txtCategoryID.Text = dsHeader.Tables[0].Rows[0]["CATEGORYID"].ToString(); txtKurs.Text = dsHeader.Tables[0].Rows[0]["KURS"].ToString(); cbValueIn.Text = dsHeader.Tables[0].Rows[0]["VALUEIN"].ToString(); dateCreated.Value = (DateTime)dsHeader.Tables[0].Rows[0]["DATE"]; txtPPN.Text = dsHeader.Tables[0].Rows[0]["PPN"].ToString(); txtMargin.Text = dsHeader.Tables[0].Rows[0]["MARGIN"].ToString(); txtFOB.Text = dsHeader.Tables[0].Rows[0]["SELLINGPRICE"].ToString(); txtRemarks.Text = dsHeader.Tables[0].Rows[0]["REMARKS"].ToString(); DataSet dsDetail = new costingdetailCRUD().getData(CostingNo); 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(); dtGrid.Rows[i].Cells["hID"].Value = dsDetail.Tables[0].Rows[i]["ID"].ToString(); dtGrid.Rows[i].Cells["hAllowance"].Value = Convert.ToSingle(dsDetail.Tables[0].Rows[i]["ALLOWANCE"]); dtGrid.Rows[i].Cells["hAmount"].Value = Convert.ToSingle(dsDetail.Tables[0].Rows[i]["AMOUNT"]); dtGrid.Rows[i].Cells["hConsumption"].Value = Convert.ToSingle(dsDetail.Tables[0].Rows[i]["CONSUMPTION"]); dtGrid.Rows[i].Cells["hCostType"].Value = dsDetail.Tables[0].Rows[i]["COSTID"].ToString(); dtGrid.Rows[i].Cells["hCurrency"].Value = dsDetail.Tables[0].Rows[i]["CURRENCY"].ToString(); dtGrid.Rows[i].Cells["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString(); dtGrid.Rows[i].Cells["hKurs"].Value = Convert.ToSingle(dsDetail.Tables[0].Rows[i]["KURS"]); dtGrid.Rows[i].Cells["hPrice"].Value = Convert.ToSingle(dsDetail.Tables[0].Rows[i]["PRICE"]); dtGrid.Rows[i].Cells["hUOM"].Value = dsDetail.Tables[0].Rows[i]["UOMID"].ToString(); dtGrid.Rows[i].Cells["hUsage"].Value = dsDetail.Tables[0].Rows[i]["USAG"].ToString(); dtGrid.Rows[i].Cells["hWidth"].Value = dsDetail.Tables[0].Rows[i]["WIDTH"].ToString(); } }