private void PopulateFields(string formNo) { foreach (DataRow dr in ClsPEZAData.Get8106formByNo(formNo).Rows) { _customerid = Convert.ToInt16(dr["8106client"]); foreach (DataRow dr1 in ClsCantierDB.GetCustomerAddress(Convert.ToInt32(dr["8106client"])).Rows) { tbCustomerName.Text = dr1["Name"].ToString().Trim(); } if (!dr.IsNull("8106estQty")) { tbEstimatedQuantity.Text = Convert.ToDecimal(dr["8106estQty"]).ToString("#,##0"); } if (!dr.IsNull("8106estAmt")) { tbEstimatedAmount.Text = Convert.ToDecimal(dr["8106estAmt"]).ToString("#,##0.00"); } if (!dr.IsNull("BoatNote")) { tbBoatNote.Text = dr["BoatNote"].ToString().Trim(); } } }
private void PopulateFields(string formNo) { foreach (DataRow dr in ClsPEZAData.Get8106formByNo(formNo).Rows) { tbPEZAFormNumber.Text = dr["8106formNo"].ToString().Trim(); datePEZA.SelectedDate = Convert.ToDateTime(dr["8106date"]); tbPEZAPermitNo.Text = dr["8106controlNo"].ToString().Trim(); PopulateCustomers(); cboCustomer.SelectedValue = dr["8106client"].ToString().Trim(); int id = Convert.ToInt32(dr["8106client"].ToString().Trim()); foreach (DataRow dr1 in ClsCantierDB.GetVendorAddress(id).Rows) { tbCustomerAddress.Text = dr1["Address"].ToString().Trim(); } PopulateLOA(); GroupLOA.IsEnabled = true; cboAuthorizedOfficial1.SelectedValue = dr["8106PEZAauthorizedOfficial1"].ToString().Trim(); cboAuthorizedOfficial2.SelectedValue = dr["8106PEZAauthorizedOfficial2"].ToString().Trim(); cboSKPIAuthorizedSignatory.SelectedValue = dr["8106SKPIauthorizedOfficial"].ToString().Trim(); tb8106ItemNo.Text = dr["8106itemNo"].ToString(); tbORNo.Text = dr["8106PEZApermitOR"].ToString().Trim(); dateDelivered.SelectedDate = Convert.ToDateTime(dr["8106deliveryDate"]); cboCurrency.SelectedValue = dr["8106currency"].ToString().Trim(); cboLOAOwner.SelectedValue = dr["8106LOAowner"].ToString().Trim(); if (!dr.IsNull("8106partCode")) { cbo8106ItemDescription.SelectedValue = dr["8106partCode"].ToString(); } if (!dr.IsNull("8106LOA")) { cboPEZALOANo.SelectedValue = dr["8106LOA"].ToString().Trim(); GetLOADetails(dr["8106LOA"].ToString().Trim()); } if (!dr.IsNull("8106unit")) { cboLOAEstimatedUOM.SelectedValue = dr["8106unit"].ToString().Trim(); } if (!dr.IsNull("8106estQty")) { tbLOAEstimatedQty.Text = string.Format("{0:#,###0.#}", Convert.ToInt32(dr["8106estQty"])); } if (!dr.IsNull("8106estQty")) { tbLOATotalEstimatedAmount.Text = string.Format("{0:#,###0.#}", Convert.ToInt32(dr["8106estAmt"])); } ComputeActualQtyNamt(); } }