public frmTblLookupUI(tblLookup thing) { InitializeComponent(); TheThing = thing; Unpack(TheThing); }
private void Unpack(tblLookup thing) { txtLookupId.Text = thing.LookupId.ToString() + ""; txtLookupType.Text = thing.LookupType + ""; txtLongDesc.Text = thing.LongDesc + ""; txtShortDesc.Text = thing.ShortDesc + ""; txtActive.Text = thing.Active + ""; txtSortOrder.Text = thing.SortOrder.ToString() + ""; txtCoverageType.Text = thing.CoverageType + ""; txtLookupTypeId.Text = thing.LookupTypeId.ToString() + ""; txtLookupTypeId_Sub.Text = thing.LookupTypeId_Sub.ToString() + ""; txtParm.Text = thing.Parm + ""; }
public frmTblLookupUI(tblLookup thing, bool foradd) { InitializeComponent(); TheThing = thing; Unpack(TheThing); if (foradd) { txtLookupType.ReadOnly = true; txtSortOrder.ReadOnly = true; } }
private tblLookup Pack() { tblLookup thing = new tblLookup(TheThing.classDatabaseConnectionString); thing.LookupId = GetAsInteger(txtLookupId.Text); thing.LookupType = txtLookupType.Text + ""; thing.LongDesc = txtLongDesc.Text + ""; thing.ShortDesc = txtShortDesc.Text + ""; thing.Active = txtActive.Text + ""; thing.SortOrder = GetAsInteger(txtSortOrder.Text); thing.CoverageType = txtCoverageType.Text + ""; thing.LookupTypeId = GetAsInteger(txtLookupTypeId.Text); thing.LookupTypeId_Sub = GetAsInteger(txtLookupTypeId_Sub.Text); thing.Parm = txtParm.Text + ""; return(thing); }
private void btnSave_Click(object sender, EventArgs e) { TheThing = Pack(); TheThing.Add(); this.Close(); }