private void raspoloziveOtpremniceDgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { pridruzeneOtpremnice.Add(raspoloziveOtpremnice[e.RowIndex]); raspoloziveOtpremnice.RemoveAt(e.RowIndex); RefreshDGVs(); UpozorenjeOtpremnice.Hide(); } }
private void btnDodaj_Click(object sender, EventArgs e) { if (raspoloziveOtpremniceDgv.SelectedRows.Count > 0) { int indexOfSelectedRow = raspoloziveOtpremniceDgv.SelectedRows[0].Index; pridruzeneOtpremnice.Add(raspoloziveOtpremnice[indexOfSelectedRow]); raspoloziveOtpremnice.RemoveAt(indexOfSelectedRow); RefreshDGVs(); UpozorenjeOtpremnice.Hide(); } }
private void btnDodajSve_Click(object sender, EventArgs e) { int collectionSize = raspoloziveOtpremnice.Count(); if (collectionSize > 0) { do { collectionSize--; pridruzeneOtpremnice.Add(raspoloziveOtpremnice[collectionSize]); raspoloziveOtpremnice.RemoveAt(collectionSize); } while (collectionSize != 0); RefreshDGVs(); UpozorenjeOtpremnice.Hide(); } }
private void GumbReset_Click(object sender, EventArgs e) { datum_izdavanjaDateTimePicker.Value = DateTime.Now; izdavateljComboBox.SelectedIndex = -1; UpozorenjeIzdavatelj.Hide(); UpozorenjeOtpremnice.Hide(); int collectionSize = pridruzeneOtpremnice.Count(); if (collectionSize > 0) { do { collectionSize--; raspoloziveOtpremnice.Add(pridruzeneOtpremnice[collectionSize]); pridruzeneOtpremnice.RemoveAt(collectionSize); } while (collectionSize != 0); RefreshDGVs(); } }