public TitleEditForm(int titleId) { InitializeComponent(); _titleBusiness = new TitleBusiness(); this.titleId = titleId; this.Text = "Güncelleme Ekranı"; btnSave.Text = "Güncelle"; _title = _titleBusiness.GetById(titleId); txtTitle.Text = _title.TitleName; }
// GET: Manager public ActionResult Index() { GenderBusiness gb = new GenderBusiness(); TitleBusiness tb = new TitleBusiness(); GenderTitle m = new GenderTitle(); m.Genders = gb.GetAll().ToList(); m.Titles = tb.GetAll().ToList(); return(View(m)); }
private void EmployeeEditForm_Load(object sender, EventArgs e) { TitleBusiness employeeTitle = new TitleBusiness(); List <Title> titleList = employeeTitle.GetAll(); cmbTitle.DataSource = null; cmbTitle.DataSource = titleList; cmbTitle.DisplayMember = "TitleName"; cmbTitle.ValueMember = "ID"; }
private void TitleListForm_Load(object sender, EventArgs e) { _titleBusiness = new TitleBusiness(); List <Title> titleList = _titleBusiness.GetAll(); var list = (from t in titleList select new { ID = t.ID, TitleName = t.TitleName } ).ToList(); dgvTitleList.DataSource = null; dgvTitleList.DataSource = list; }
private void silToolStripMenuItem_Click(object sender, EventArgs e) { _titleBusiness = new TitleBusiness(); object cellValue = dgvTitleList.SelectedRows[0].Cells["ID"].Value; int titleId = (int)cellValue; Title title = _titleBusiness.GetById(titleId); try { DialogResult dr = MessageBox.Show(title.TitleName + " İsimli kaydı silmek istediğinize emin misiniz ?", "Dikkat", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { _titleBusiness.Remove(title); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { _titleBusiness = new TitleBusiness(); _title = new Title(); try { if (titleId < 1) { _title.TitleName = txtTitle.Text; _titleBusiness.Add(_title); } else { _title.ID = titleId; _title.TitleName = txtTitle.Text; _titleBusiness.Update(_title); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Constructeur /// </summary> public TitleService() { _Business = new TitleBusiness(); }