public string getAgentName(int id) { AgentEntity entity = new AgentEntity(); string cond = AgentEntity.FIELD_ID + "=" + provider.getSQLString(id); provider.loadToDataSet(entity, cond); return(entity.get(AgentEntity.FIELD_Agent_NAME).ToString()); }
private void init() { if (_id > 0) { AgentEntity entity = null; entity = _AgentBL.get(_id); txtAgentName.Text = entity.get(AgentEntity.FIELD_Agent_NAME).ToString(); txtAgentCode.Text = entity.get(AgentEntity.FIELD_AGENTCODE).ToString(); txtTelephone.Text = entity.get(AgentEntity.FIELD_TELEPHONE).ToString(); txtMobile.Text = entity.get(AgentEntity.FIELD_MOBILE).ToString(); txtFax.Text = entity.get(AgentEntity.FIELD_FAX).ToString(); txtAddress.Text = entity.get(AgentEntity.FIELD_ADDRESS).ToString(); if (entity.get(AgentEntity.FIELD_ACTIVE) != null && entity.get(AgentEntity.FIELD_ACTIVE).ToString().Length > 0 && ((bool)entity.get(AgentEntity.FIELD_ACTIVE)) == false) { cmbActive.SelectedIndex = 1; } else { cmbActive.SelectedIndex = 0; } } else { if (_id == 0) { _readOnly = true; } cmbActive.SelectedIndex = 0; } if (_readOnly) { txtAgentName.Enabled = false; txtAgentCode.Enabled = false; txtTelephone.Enabled = false; txtMobile.Enabled = false; txtFax.Enabled = false; txtAddress.Enabled = false; cmbActive.Enabled = false; } }