private bool cboCarTaskUnit_Restore() { cboUnit.DataSource = null; oCarTaskUnit.ClearError(); if (oCarTaskUnit.FillData()) { cboUnit.DataSource = new DataView(oCarTaskUnit.MainTable); cboUnit.ValueMember = oCarTaskUnit.ColumnID; cboUnit.DisplayMember = oCarTaskUnit.ColumnName; cboUnit.Restore(); } return(oCarTaskUnit.ErrorNumber == 0); }
private void frmTripsCostAmountEdit_Load(object sender, EventArgs e) { CarTaskUnit ctUnit = new CarTaskUnit(); if (!ctUnit.FillData()) { Dispose(); return; } dtUnits = ctUnit.MainTable; dgvcCarTskUnitID.DataSource = dtUnits; dgvcCarTskUnitID.DisplayMember = "Name"; dgvcCarTskUnitID.ValueMember = "ID"; dgvcCarTskUnitID.DataPropertyName = "CarTaskUnitID"; // назначение суммировани¤ на колонки foreach (Control ctrl in Controls) { Utilities.ctrl_AgrTypeSet(ctrl); } dgvcTaskInnerCost.AgrType = dgvcTaskOuterCost.AgrType = dgvcTaskAmount.AgrType = dgvcBrutto.AgrType = EnumAgregate.Sum; dgvJobs.IsStatusShow = true; if (dgvJobs.Rows.Count > 0) { dgvJobs.CurrentCell = dgvJobs.Rows[0].Cells[0]; } if (!dgvTrips_Restore()) { Dispose(); return; } }