private void btnAdd_Click(object sender, EventArgs e) { Models.Logistics.PlanningLocation location = new Models.Logistics.PlanningLocation(); location.Name = txtLocation.Text; location.ContainerLocation = chbContainers.Checked; Crud.Put(location); RefreshData(); txtLocation.Text = ""; txtLocation.Focus(); }
public AddPlanningRow(FHFormTab caller, Models.Logistics.Planning planning) { InitializeComponent(); _caller = caller; _planning = planning; if (_planning == null) { _planning = new Models.Logistics.Planning(); } if (_caller is PlanningList) { var c = (PlanningList)_caller; _planningLocation = (Models.Logistics.PlanningLocation)c.cmbLocation.SelectedItem; btnSave.Visible = false; } else if (_caller is PlanningDashboard) { var c = (PlanningDashboard)_caller; _planningLocation = c._location; _planning.NoAppointment = true; } if (!_planningLocation.ContainerLocation) { chbConfirmed.Visible = false; gbxContainerInfo.Visible = false; } GetTransporters(); GetSuppliers(); cmbDeliveryMethod.DataSource = GetDeliveryMethods(); cmbDeliveryMethod.ValueMember = "Item1"; cmbDeliveryMethod.DisplayMember = "Item2"; LoadData(); }