private void butDown_Click(object sender, System.EventArgs e) { if (listViews.SelectedIndex == -1) { MessageBox.Show(Lan.g(this, "Please select a category first.")); return; } if (listViews.SelectedIndex == ApptViewC.List.Length - 1) { return; //can't go down any more } int selected = listViews.SelectedIndex; //it will flip flop with the one below it ApptView ApptViewCur = ApptViewC.List[listViews.SelectedIndex]; ApptViewCur.ItemOrder = ApptViewCur.ItemOrder + 1; ApptViews.Update(ApptViewCur); //now the other ApptViewCur = ApptViewC.List[listViews.SelectedIndex + 1]; ApptViewCur.ItemOrder = ApptViewCur.ItemOrder - 1; ApptViews.Update(ApptViewCur); viewChanged = true; FillViewList(); listViews.SelectedIndex = selected + 1; }
private void butOK_Click(object sender, System.EventArgs e) { if (listOps.SelectedIndices.Count == 0 || listProv.SelectedIndices.Count == 0) { MessageBox.Show(Lan.g(this, "At least one operatory and one provider must be selected.")); return; } if (textDescription.Text == "") { MessageBox.Show(Lan.g(this, "A description must be entered.")); return; } if (displayedElements.Count == 0) { MessageBox.Show(Lan.g(this, "At least one row type must be displayed.")); return; } ApptViewItems.DeleteAllForView(ApptViewCur); //start with a clean slate for (int i = 0; i < Operatories.ListShort.Length; i++) { if (listOps.SelectedIndices.Contains(i)) { ApptViewItem ApptViewItemCur = new ApptViewItem(); ApptViewItemCur.ApptViewNum = ApptViewCur.ApptViewNum; ApptViewItemCur.OpNum = Operatories.ListShort[i].OperatoryNum; ApptViewItems.Insert(ApptViewItemCur); } } for (int i = 0; i < Providers.List.Length; i++) { if (listProv.SelectedIndices.Contains(i)) { ApptViewItem ApptViewItemCur = new ApptViewItem(); ApptViewItemCur.ApptViewNum = ApptViewCur.ApptViewNum; ApptViewItemCur.ProvNum = Providers.List[i].ProvNum; ApptViewItems.Insert(ApptViewItemCur); } } for (int i = 0; i < displayedElements.Count; i++) { ApptViewItem ApptViewItemCur = (ApptViewItem)displayedElements[i]; ApptViewItemCur.ApptViewNum = ApptViewCur.ApptViewNum; //elementDesc and elementColor already handled. ApptViewItemCur.ElementOrder = i; ApptViewItems.Insert(ApptViewItemCur); } ApptViewCur.Description = textDescription.Text; ApptViewCur.RowsPerIncr = PIn.PInt(textRowsPerIncr.Text); ApptViews.Update(ApptViewCur); //same whether isnew or not DialogResult = DialogResult.OK; }
private void butDown_Click(object sender, System.EventArgs e) { if (listViews.SelectedIndex == -1) { MessageBox.Show(Lan.g(this, "Please select a category first.")); return; } if (listViews.SelectedIndex == listViews.Items.Count - 1) { return; //can't go down any more } //it will flip flop with the one below it ApptView ApptViewCur = _listApptViews[listViews.SelectedIndex + 1]; ApptViewCur.ItemOrder = listViews.SelectedIndex; ApptViews.Update(ApptViewCur); //now the other ApptViewCur = _listApptViews[listViews.SelectedIndex]; ApptViewCur.ItemOrder = listViews.SelectedIndex + 1; ApptViews.Update(ApptViewCur); viewChanged = true; FillViewList(); listViews.SelectedIndex = _listApptViews.FindIndex(x => x.ApptViewNum == ApptViewCur.ApptViewNum); }