private void dgv_hstorg_DoubleClick(object sender, EventArgs e) { int i = dgv_hstorg.CurrentRow.Index; string id = dgv_hstorg.Rows[i].Cells["ID"].Value.ToString(); frm_HstOrgnztnInfo h = new frm_HstOrgnztnInfo(); h.txtclear(); hst_org = DBAccess.get_host_org(int.Parse(id)); if (hst_org != null) { try { h.txtid.Text = hst_org.Host_id.ToString(); h.txtName.Text = hst_org.Host_org_name; h.txtHeadName.Text = hst_org.Head_name; h.txtPosition.Text = hst_org.Title; h.txtAddressNo.Text = hst_org.Address1; h.txtAddressStreet.Text = hst_org.Address2; h.txtAddressCity.Text = hst_org.City; h.txtTelNumber1.Text = hst_org.Tel_number1; h.txtTelNumber2.Text = hst_org.Tel_number2; h.txtFaxNumber.Text = hst_org.Fax_number; h.txtEmail.Text = hst_org.Email; h.txtWebsite.Text = hst_org.Website; h.rtbMandate.Text = hst_org.Mandate; h.cmbProvince.Text = hst_org.Province; h.cmbOrgtypeSub.Text = hst_org.Host_org_type_sub; h.cmbOrgtype.Text = hst_org.Host_org_type; h.cmbRegion.Text = hst_org.Region; h.h_sub = hst_org.Host_org_type_sub; h.txtOrgtypeSub.Text = hst_org.Host_org_type_sub; h.txtOrgtype.Text = hst_org.Host_org_type; h.txtReg.Text = hst_org.Region; h.txtProv.Text = hst_org.Province; h.prov = hst_org.Province; h.btnSave.Visible = false; h.txtid.Enabled = false; h.ShowDialog(); } catch (IndexOutOfRangeException ex) { MessageBox.Show(ex.Message, "Incomplete Data!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Please click refresh!"); } }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { frm_HstOrgnztnInfo h2 = new frm_HstOrgnztnInfo(); h2.txtid.Text = "(Auto Generated)"; h2.txtid.Enabled = false; h2.txtName.Focus(); h2.btnReq.Visible = false; h2.btnUpdate.Visible = false; h2.btnHistory.Visible = false; h2.btnProj.Visible = false; h2.ActiveControl = h2.txtName; h2.txtName.Focus(); h2.ShowDialog(); }