private void Fill() { ContractorTypesLogic types = new ContractorTypesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = types.GetAll(); DataGV.Update(); }
private void DeleteSB_Click(object sender, EventArgs e) { ContractorTypesLogic types = new ContractorTypesLogic(manager); types.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); manager.Save(); Fill(); }
private void Fill() { ContractorTypesLogic types = new ContractorTypesLogic(manager); if (mode == "edit") { ContractorType type = types.Get(Convert.ToInt32(id)); if (type != null) { NameTB.Text = type.Name; } } }
private void SaveBt_Click(object sender, EventArgs e) { ContractorTypesLogic types = new ContractorTypesLogic(manager); if (mode == "new") { types.Create(NameTB.Text); } if (mode == "edit") { types.Update(Convert.ToInt32(id), NameTB.Text); } manager.Save(); this.Close(); }
private void Fill() { ContractorsLogic contractors = new ContractorsLogic(manager); DataGV.AutoGenerateColumns = false; List<Contractor> resultA = contractors.GetAll(); List<ContractorView> contractorsView = new List<ContractorView>(); foreach (Contractor a in resultA) { ContractorView c = new ContractorView(a,manager); contractorsView.Add(c); } view = new SortableBindingList<ContractorView>(contractorsView); DataGV.DataSource = view; DataGV.AutoResizeRows(); DataGV.Update(); PersonCB.SelectedIndex = 0; ContractorTypesDDL.Items.Clear(); ContractorTypesLogic types = new ContractorTypesLogic(manager); ContractorTypesDDL.DisplayMember = "Name"; ContractorTypesDDL.ValueMember = "ID"; ContractorType all = new ContractorType(); all.ID = -1; all.Name = " - всі - "; ContractorTypesDDL.Items.Add(all); foreach (var a in types.GetAll()) { ContractorTypesDDL.Items.Add(a); } ContractorTypesDDL.SelectedIndex = 0; }