コード例 #1
0
        private void butAddCat_Click(object sender, System.EventArgs e)
        {
            QuickPasteCat     quickCat = new QuickPasteCat();
            FormQuickPasteCat FormQ    = new FormQuickPasteCat(quickCat);

            FormQ.ShowDialog();
            if (FormQ.DialogResult != DialogResult.OK)
            {
                return;
            }
            quickCat = FormQ.QuickCat;
            QuickPasteCats.Insert(quickCat);
            _hasChanges = true;
            //We are doing this so tha when the sync is called in FormQuickPaste_FormClosing(...) we do not re-insert.
            //For now the sync will still detect a change due to the item orders.
            _listCatsOld.Add(quickCat.Copy());
            if (listCat.SelectedIndex != -1)
            {
                _listCats.Insert(listCat.SelectedIndex, quickCat); //insert at selectedindex AND selects new category when we refill grid below.
            }
            else                                                   //Will only happen if they do not have any categories.
            {
                _listCats.Add(quickCat);                           //add to bottom of list, will be selected when we fill grid below.
            }
            FillCats();
            FillMain();
        }
コード例 #2
0
        private void listCat_DoubleClick(object sender, System.EventArgs e)
        {
            if (listCat.SelectedIndex == -1)
            {
                return;
            }
            FormQuickPasteCat FormQ = new FormQuickPasteCat(QuickPasteCats.List[listCat.SelectedIndex]);

            FormQ.ShowDialog();
            if (FormQ.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            QuickPasteCats.Refresh();
            FillCats();
            FillNotes();
            localChanged = true;
        }
コード例 #3
0
        private void listCat_DoubleClick(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit))
            {
                return;
            }
            if (listCat.SelectedIndex == -1)
            {
                return;
            }
            FormQuickPasteCat FormQ = new FormQuickPasteCat(_listCats[listCat.SelectedIndex]);

            FormQ.ShowDialog();
            if (FormQ.DialogResult != DialogResult.OK)
            {
                return;
            }
            _listCats[listCat.SelectedIndex] = FormQ.QuickCat;
            FillCats();
            FillMain();
        }
コード例 #4
0
ファイル: FormQuickPaste.cs プロジェクト: steev90/opendental
        private void listCat_DoubleClick(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit))
            {
                return;
            }
            if (listCat.SelectedIndex == -1)
            {
                return;
            }
            FormQuickPasteCat FormQ = new FormQuickPasteCat(QuickPasteCats.List[listCat.SelectedIndex]);

            FormQ.ShowDialog();
            if (FormQ.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            QuickPasteCats.RefreshCache();
            FillCats();
            FillNotes();
            localChanged = true;
        }
コード例 #5
0
        private void butAddCat_Click(object sender, System.EventArgs e)
        {
            QuickPasteCat quickCat = new QuickPasteCat();

            if (listCat.SelectedIndex == -1)
            {
                quickCat.ItemOrder = listCat.Items.Count;              //one more than list will hold.
            }
            else
            {
                quickCat.ItemOrder = listCat.SelectedIndex;
            }
            QuickPasteCats.Insert(quickCat);
            FormQuickPasteCat FormQ = new FormQuickPasteCat(quickCat);

            FormQ.ShowDialog();
            if (FormQ.DialogResult == DialogResult.OK)
            {
                if (listCat.SelectedIndex != -1)
                {
                    //move other items down in list to make room for new one.
                    for (int i = listCat.SelectedIndex; i < QuickPasteCats.List.Length; i++)
                    {
                        QuickPasteCats.List[i].ItemOrder++;
                        QuickPasteCats.Update(QuickPasteCats.List[i]);
                    }
                }
                localChanged = true;
            }
            else
            {
                QuickPasteCats.Delete(quickCat);
            }
            QuickPasteCats.Refresh();
            FillCats();
            FillNotes();
        }
コード例 #6
0
		private void listCat_DoubleClick(object sender,System.EventArgs e) {
			if(!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit)) {
				return;
			}
			if(listCat.SelectedIndex==-1){
				return;
			}
			FormQuickPasteCat FormQ=new FormQuickPasteCat(QuickPasteCats.List[listCat.SelectedIndex]);
			FormQ.ShowDialog();
			if(FormQ.DialogResult==DialogResult.Cancel){
				return;
			}
			QuickPasteCats.RefreshCache();
			FillCats();
			FillNotes();
			localChanged=true;
		}
コード例 #7
0
		private void butAddCat_Click(object sender, System.EventArgs e) {
			QuickPasteCat quickCat=new QuickPasteCat();
			if(listCat.SelectedIndex==-1){
				quickCat.ItemOrder=listCat.Items.Count;//one more than list will hold.
			}
			else{
				quickCat.ItemOrder=listCat.SelectedIndex;
			}
			QuickPasteCats.Insert(quickCat);
      FormQuickPasteCat FormQ=new FormQuickPasteCat(quickCat);
			FormQ.ShowDialog();
			if(FormQ.DialogResult==DialogResult.OK){
				if(listCat.SelectedIndex!=-1){
					//move other items down in list to make room for new one.
					for(int i=listCat.SelectedIndex;i<QuickPasteCats.List.Length;i++){
						QuickPasteCats.List[i].ItemOrder++;
						QuickPasteCats.Update(QuickPasteCats.List[i]);
					}
				}
				localChanged=true;
			}
			else{
				QuickPasteCats.Delete(quickCat);
			}
			QuickPasteCats.RefreshCache();
			FillCats();
			FillNotes();
		}