private void Repair_AddEdit_Load(object sender, EventArgs e) { FillFields(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_repair.Id == 0); }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { int idDriver; int.TryParse(cbDriver.SelectedValue.ToString(), out idDriver); _fuelCardDriver.Driver = DriverList.getInstance().getItem(idDriver); _fuelCardDriver.DateBegin = dtpDateBegin.Value; if (chbNotUse.Checked) { if ((!_fuelCardDriver.IsNotUse) && (chbNotUse.Checked)) { FuelCard fuelCard = _fuelCardDriver.FuelCard; FuelCardDriver fuelCardDriver = fuelCard.CreateFuelCardDriver(); fuelCardDriver.Save(); } _fuelCardDriver.DateEnd = dtpDateEnd.Value.Date; } else { _fuelCardDriver.IsNotUse = false; } _fuelCardDriver.Save(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { if (cbMyPoint2.SelectedValue == null) { MessageBox.Show("Выберите пункт назначения", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (tbDistance.Text == string.Empty) { MessageBox.Show("Введите дистанцию", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { MyPointList myPointList = MyPointList.getInstance(); int idMyPoint2; int.TryParse(cbMyPoint2.SelectedValue.ToString(), out idMyPoint2); _route.MyPoint2 = myPointList.getItem(idMyPoint2); int distance; int.TryParse(tbDistance.Text, out distance); _route.Distance = distance; _route.Save(); } DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void License_AddEdit_Load(object sender, EventArgs e) { fillFields(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_license.Id == 0); }
private void btnOK_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { if (!isFill()) { return; } _grade.Name = tbName.Text; _grade.EPower = tbEPower.Text; _grade.EVol = tbEVol.Text; _grade.MaxLoad = tbMaxLoad.Text; _grade.NoLoad = tbNoLoad.Text; int idEngineType; int.TryParse(cbEngineType.SelectedValue.ToString(), out idEngineType); EngineTypeList engineTypeList = EngineTypeList.getInstance(); EngineType engineType = engineTypeList.getItem(idEngineType); _grade.EngineType = engineType; _grade.Save(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void save_Click(object sender, EventArgs e) { if (User.GetRole() == RolesList.AccountantWayBill) { if (btnSave.Text == "Редактировать") { _workWithForm.SetEnableValue(tbSuppyAddress, true); btnSave.Text = "Сохранить"; } else { if (trySave()) { DialogResult = System.Windows.Forms.DialogResult.OK; } } } else { if (_workWithForm.IsEditMode()) { if (trySave()) { DialogResult = System.Windows.Forms.DialogResult.OK; } } else { _workWithForm.SetEditMode(true); } } }
private void aeDTP_Load(object sender, EventArgs e) { loadData(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_dtp.Id == 0); }
private void TempMove_AddEdit_Load(object sender, EventArgs e) { loadData(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_tempMove.Id == 0); }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { _invoice.DriverFromID = cbDriverFrom.SelectedValue.ToString(); _invoice.DriverToID = cbDriverTo.SelectedValue.ToString(); _invoice.RegionFromID = cbRegionFrom.SelectedValue.ToString(); _invoice.RegionToID = cbRegionTo.SelectedValue.ToString(); _invoice.Date = dtpDate.Value; _invoice.DateMove = mtbDateMove.Text; TextBox tbFile = ucFile.Controls["tbFile"] as TextBox; _invoice.File = tbFile.Text; _invoice.Save(); if (_check.Checked) { DriverList driverList = DriverList.getInstance(); Driver driver = driverList.getItem(Convert.ToInt32(cbDriverFrom.SelectedValue.ToString())); driver.IsDriver = false; driver.Save(); } DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void aeModel_Load(object sender, EventArgs e) { fillFields(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_model.Id == 0); }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { if (cbMyPoint.SelectedValue == null) { MessageBox.Show("Выберите адрес подачи", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int idPoint; int.TryParse(cbMyPoint.SelectedValue.ToString(), out idPoint); MyPointList myPointList = MyPointList.getInstance(); MyPoint point = myPointList.getItem(idPoint); _suppyAddress.Point = point; _suppyAddress.Save(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void Route_AddEdit_Load(object sender, EventArgs e) { FillFields(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.EditModeChanged += SetEnable; _workWithForm.SetEditMode(_route.Id == 0); }
private void FuelCardDriver_AddEdit_Load(object sender, EventArgs e) { LoadDictionary(); LoadData(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_fuelCardDriver.Id == 0); }
private void Violation_AddEdit_Load(object sender, EventArgs e) { fillFields(); changeVisible(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_violation.Id == 0); }
private void ShipPart_AddEdit_Load(object sender, EventArgs e) { loadDictionary(); loadData(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_shipPart.Id == 0); }
private void aeGrade_Load(object sender, EventArgs e) { loadTypeEngine(); fillFields(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_grade.Id == 0); }
private void Invoice_AddEdit_Load(object sender, EventArgs e) { loadData(); this.Text = "Перемещение №" + _invoice.Number; _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.EditModeChanged += EditModeChanged; _workWithForm.SetEditMode(_invoice.Id == 0); }
private void aeSsDTP_Load(object sender, EventArgs e) { loadDictionary(); cbMark.SelectedValue = _ssDTP.Id; cbServiceStantion.SelectedValue = _ssDTP.IDServiceStantion; _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_ssDTP.Id == 0); }
private void Driver_AddEdit_Load(object sender, EventArgs e) { loadData(); tbNumber.Visible = lbNumber.Visible = (_driver.OwnerID < 3); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.EditModeChanged += SetEnable; _workWithForm.SetEditMode(_driver.Id == 0); }
private void aeEmployees_Load(object sender, EventArgs e) { loadDictionaries(); loadData(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.EditModeChanged += EnableIfAccountWayBill; _workWithForm.SetEditMode(_employees.Id == 0); }
private void aeSuppyAddress_Load(object sender, EventArgs e) { loadRegions(); loadData(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.EditModeChanged += EnableIfAccountWayBill; _workWithForm.SetEditMode(_suppyAddress.Id == 0); }
private void Point_AddEdit_Load(object sender, EventArgs e) { Regions regions = Regions.getInstance(); lbRegion.Text = string.Concat("Регион: ", regions.getItem(_mypoint.RegionID)); tbName.Text = _mypoint.Name; _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.EditModeChanged += SetEnable; _workWithForm.SetEditMode(_mypoint.Id == 0); }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { TrySave(); this.DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { copyFields(); _passport.Save(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void aeAccount_Load(object sender, EventArgs e) { LoadDictionary(); LoadData(); ChangeEnableBtnAddPolicy(); ChangeEnableComboBoxes(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_account.Id == 0); _workWithForm.SetEnableValue(btnSave, (!_account.Agreed)); }
private void aeUserAccess_Load(object sender, EventArgs e) { loadDictionary(); if (_userAccess.Driver != null) { cbDriver.SelectedValue = _userAccess.Driver.Id; } cbRole.SelectedValue = _userAccess.RoleId; _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_userAccess.Id == 0); }
private void FuelCard_AddEdit_Load(object sender, EventArgs e) { loadDictionaries(); LoadData(); loadDriverList(); EnterTextBox(); LeaveTextBox(); _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose); _workWithForm.SetEditMode(_fuelCard.Id == 0); }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { _userAccess.Driver = DriverList.getInstance().getItem(Convert.ToInt32(cbDriver.SelectedValue)); _userAccess.RoleId = Convert.ToInt32(cbRole.SelectedValue); _userAccess.Save(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { Save(); _fuelCard.AddEmptyDriver(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }
private void btnSave_Click(object sender, EventArgs e) { if (_workWithForm.IsEditMode()) { _dtpFile.Name = tbName.Text; TextBox tbFile = ucFile.Controls["tbFile"] as TextBox; _dtpFile.File = tbFile.Text; _dtpFile.Save(); DialogResult = System.Windows.Forms.DialogResult.OK; } else { _workWithForm.SetEditMode(true); } }