예제 #1
0
        ///<summary>This can only be called by the user if it is a program link that they created. Included program links cannot be deleted.  If calling this from ClassConversion, must delete any dependent ProgramProperties first.  It will delete ToolButItems for you.</summary>
        public static void Delete(Program Cur)
        {
            ToolButItems.DeleteAllForProgram(Cur.ProgramNum);
            string command = "DELETE from program WHERE programnum = '" + Cur.ProgramNum.ToString() + "'";

            General.NonQ(command);
        }
예제 #2
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            ProgramCur.ProgName    = textProgName.Text;
            ProgramCur.ProgDesc    = textProgDesc.Text;
            ProgramCur.Enabled     = checkEnabled.Checked;
            ProgramCur.Path        = textPath.Text;
            ProgramCur.CommandLine = textCommandLine.Text;
            ProgramCur.Note        = textNote.Text;
            if (IsNew)
            {
                Programs.Insert(ProgramCur);
            }
            else
            {
                Programs.Update(ProgramCur);
            }
            ToolButItems.DeleteAllForProgram(ProgramCur.ProgramNum);
            //then add one toolButItem for each highlighted row in listbox
            ToolButItem ToolButItemCur;

            for (int i = 0; i < listToolBars.SelectedIndices.Count; i++)
            {
                ToolButItemCur            = new ToolButItem();
                ToolButItemCur.ProgramNum = ProgramCur.ProgramNum;
                ToolButItemCur.ButtonText = textButtonText.Text;
                ToolButItemCur.ToolBar    = (ToolBarsAvail)listToolBars.SelectedIndices[i];
                ToolButItems.Insert(ToolButItemCur);
            }
            DialogResult = DialogResult.OK;
        }
예제 #3
0
        private void SaveProgram()
        {
            SaveClinicCurProgramPropertiesToDict();
            _progCur.Enabled     = checkEnabled.Checked;
            _progCur.Path        = textPath.Text;
            _progCur.ButtonImage = POut.Bitmap((Bitmap)pictureBox.Image, System.Drawing.Imaging.ImageFormat.Png);
            ToolButItems.DeleteAllForProgram(_progCur.ProgramNum);
            //Then add one toolButItem for each highlighted row in listbox
            ToolButItem toolButItemCur;

            for (int i = 0; i < listToolBars.SelectedIndices.Count; i++)
            {
                toolButItemCur = new ToolButItem()
                {
                    ProgramNum = _progCur.ProgramNum,
                    ButtonText = textButtonText.Text,
                    ToolBar    = (ToolBarsAvail)listToolBars.SelectedIndices[i]
                };
                ToolButItems.Insert(toolButItemCur);
            }
            if (_pathOverrideOld != textOverride.Text)           //If there was no previous override _pathOverrideOld will be empty string.
            {
                _hasProgramPropertyChanged = true;
                ProgramProperties.InsertOrUpdateLocalOverridePath(_progCur.ProgramNum, textOverride.Text);
            }
            UpdateProgramProperty(_patNumOrChartNum, POut.Bool(radioChart.Checked));           //Will need to be enhanced if another radio button ever gets added.
            UpdateProgramProperty(_infoFilePath, textInfoFile.Text);
            UpsertProgramPropertiesForClinics();
            Programs.Update(_progCur);
        }
예제 #4
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (checkEnabled.Checked && textPluginDllName.Text != "")
            {
                string dllPath = ODFileUtils.CombinePaths(Application.StartupPath, textPluginDllName.Text);
                if (dllPath.Contains("[VersionMajMin]"))
                {
                    Version vers = new Version(Application.ProductVersion);
                    dllPath = dllPath.Replace("[VersionMajMin]", "");                   //now stripped clean
                }
                if (!File.Exists(dllPath))
                {
                    MessageBox.Show(Lan.g(this, "Dll file not found:") + " " + dllPath);
                    return;
                }
            }
            if (textPluginDllName.Text != "" && textPath.Text != "")
            {
                if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "If both a path and a plug-in are specified, the path will be ignored.  Continue anyway?"))
                {
                    return;
                }
            }
            ProgramCur.ProgName = textProgName.Text;
            ProgramCur.ProgDesc = textProgDesc.Text;
            ProgramCur.Enabled  = checkEnabled.Checked;
            ProgramCur.Path     = textPath.Text;
            if (pathOverrideOld != textOverride.Text)
            {
                ProgramProperties.InsertOrUpdateLocalOverridePath(ProgramCur.ProgramNum, textOverride.Text);
                ProgramProperties.RefreshCache();
            }
            ProgramCur.CommandLine   = textCommandLine.Text;
            ProgramCur.PluginDllName = textPluginDllName.Text;
            ProgramCur.Note          = textNote.Text;
            ProgramCur.ButtonImage   = POut.Bitmap((Bitmap)pictureBox.Image, System.Drawing.Imaging.ImageFormat.Png);
            if (IsNew)
            {
                Programs.Insert(ProgramCur);
            }
            else
            {
                Programs.Update(ProgramCur);
            }
            ToolButItems.DeleteAllForProgram(ProgramCur.ProgramNum);
            //then add one toolButItem for each highlighted row in listbox
            ToolButItem ToolButItemCur;

            for (int i = 0; i < listToolBars.SelectedIndices.Count; i++)
            {
                ToolButItemCur            = new ToolButItem();
                ToolButItemCur.ProgramNum = ProgramCur.ProgramNum;
                ToolButItemCur.ButtonText = textButtonText.Text;
                ToolButItemCur.ToolBar    = (ToolBarsAvail)listToolBars.SelectedIndices[i];
                ToolButItems.Insert(ToolButItemCur);
            }
            DialogResult = DialogResult.OK;
        }
예제 #5
0
 private void butOK_Click(object sender, EventArgs e)
 {
     //Program
     _prog.Enabled  = checkEnable.Checked;
     _prog.ProgDesc = textProgDesc.Text;
     _prog.Path     = textPath.Text;
     Programs.Update(_prog);
     //Toolbar button
     ToolButItems.DeleteAllForProgram(_prog.ProgramNum);
     foreach (ToolBarsAvail toolbar in listToolBars.SelectedItems)
     {
         ToolButItem newBut = new ToolButItem();
         newBut.ProgramNum = _prog.ProgramNum;
         newBut.ToolBar    = toolbar;
         newBut.ButtonText = textButText.Text;
         ToolButItems.Insert(newBut);
     }
     //Update settings as necessary
     UpdateBencoSettings();
     MsgBox.Show(this, "You will need to restart Open Dental for these changes to take effect.");
     DialogResult = DialogResult.OK;
 }