public FormCompanyList() { InitializeComponent(); menuStrip1.Items.Remove(tmiprint); menuStrip1.Items.Remove(tmiReview); ReadColumnConfig(dataGridView1, "Set_CompanyList"); if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan)) { cmbTheperson.Enabled = false; } FishBll.Bll.PersonBll bll = new FishBll.Bll.PersonBll(); List <FishEntity.PersonEntity> list1 = bll.id_name(); if (list1 == null) { list1 = new List <FishEntity.PersonEntity>(); } FishEntity.PersonEntity tmep = new FishEntity.PersonEntity(); tmep.username = ""; list1.Insert(0, tmep); cmbTheperson.DataSource = list1; cmbTheperson.DisplayMember = "username"; cmbTheperson.ValueMember = "username"; }
protected void SelectMan(TextBox txt) { FormUserList form = new FormUserList(true); form.StartPosition = FormStartPosition.CenterParent; form.ShowInTaskbar = false; DialogResult result = form.ShowDialog( ); if (result == System.Windows.Forms.DialogResult.OK) { FishEntity.PersonEntity person = form.SelectedPersion; if (person != null) { txt.Text = person.realname; txt.Tag = person.id; } } }