public void TopCreateOneShortcut(bool bJpegAlreadyExists)
        {
            string sUrl = InputBoxForm.GetStrInput("Enter URL:", "http://example");

            if (!BookmarkBucketCore.looksLikeAUrl(sUrl))
            {
                return;
            }

            if (bJpegAlreadyExists)
            {
                string sInputJpeg = ImageHelper.GetOpenString("jpeg", "Select a jpeg:");
                if (sInputJpeg == null || !File.Exists(sInputJpeg))
                {
                    return;
                }
                BookmarkBucketCore.StripAllExifData(sInputJpeg);
                BookmarkBucketCore.SetExifData(sInputJpeg, sUrl, Path.GetFileNameWithoutExtension(sInputJpeg));
            }
            else
            {
                string sOutJpeg = ImageHelper.GetSaveString("jpeg", "Save jpeg to:");
                if (sOutJpeg == null)
                {
                    return;
                }
                string             sDir = Path.GetDirectoryName(sOutJpeg);
                BookmarkBucketItem item = new BookmarkBucketItem {
                    sFile = Path.GetFileNameWithoutExtension(sOutJpeg), sUrl = sUrl
                };
                ModelItemToJpeg(item, sDir);
            }
        }
Ejemplo n.º 2
0
    static void CheckWarnDialogue(ref bool skipWarnings, ref bool overwrite, int index, int fileCount, ArchiveFile matchFile)
    {
        if (!skipWarnings)
        {
            Language     Language     = new Language();
            InputBoxForm warnDialogue = new InputBoxForm();
            warnDialogue.YesNoSetup(Language.GetLanguageText("Overwrite file?") + $" ({index} of {fileCount})", "");

            warnDialogue.richTextBox1.AppendText(matchFile.path, Color.Cyan, true);
            var actMods = matchFile.FindActualCrcMod();
            if (actMods.Count() > 0)
            {
                warnDialogue.richTextBox1.AppendText(Language.GetLanguageText("The file is from:"), Color.WhiteSmoke, true);
                foreach (var rMod in actMods)
                {
                    warnDialogue.richTextBox1.AppendText(rMod.shortPath, Color.Orange, true);
                }
            }
            else
            {
                warnDialogue.richTextBox1.AppendText(Language.GetLanguageText("It is unknown what mod this file belongs to."), Color.Coral, true);
            }

            warnDialogue.richTextBox1.SelectAll();
            warnDialogue.richTextBox1.SelectionAlignment = HorizontalAlignment.Center;


            var result = warnDialogue.ShowDialog();

            skipWarnings = result == DialogResult.OK || result == DialogResult.Ignore ? true : false;
            overwrite    = result == DialogResult.Yes || result == DialogResult.OK ? true : false;
        }
    }
Ejemplo n.º 3
0
 private static DialogResult ShowCore(IWin32Window owner, string text, string defaultValue, string caption, out string result)
 {
     InputBoxForm box = new InputBoxForm(text, defaultValue, caption);
     DialogResult retval = box.ShowDialog(owner);
     result = box.Value;
     return retval;
 }
Ejemplo n.º 4
0
        private void folderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //MyGlobal.createNewDirectory(server.serverPort.Stream,)
            InputBoxForm di = new InputBoxForm();

            di.Response = "New Folder";
            di.initiateText("Enter the name of folder", "Add New Folder");
            if (di.ShowDialog(this) == DialogResult.OK)
            {
                string des = "";
                if (addressBox.Text.EndsWith("\\"))
                {
                    des = addressBox.Text + di.Response;
                }
                else
                {
                    des = $"{addressBox.Text}\\{di.Response}";
                }

                MyGlobal.createNewDirectory(server.serverPort.Stream, des);

                refreshContent();
            }
            di.Dispose();
        }
        private void getBoundsManually()
        {
            double X0, X1, Y0, Y1, nX0, nX1, nY0, nY1;

            plotCntrl.getBounds(out X0, out X1, out Y0, out Y1);

            if (!InputBoxForm.GetDouble("Leftmost x", X0, out nX0))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Rightmost x", X1, out nX1))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Lowest y", Y0, out nY0))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Greatest y", Y1, out nY1))
            {
                return;
            }

            if (!(nY1 > nY0 && nX1 > nX0))
            {
                MessageBox.Show("Invalid bounds."); return;
            }

            this.plotCntrl.setBounds(nX0, nX1, nY0, nY1);
            this.plotCntrl.redraw();
        }
Ejemplo n.º 6
0
 public static DialogResult Open(string ask, string caption, string defaultAnswer)
 {
     var form = new InputBoxForm();
     form.answerTextBox.Text = defaultAnswer;
     form.askLabel.Text = ask;
     form.Text = caption;
     return form.ShowDialog();
 }
Ejemplo n.º 7
0
    private static DialogResult ShowCore(IWin32Window owner, string text, string defaultValue, string caption, out string result)
    {
        InputBoxForm box    = new InputBoxForm(text, defaultValue, caption);
        DialogResult retval = box.ShowDialog(owner);

        result = box.Value;
        return(retval);
    }
Ejemplo n.º 8
0
 /// <summary>
 /// Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box.
 /// </summary>
 /// <param name="Prompt">String expression displayed as the message in the dialog box. The maximum length of Prompt is approximately 1024 characters, depending on the width of the characters used. If Prompt consists of more than one line, you can separate the lines using a carriage return character (\r), a linefeed character (\n), or a carriage return–linefeed character combination (\r\n) between each line.</param>
 /// <param name="Title">String expression displayed in the title bar of the dialog box.</param>
 /// <param name="DefaultResponse">String expression displayed in the text box as the default response if no other input is provided.</param>
 /// <param name="xPos">Numeric expression that specifies the left edge of the dialog box. If xPos is -1, the dialog box is centered horizontally.</param>
 /// <param name="yPos">Numeric expression that specifies the top edge of the dialog box. If yPos is -1, the dialog box is centered vertically.</param>
 /// <returns>A string containing the user's response.</returns>
 public static string Show(string Prompt, string Title, string DefaultResponse, int xPos, int yPos)
 {
     using (InputBoxForm ipb = new InputBoxForm())
     {
         ipb.ShowDialog(Prompt, Title, DefaultResponse, xPos, yPos);
         return(ipb.Response);
     }
 }
Ejemplo n.º 9
0
        private void ConvertOldToNewWithoutRedownloading()
        {
            string sDir = InputBoxForm.GetStrInput("All from this directory:", "c:\\example");

            if (sDir == null || !Directory.Exists(sDir))
            {
                MessageBox.Show("Not a valid directory."); return;
            }

            DirectoryInfo di = new DirectoryInfo(sDir);

            FileInfo[] rgFiles = di.GetFiles("*.jpg");
            foreach (FileInfo fi in rgFiles)
            {
                string sNewname = Path.GetFileNameWithoutExtension(fi.Name.Replace("555 ", "")) + ".png";
                if (File.Exists(sDir + "\\" + sNewname))
                {
                    throw new BookmarkBucketException("exists png" + fi.Name);
                }
                File.Move(sDir + "\\" + fi.Name, sDir + "\\" + sNewname);
            }

            // set the exifs...
            FileInfo[] rgFilesPng = di.GetFiles("*.png");
            foreach (FileInfo fi in rgFilesPng)
            {
                string sOldUrl = BookmarkBucketCore.GetExifData(fi.FullName, "Comment");
                if (!BookmarkBucketCore.looksLikeAUrl(sOldUrl))
                {
                    throw new BookmarkBucketException("couldnot read url" + fi.Name);
                }

                // convert it to a jpg.
                string sJpeg = sDir + "\\" + Path.GetFileNameWithoutExtension(fi.Name) + ".jpeg";
                using (Bitmap b = new Bitmap(fi.FullName))
                {
                    ImageHelper.BitmapSaveJpegQuality(b, sJpeg, 85);
                }
                if (!File.Exists(sJpeg))
                {
                    throw new BookmarkBucketException("no jpeg created?");
                }
                File.Delete(fi.FullName);

                BookmarkBucketCore.StripAllExifData(sJpeg);
                BookmarkBucketCore.SetExifData(sJpeg, sOldUrl, Path.GetFileNameWithoutExtension(fi.Name));

                // download the htm!
                string sHtmlName = sDir + "\\" + Path.GetFileNameWithoutExtension(fi.Name) + ".html";
                if (File.Exists(sHtmlName))
                {
                    throw new BookmarkBucketException("exists html" + fi.Name);
                }
                BookmarkBucketImplementation.DownloadFile(sOldUrl, sHtmlName);
                File.AppendAllText(sHtmlName, strHtmlStamp + sOldUrl + "-->"); // will create file.
            }
        }
Ejemplo n.º 10
0
            public static string Show(string title = "", string caption = "", string tbtext = "")
            {
                InputBoxForm f = new InputBoxForm(title, caption, tbtext);

                if (f.ShowDialog() == DialogResult.OK)
                {
                    return(InputBoxForm.output);
                }
                return(string.Empty);
            }
Ejemplo n.º 11
0
    public void Go()
    {
        installerdirectory = Application.StartupPath;
        //Console.WriteLine( Application.StartupPath );

        //CheckFramework(); // Hmmm, setup wont run without framework, no need to check :-D

        string SpringInstallDirectory = GetSpringInstallDirectory();

        InputBoxForm frmInputBox = new InputBoxForm();

        frmInputBox.Title           = "Locate Spring Application directory";
        frmInputBox.Prompt          = "Please confirm the Spring Application directory:";
        frmInputBox.DefaultResponse = SpringInstallDirectory;
        //if (XPos >= 0 && YPos >= 0)
        //{
        //  frmInputBox.StartLocation = new Point(XPos, YPos);
        //}
        frmInputBox.ShowDialog();
        SpringInstallDirectory = frmInputBox.ReturnValue;

        if (SpringInstallDirectory == "")
        {
            MessageBox.Show("No directory specified.  Aborting setup.exe.");
            return;
        }

        if (!Directory.Exists(SpringInstallDirectory))
        {
            MessageBox.Show("Directory " + SpringInstallDirectory + " does not exist.  Please run setup again.");
            return;
        }

        string springexefilepath = Path.Combine(SpringInstallDirectory, "Spring.exe");

        if (!File.Exists(springexefilepath))
        {
            MessageBox.Show("Spring.exe not found in " + SpringInstallDirectory + ".  Please rerun setup.");
            return;
        }

        FileInfo springfile = new FileInfo(springexefilepath);

        if (springfile.Length != 3502080)
        {
            MessageBox.Show("Spring.exe appears to be a different version than what we are looking for.  Please reinstall the latest version of Spring, and try again.");
            return;
        }

        Console.WriteLine(SpringInstallDirectory);

        InstallFiles(SpringInstallDirectory);

        MessageBox.Show("Installation completed successfully.  Please add bot \"csailoader.dll\" to your games to use CSAI");
    }
Ejemplo n.º 12
0
 public static string GetStrInput(string strPrompt, string strCurrent)
 {
     InputBoxForm myForm = new InputBoxForm();
     myForm.label1.Text = strPrompt;
     myForm.txtMessage.Text = strCurrent;
     myForm.ShowDialog(new Form());
     if (myForm.DialogResult == DialogResult.OK)
         return (myForm.Message);
     else
         return null;
 }
Ejemplo n.º 13
0
        static public string Show(string Prompt, string Title, string Default, bool UseSystemPasswordChar)
        {
            InputBoxForm frmInputDialog = new InputBoxForm();

            frmInputDialog.FormCaption           = Title;
            frmInputDialog.FormPrompt            = Prompt;
            frmInputDialog.Value                 = Default;
            frmInputDialog.UseSystemPasswordChar = UseSystemPasswordChar;

            return(frmInputDialog.ShowDialog() == DialogResult.OK ? frmInputDialog.Value : null);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Displays an input box with the specified text, caption and default value
        /// </summary>
        /// <param name="text">The text to display in the input box</param>
        /// <param name="caption">The text to display in the title bar of the input box</param>
        /// <param name="defaultValue">The default value</param>
        /// <param name="useSystemPasswordChar">True if user input should be masked with a password character</param>
        /// <param name="owner">The owner</param>
        /// <returns>A string entered by the user</returns>
        public static string Show(string text, string caption = "", string defaultValue = "", bool useSystemPasswordChar = false, IWin32Window owner = null)
        {
            using (InputBoxForm inputBoxForm = new InputBoxForm())
            {
                inputBoxForm.Prompt = text;
                inputBoxForm.Title = string.IsNullOrEmpty(caption) ? Application.ProductName : caption;
                inputBoxForm.UseSystemPasswordChar = useSystemPasswordChar;
                inputBoxForm.Value = defaultValue;

                return ((owner != null) ? inputBoxForm.ShowDialog(owner) : inputBoxForm.ShowDialog()) == DialogResult.Cancel ? string.Empty : inputBoxForm.Value;
            }
        }
 public string Show(string i_Prompt)
 {
     using (InputBoxForm form = new InputBoxForm(i_Prompt))
     {
         form.isKeyValid = this.ValidateKey;
         if (form.ShowDialog() == DialogResult.OK)
         {
             return(form.Input);
         }
     }
     return(string.Empty);
 }
Ejemplo n.º 16
0
    public void Go()
    {
        installerdirectory = Application.StartupPath;
        //Console.WriteLine( Application.StartupPath );

        //CheckFramework(); // Hmmm, setup wont run without framework, no need to check :-D

        string SpringInstallDirectory = GetSpringInstallDirectory();

        InputBoxForm frmInputBox = new InputBoxForm();
        frmInputBox.Title = "Locate Spring Application directory";
        frmInputBox.Prompt = "Please confirm the Spring Application directory:";
        frmInputBox.DefaultResponse = SpringInstallDirectory;
        //if (XPos >= 0 && YPos >= 0)
        //{
          //  frmInputBox.StartLocation = new Point(XPos, YPos);
        //}
        frmInputBox.ShowDialog();
        SpringInstallDirectory = frmInputBox.ReturnValue;

        if( SpringInstallDirectory == "" )
        {
            MessageBox.Show( "No directory specified.  Aborting setup.exe." );
            return;
        }

        if( !Directory.Exists( SpringInstallDirectory ) )
        {
            MessageBox.Show( "Directory " + SpringInstallDirectory + " does not exist.  Please run setup again." );
            return;
        }

        string springexefilepath = Path.Combine( SpringInstallDirectory, "Spring.exe" );
        if( !File.Exists( springexefilepath ) )
        {
            MessageBox.Show( "Spring.exe not found in " + SpringInstallDirectory + ".  Please rerun setup." );
            return;
        }

        FileInfo springfile = new FileInfo( springexefilepath );
        if( springfile.Length != 3502080 )
        {
            MessageBox.Show( "Spring.exe appears to be a different version than what we are looking for.  Please reinstall the latest version of Spring, and try again." );
            return;
        }

        Console.WriteLine( SpringInstallDirectory );

        InstallFiles( SpringInstallDirectory );

        MessageBox.Show( "Installation completed successfully.  Please add bot \"csailoader.dll\" to your games to use CSAI" );
    }
        private void button3_Click(object sender, EventArgs e)
        {
            double d = 0.0;

            if (!InputBoxForm.GetDouble("Enter speed:", 1.0, out d))
            {
                return;
            }
            WaveAudio ww = new WaveAudio(PATH_BACKEND_WAV);

            this.curAudio = Effects.ScalePitchAndDuration(ww, d);
            this.aplayer.Play(this.curAudio, true);
        }
        private void mnuAdvSetParamRange_Click(object sender, EventArgs e)
        {
            double v;
            double defaultRange = 2.0;

            if (!InputBoxForm.GetDouble("The trackbars allow c1 to be set to a value between -a to a. Choose value of a:", defaultRange, out v))
            {
                return;
            }

            this.paramRange = v * 2.0; //so that 2.0 becomes range of 4
            setSliderToValue(plotCntrl.param1, tbParam1, lblParam1);
            setSliderToValue(plotCntrl.param2, tbParam2, lblParam2);
        }
Ejemplo n.º 19
0
    public static bool WarningBox(string title, string message, string yesText = "Yes", string NoText = "No")
    {
        InputBoxForm wBox = new InputBoxForm();

        wBox.YesNoSetup(title, message, yesText, NoText);

        DialogResult result = wBox.ShowDialog();

        if (result != DialogResult.OK)
        {
            return(true);
        }

        return(false);
    }
        private bool manSetValue(Label lbl, TrackBar tb, out double v)
        {
            double current; if (!double.TryParse(lbl.Text, out current))

            {
                current = 0.0;
            }

            v = 0.0;
            if (!InputBoxForm.GetDouble("Value:", current, out v))
            {
                return(false);
            }
            setSliderToValue(v, tb, lbl);
            return(true);
        }
Ejemplo n.º 21
0
    public static string GetStrInput(string strPrompt, string strCurrent)
    {
        InputBoxForm myForm = new InputBoxForm();

        myForm.label1.Text     = strPrompt;
        myForm.txtMessage.Text = strCurrent;
        myForm.ShowDialog(new Form());
        if (myForm.DialogResult == DialogResult.OK)
        {
            return(myForm.Message);
        }
        else
        {
            return(null);
        }
    }
Ejemplo n.º 22
0
        private void MenuGroupAddMain_Click(object sender, EventArgs e)
        {
            InputBoxForm inputBoxForm = new InputBoxForm("Добавление основной группы", "Наименование", "Комментарий", "", "");

            if (inputBoxForm.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            DataRow row = this.table_embrasuretypegroup.NewRow();

            row["idembrasuretypegroup"] = (object)dbconn.GetGenId("gen_embrasuretypegroup");
            row["name"]     = (object)inputBoxForm.Value;
            row["comment"]  = (object)inputBoxForm.Value2;
            row["isactive"] = (object)true;
            this.table_embrasuretypegroup.Rows.Add(row);
        }
        private void mnuAdvSetParamRange_Click(object sender, EventArgs e)
        {
            double v;
            double defaultRange = this.paramRange;

            if (!InputBoxForm.GetDouble("The trackbars allow to be set to a value between 0 and a. Choose value of a:", defaultRange, out v))
            {
                return;
            }

            this.paramRange = v; //so that 2.0 becomes range of 4
            setSliderToValue(0);
            setSliderToValue(1);
            setSliderToValue(2);
            setSliderToValue(3);
        }
Ejemplo n.º 24
0
        private void renameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListViewItem sItem = contentView.SelectedItems[0];  //GET THE SELECTED OBJECT

            switch (recognizeSelectedItem(sItem))
            {
            case 1:     //DRIVE
                break;

            case 2:     //DIRECTORY
                r.DirectoryInformationResponse.DirectoryInfo dir = (r.DirectoryInformationResponse.DirectoryInfo)sItem.Tag;
                InputBoxForm di = new InputBoxForm();
                di.Response = dir.Name;
                di.initiateText("Enter the new name of folder", "Rename Folder");
                if (di.ShowDialog(this) == DialogResult.OK)
                {
                    string des = dir.FullName.Substring(0, dir.FullName.Length - dir.Name.Length) + di.Response;
                    if (des != dir.FullName)
                    {
                        FileSystem.RequestRename(server.serverPort.Stream, dir.FullName, des);
                    }
                }
                di.Dispose();
                break;

            case 3:     //FILE
                r.FileInformationResponse.FileInfo fil = (r.FileInformationResponse.FileInfo)sItem.Tag;
                InputBoxForm diF = new InputBoxForm();
                diF.Response = fil.Name;
                diF.initiateText("Enter the new name of file", "Rename File");
                if (diF.ShowDialog(this) == DialogResult.OK)
                {
                    string des = fil.FullName.Substring(0, fil.FullName.Length - fil.Name.Length) + diF.Response;
                    if (des != fil.FullName)
                    {
                        FileSystem.RequestRename(server.serverPort.Stream, fil.FullName, des);
                    }
                }
                diF.Dispose();
                break;

            case 0:
                MessageBox.Show("UnKnown Item found", "Error");
                break;
            }
            refreshContent();       //REQUEST FOR NEW CONTENTS
        }
        private void mnuFileAnimate_Click(object sender, EventArgs e)
        {
            double c0_0, c0_1, c1_0, c1_1; int nframes;
            double param1 = plotCntrl.param1, param2 = plotCntrl.param2;

            if (!InputBoxForm.GetDouble("Initial c1:", param1, out c0_0))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Final c1:", param1, out c0_1))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Initial c2:", param2, out c1_0))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Final c2:", param2, out c1_1))
            {
                return;
            }
            if (!InputBoxForm.GetInt("Number of frames:", 50, out nframes))
            {
                return;
            }

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter           = "png files (*.png)|*.png";
            saveFileDialog1.RestoreDirectory = true;
            if (!(saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK && saveFileDialog1.FileName.Length > 0))
            {
                return;
            }
            string sfilename = saveFileDialog1.FileName;
            double c0_inc    = (c0_1 - c0_0) / nframes;
            double c1_inc    = (c1_1 - c1_0) / nframes;

            for (int i = 0; i < nframes; i++)
            {
                plotCntrl.param1 = c0_0;
                plotCntrl.param2 = c1_0;
                plotCntrl.renderToDiskSave(400, 400, sfilename.Replace(".png", "_" + i.ToString("000") + ".png"));
                c0_0 += c0_inc;
                c1_0 += c1_inc;
            }
        }
Ejemplo n.º 26
0
        private void MenuGroupRename_Click(object sender, EventArgs e)
        {
            DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup);

            if (selectedNode == null)
            {
                return;
            }
            InputBoxForm inputBoxForm = new InputBoxForm("Редактирование группы типов проёмов", "Наименование", "Комментарий", selectedNode["name"].ToString(), selectedNode["comment"].ToString());

            if (inputBoxForm.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            selectedNode["name"]    = (object)inputBoxForm.Value;
            selectedNode["comment"] = (object)inputBoxForm.Value2;
        }
        private void mnuAdvancedRenderSize_Click(object sender, EventArgs e)
        {
            int width, height;

            if (!InputBoxForm.GetInt("Render Width:", nRenderWidth, out width))
            {
                return;
            }
            if (!InputBoxForm.GetInt("Render Height:", nRenderHeight, out height))
            {
                return;
            }
            if (width > 0 && height > 0)
            {
                nRenderHeight = height; nRenderWidth = width;
            }
        }
        private bool manSetValue(int i)
        {
            Label  lbl = this.lblParamLabels[i]; TrackBar tb = this.tbParamTrackBars[i];
            double current; if (!double.TryParse(lbl.Text, out current))
            {
                current = 0.0;
            }
            double v = 0.0;

            if (!InputBoxForm.GetDouble("Value:", current, out v))
            {
                return(false);
            }
            paramValues[i] = v;
            setSliderToValue(i);
            return(true);
        }
Ejemplo n.º 29
0
    private void linkCredits_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
    {
        var credBox = InputBoxForm.OKBOX("Credits");

        credBox.TitleLabel.ForeColor = Color.White;

        credBox.richTextBox1.Height += 20;
        credBox.Height += 25;

        credBox.richTextBox1.Font   = new Font("Microsoft Sans Serif", 12);
        credBox.panelBG.BorderStyle = BorderStyle.Fixed3D;

        credBox.richTextBox1.AppendText("BoltMan: Project Creator", Color.MediumSlateBlue, true);
        credBox.richTextBox1.AppendText("UncleClapton: Repo Manager/Contributor", Color.RoyalBlue, true);
        credBox.richTextBox1.AppendText("", Color.RoyalBlue, true);
        credBox.richTextBox1.AppendText("You can contribute @ https://github.com/UncleClapton/MHWModManager", Color.Orange, false);

        credBox.richTextBox1.CenterText();

        credBox.ShowDialog();
    }
Ejemplo n.º 30
0
        protected override bool RunDialog(IntPtr hwndOwner)
        {
            if (null == this.ibf) {
                this.ibf = new InputBoxForm();
                this.ibf.StartPosition = FormStartPosition.CenterParent;
            }

            this.ibf.Input = (null == this.Input) ? string.Empty : this.Input;
            this.ibf.Text = (null == this.Title) ? string.Empty : this.Title;
            this.ibf.Message = (null == this.Message) ? string.Empty : this.Message;

            switch (this.ibf.ShowDialog(new Win32WindowImpl(hwndOwner))) {
                case DialogResult.OK:
                    this.Input = this.ibf.Input;
                    this.Title = this.ibf.Text;
                    this.Message = this.ibf.Message;
                    return true;
                default:
                    return false;
            }
        }
Ejemplo n.º 31
0
        private void createFromURLShortcutsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string sDir = InputBoxForm.GetStrInput("All URL shortcuts from this directory:", "c:\\example");

            if (sDir == null || !Directory.Exists(sDir))
            {
                MessageBox.Show("Not a valid directory."); return;
            }

            // create bg thread.
            g_busy = true; this.btn1.Enabled = false;
            Thread oThread = new Thread(delegate()
            {
                CallAndCatchExceptions.Call(delegate(object param)
                {
                    new BookmarkBucket().TopUrlShortcutsToJpegs((string)param);
                }, sDir);
                g_busy = false; g_status = "";
            });

            oThread.Start();
        }
Ejemplo n.º 32
0
        }; // class InputBoxForm

        // Pop up an input box and ask the user a question.
        public static String InputBox
            (String Prompt,
            [Optional][DefaultValue("")] String Title,
            [Optional][DefaultValue("")] String DefaultResponse,
            [Optional][DefaultValue(-1)] int XPos,
            [Optional][DefaultValue(-1)] int YPos)
        {
            // Consult the host to find the input box's parent window.
            IVbHost      host;
            IWin32Window parent;

            host = HostServices.VBHost;
            if (host != null)
            {
                parent = host.GetParentWindow();
            }
            else
            {
                parent = null;
            }

            // Pop up the input box and wait for the response.
            InputBoxForm form = new InputBoxForm
                                    (Prompt, Title, DefaultResponse, XPos, YPos);
            DialogResult result       = form.ShowDialog(parent as Form);
            String       resultString = form.Result;

            form.DisposeDialog();

            // Return the result to the caller.
            if (result == DialogResult.OK)
            {
                return(resultString);
            }
            else
            {
                return(String.Empty);
            }
        }
        public void TopCreateManualShortcut(string sFilename)
        {
            string sUrl = InputBoxForm.GetStrInput("Stamp URL on a file - Enter URL:", "http://example");

            if (!BookmarkBucketCore.looksLikeAUrl(sUrl))
            {
                return;
            }
            if (sFilename.ToLowerInvariant().EndsWith(".html"))
            {
                File.AppendAllText(sFilename, strHtmlStamp + sUrl + "-->");
            }
            else if (sFilename.ToLowerInvariant().EndsWith(".jpeg"))
            {
                BookmarkBucketCore.StripAllExifData(sFilename);
                BookmarkBucketCore.SetExifData(sFilename, sUrl, Path.GetFileNameWithoutExtension(sFilename));
            }
            else
            {
                MessageBox.Show("Try a .html or .jpeg file");
            }
        }
Ejemplo n.º 34
0
        private void MenuGroupAddChild_Click(object sender, EventArgs e)
        {
            DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup);

            if (selectedNode == null)
            {
                return;
            }
            InputBoxForm inputBoxForm = new InputBoxForm("Добавление дочерней группы", "Наименование", "Комментарий", selectedNode["name"].ToString(), "");

            if (inputBoxForm.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            DataRow row = this.table_embrasuretypegroup.NewRow();

            row["idembrasuretypegroup"] = (object)dbconn.GetGenId("gen_embrasuretypegroup");
            row["parentid"]             = selectedNode["idembrasuretypegroup"];
            row["name"]     = (object)inputBoxForm.Value;
            row["comment"]  = (object)inputBoxForm.Value2;
            row["isactive"] = (object)true;
            this.table_embrasuretypegroup.Rows.Add(row);
        }
Ejemplo n.º 35
0
    public static InputBoxForm OKBOX(string title, string message = "", string okText = "OK")
    {
        InputBoxForm wBox = new InputBoxForm();

        wBox.TitleLabel.Text      = title;
        wBox.TitleLabel.ForeColor = Color.Crimson;
        wBox.labelGeneric.Height += 25;
        wBox.Width += 50;
        wBox.richTextBox1.Width  += 50;
        wBox.labelGeneric.Visible = true;

        wBox.labelGeneric.Text = message;
        wBox.buttonCancel.Text = okText;

        wBox.textBoxInput.Visible = false;
        wBox.buttonOK.Visible     = false;

        wBox.labelGeneric.Visible = false;

        wBox.buttonNoAll.Visible  = false;
        wBox.buttonYesAll.Visible = false;

        return(wBox);
    }
Ejemplo n.º 36
0
        private void uiSaveSelections_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string name = InputBoxForm.Show(this, Properties.Resources.kstidTlEnterNameSavedSel,
                                            Properties.Resources.kstidSaveSelections, "");

            if (name != null)
            {
                SavedScrTextList savedList = new SavedScrTextList();
                savedList.Name = name;
                foreach (ScrText scrText in rightItems)
                {
                    savedList.ScrTextNames.Add(scrText.Name);
                }

                if (Settings.Default.SavedScrTextLists == null)
                {
                    Settings.Default.SavedScrTextLists = new SavedScrTextLists();
                }

                Settings.Default.SavedScrTextLists.Add(savedList);
                Settings.Default.Save();
                UpdateSavedSelectionLinks();
            }
        }
Ejemplo n.º 37
0
        public void automatedrecovery(string startnumber)
        {
            var t = getSqlServer.FilledTable("select TOP 1 * FROM [ordered] where ordernumber like '" + startnumber + "' ORDER BY ID DESC");

            try {
            DataRow r = t.Rows[0];

            string ordernumber = r["ordernumber"].ToString();
            string firstname = r["firstname"].ToString();
            string lastname = r["lastname"].ToString();
            string mrn = r["mrn"].ToString();
            string collectiontime = r["collectiontime"].ToString();
            string receivetime = r["receivetime"].ToString();
            string priority = r["priority"].ToString();
            string ComboBoxWard = r["ward"].ToString();
            string bluetest = r["bluetest"].ToString();
            string redtest = r["redtest"].ToString();
            string greentest = r["greentest"].ToString();
            string urinechem = r["urinechem"].ToString();
            string urinehem = r["urinehem"].ToString();
            string graytest = r["grytest"].ToString();
            string comment = r["ordercomment"].ToString();
            string problem = r["problem"].ToString();
            string lavchemtest = r["lavchemtest"].ToString();
            string lavhemtest = r["lavhemtest"].ToString();
            string bloodgas = r["bloodgas"].ToString();
            string DOB = r["dob"].ToString();
            string cal1 = r["calls"].ToString();
            string sendout = r["SENDOUT"].ToString();
            string hepp = r["heppetitas"].ToString();
            string ser = r["serology"].ToString();
            string colldate = r["collectdate"].ToString();
            string csfbox = r["CSFTEST"].ToString();
            string fluidbox = r["FLUIDTEST"].ToString();
            string Viralloadbox = r["VIRALLOADTEST"].ToString();
            string OTHERBOX = r["OTHERTEST"].ToString();
            string BILLING = r["BILLINGNUMBER"].ToString();

            if (BILLING == string.Empty) {

             var response = Interaction.MsgBox("No Billing #", MsgBoxStyle.DefaultButton1, "MsgBox");
                if (response == MsgBoxResult.Ok) {
                    this.Visible = true;
                    TextBoxOrderNumber.Focus();

                    return;
                }
            }

            Dictionary<string, string[]> DICT = new Dictionary<string, string[]>();

            DICT.Add("bluetest", Strings.Split(bluetest, ","));

            DICT.Add("redtest", Strings.Split(redtest, ","));

            DICT.Add("greentest", Strings.Split(greentest, ","));

            DICT.Add("lavhemtest", Strings.Split(lavhemtest, ","));

            DICT.Add("lavchemtest", Strings.Split(lavchemtest, ","));

            DICT.Add("serology", Strings.Split(ser, ","));

            DICT.Add("heppat", Strings.Split(hepp, ","));

            DICT.Add("urinehem", Strings.Split(urinehem, ","));

            DICT.Add("urinechem", Strings.Split(urinechem, ","));

            DICT.Add("bloodgas", Strings.Split(bloodgas, ","));

            DICT.Add("gray", Strings.Split(graytest, ","));

            DICT.Add("viral", Strings.Split(Viralloadbox, ","));

            DICT.Add("csf", Strings.Split(csfbox, ","));

            DICT.Add("fluid", Strings.Split(fluidbox, ","));

            AutoIt.Sleep(500);
            AutoIt.WinActivate("Search");
            AutoIt.ControlSend("Search", "", "[CLASS:Edit; INSTANCE:7]", BILLING, 0);
            AutoIt.Sleep(200);
            AutoIt.WinActivate("Search");
            AutoIt.Send("{ENTER}");
            AutoIt.Sleep(200);
            AutoIt.Send("!w");
            AutoIt.Sleep(200);
            AutoIt.Send("{o}");

            AutoIt.Sleep(500);

            if (AutoIt.WinWaitActive("Order info", "", 1))
            {
                AutoIt.Send("{ENTER}");
            }

            AutoIt.Sleep(500);
            AutoIt.Send("SD");

            AutoIt.Sleep(100);
            AutoIt.Send("{TAB}");
            AutoIt.Sleep(100);
            int n = 0;
            string reqdr = AutoIt.WinGetText("Order Entry - [New Order  - Edit Mode]", "");
            Console.WriteLine(reqdr);
            string[] drname = reqdr.Split('&');

            Match newseq = Regex.Match(reqdr, "\\bDr:\\n([A-Z 0-9]+)\\n.+$", RegexOptions.Multiline);

            //Do While n < 10
            //    Dim tstcd As String = newtest.Groups(n).Value
            //    n = n + 1
            //    Console.WriteLine(tstcd)
            //Loop
            //'dim testdr As String =

            //'For Each d As String In drname

            //'    Dim parsetest = drname(n)
            //'    n = n + 1
            //'    Console.WriteLine(parsetest)
            //'Next
            //Dim drcodearray As String = drname(2)

            //Dim drfirst As Array = drcodearray.Split(" ")

            //Dim drcodesect As String = drfirst(1).ToString

            //Dim newseq As Match = Regex.Match(drcodesect, "^Dr:\n([A-Z 0-9]+)\n.+$", RegexOptions.Multiline)

            string drcode = newseq.Groups[1].Value;

            AutoIt.ControlSend("Order Entry - [New Order  - Edit Mode]", "", "[CLASS:Edit; INSTANCE:33]", drcode, 0);

            //AutoIt.Send("{TAB}")
            //AutoIt.Sleep(100)
            //AutoIt.Send("{TAB}")
            //AutoIt.Sleep(100)
            //AutoIt.Send("{TAB}")
            //AutoIt.Sleep(100)
            //AutoIt.Send("{F2}")
            //AutoIt.Sleep(200)
            //'AutoIt.Send(drlast)
            //AutoIt.Sleep(100)
            //AutoIt.Send("{TAB}")
            //'AutoIt.Send(drfirst)
            //AutoIt.Send("!F")
            //WinWaitClose("Doctor Search Screen")
            //AutoIt.ControlFocus("Order Entry - [New Order  - Edit Mode]", "", "[CLASS:Edit; INSTANCE:2]")

            //AutoIt.Send("^V")

            AutoIt.ControlSend("Order Entry - [New Order  - Edit Mode]", "", "[CLASS:ComboBox; INSTANCE:1]", priority, 0);
            AutoIt.Sleep(500);
            AutoIt.ControlSend("Order Entry - [New Order  - Edit Mode]", "", "[CLASS:Edit; INSTANCE:15]", ordernumber, 0);

            AutoIt.Sleep(700);
            AutoIt.WinActivate("Order Entry - [New Order  - Edit Mode]");
            AutoIt.Send("!2");
            //AutoIt.SetOptions(true)

            foreach (string testtype in DICT.Keys) {

                foreach (string test in DICT[testtype]) {
                    AutoIt.Send(test);
                    AutoIt.Send("{ENTER}");
                    AutoIt.Sleep(300);

                    if (AutoIt.WinExists("Order Entry", "RBS"))
                    {
                        while (!(AutoIt.WinExists("Order Entry", "RBS") == false)) {
                            AutoIt.WinActivate("Order Entry", "RBS");
                            AutoIt.Sleep(100);
                            AutoIt.Send("{ENTER}");
                            AutoIt.Sleep(200);
                        }

                    }
                    if (AutoIt.WinExists("Order Entry", "RBS <SSIGN>: reflex 'SSIGN' on Ord# NEW"))
                    {
                        while (!(AutoIt.WinExists("Order Entry", "RBS <SSIGN>: reflex 'SSIGN' on Ord# NEW") == false)) {
                            AutoIt.WinActivate("Order Entry", "RBS <SSIGN>: reflex 'SSIGN' on Ord# NEW");
                            AutoIt.Sleep(100);
                            AutoIt.Send("{ENTER}");
                            AutoIt.Sleep(200);
                        }
                    }
                    if (AutoIt.WinExists("Order Entry", "not defined"))
                    {
                        AutoIt.Sleep(100);
                        AutoIt.Send("{ENTER}");
                        AutoIt.Sleep(200);
                        tests = test;
                        InputBoxForm Iform = new InputBoxForm();

                        Iform.ShowDialog(this);
                        AutoIt.Sleep(200);
                        Iform.Focus();
                        //TopMost = True
                        //Dim testfix As String = InputBox("Correct unknown test: " & test)
                        //TopMost = False
                        Console.WriteLine(fixTEST);
                        AutoIt.ControlSend("Order Entry", "New Order  - Edit Mode", "[CLASS:Edit; INSTANCE:1]", fixTEST, 0);
                        AutoIt.Sleep(100);
                        AutoIt.WinActivate("Order Entry - [New Order  - Edit Mode]");
                        AutoIt.Sleep(50);
                        AutoIt.Send("{ENTER}");

                    }

                    AutoIt.Sleep(200);
                }
            }
            AutoIt.Send("{F9}");
            AutoIt.Sleep(200);
            AutoIt.Send(";");
            AutoIt.Sleep(200);
            AutoIt.Send("{TAB}");
            AutoIt.Send(collectiontime);
            AutoIt.Send("{TAB}");
            AutoIt.Send(DateTimeFunctions.datetoordentry(colldate));
            AutoIt.Send("{TAB}");
            AutoIt.Send("{TAB}");
            AutoIt.Send(receivetime);
            AutoIt.Send("{TAB}");
            AutoIt.Send(DateTimeFunctions.datetoordentry(colldate));
            AutoIt.Send("{ENTER}");
            AutoIt.Sleep(200);
            AutoIt.Send("^s");
            AutoIt.Sleep(1000);

            if (AutoIt.WinExists("Result must be entered for this test:"))
            {
                AutoIt.WinWaitClose("Result must be entered for this test:");
            }

            if (AutoIt.WinExists("Results must be entered for these tests:"))
            {
                AutoIt.WinWaitClose("Results must be entered for these tests:");
            }

            AutoIt.Send("y");
            AutoIt.Sleep(500);
            AutoIt.WinWaitActive("Standard Label", 1);
            AutoIt.Send("{TAB}");
            AutoIt.Send("{TAB}");
            AutoIt.Send("{TAB}");
            AutoIt.Send("{TAB}");
            //AutoIt.Send("{TAB}")
            AutoIt.Send("{ENTER}");
            AutoIt.Sleep(500);

            //For Each kv As KeyValuePair(Of String, String()) In DICT

            //    Console.WriteLine(kv.Key)

            //Next

            } catch (Exception ex) {
            }
            this.Visible = true;
        }
Ejemplo n.º 38
0
 /// <summary>
 /// 添加修改记录
 /// </summary>
 /// <param name="field"></param>
 /// <param name="oldvalue"></param>
 /// <param name="newvalue"></param>
 /// <returns></returns>
 private  bool AddDataRecord(string extraRemarks, object oldvalue, object newvalue)
 {
     //设置记录备注
     string strRemarks = "未添加备注";
     if (Program.m_bCommentOnSave)
     {
         InputBoxForm ibf = new InputBoxForm();
         if (ibf.ShowDialog() == DialogResult.OK)
         {
             strRemarks = ibf.Remarks;
         }
         else
         {
             return false;
         }
     }
     strRemarks = string.Format("{0}:({1})", strRemarks, extraRemarks);
     string oldValue = oldvalue.ToString();
     string newValue = newvalue.ToString();
     if (oldvalue is bool) // 检查是否是真假值,显示值统一换为是和否
     {
         oldValue = DataRecord.TranslateValue(oldValue);
         newValue = DataRecord.TranslateValue(newValue);
     }
     oldValue = oldValue.Replace("'", "''");
     newValue = newValue.Replace("'", "''");
     
     // 记录表的值
     DataRecord dataRecord = DataRecord.GetDataRecord();
     dataRecord.Conn = m_conn; // sql连接            
     dataRecord.CurrentNode = m_lua["SelectedNode"] as TreeNode; // 树结点
     dataRecord.Time = DateTime.Now; // 当前修改时间
     dataRecord.UserName = Helper.GetHostName(); // 当前用户名
     dataRecord.OldValue = oldValue; // 字段的旧值        
     dataRecord.NewValue = newValue; // 字段的新值
     dataRecord.Remarks = strRemarks;
     dataRecord.Save();
     return true;
 }
Ejemplo n.º 39
0
 /// <summary>
 /// �j�b�N�l�[���V�K����
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void menuNicknameInputMenuItem_Click(object sender, EventArgs e)
 {
     if (ircClient.Status == IRCClientStatus.Online)
     {
         using (InputBoxForm form = new InputBoxForm())
         {
             form.Text = Resources.InputNewNicknameTitle;
             form.Description = Resources.InputNewNicknamePrompt;
             if (form.ShowDialog() == DialogResult.OK)
             {
                 if (!string.IsNullOrEmpty(form.Value))
                 {
                     ircClient.ChangeNickname(form.Value);
                 }
             }
         }
     }
 }
Ejemplo n.º 40
0
 /// <summary>
 /// �`�����l���lj����j���[
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void addSenderMenuItem_Click(object sender, EventArgs e)
 {
     using (InputBoxForm form = new InputBoxForm()) {
         form.Text = Resources.ChannelAddDialogTitle;
         form.Description = Resources.ChannelAddDialogCaption;
         if (form.ShowDialog() == DialogResult.OK)
         {
             (Owner as EbIrcMainForm).AddChannel(form.Value, false, null, true);
             LoadChannelList();
         }
     }
 }
Ejemplo n.º 41
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("是否确认删除该结点及其子结点?", "删除确认", MessageBoxButtons.YesNo);
            if (result != DialogResult.Yes)
            {
                return;
            }

            string strRemarks = "未添加备注";

            InputBoxForm ibf = new InputBoxForm();
            if (ibf.ShowDialog() == DialogResult.OK)
            {
                strRemarks = ibf.Remarks;
            }
            else
            {
                return;
            }
            

            bool bNoCatActually = false;
            if (CatFields.Length == 1 && CatFields[0] == "")
                bNoCatActually = true;

            TreeNode selected = this.baseTree.SelectedNode;
            int deleteCount = 0;
            DBCustomClass dbClass = ((PageDesc)m_Pages[0]).dbClass;

            // 脚本完成
            if (dbClass.ExistLuaFunction("DeleteNode"))
            {
                //m_lua["SelectedNode"] = this.baseTree.SelectedNode;
                object[] results = dbClass.CallLuaFunction("DeleteNode", new object[] { baseTree.SelectedNode });
                if (results != null)
                    deleteCount = Convert.ToInt32(results[0]);

                baseTree.SelectedNode.Remove();
            }

            // 用C#完成, 删除的是分类结点
            else if (!bNoCatActually && selected.Level < CatFields.Length)
            {
//                 // 更新表元数据
//                 string sql = string.Format("SELECT * FROM sys_meta_info WHERE tablename='{0}' AND fieldname='{1}'", MainTableName, CatFields[selected.Level]);
//                 DataTable tblMetaInfo = Helper.GetDataTable(sql, Conn);
//                 if (tblMetaInfo.Rows.Count > 0)
//                 {
//                     DataRow row = tblMetaInfo.Rows[0];
//                     switch (row["editortype"].ToString().Trim())
//                     {
//                         case "lookupcombo":
//                             {
//                                 DataTable tbl_lookup = Helper.GetDataTable("SELECT * FROM " + row["listtable"].ToString().Trim(), Conn);
//                                 DataRow rowdel = tbl_lookup.Rows.Find(selected.Tag);
//                                 rowdel.Delete();
//                                 SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM " + row["listtable"].ToString().Trim(), m_conn);
//                                 SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(adp);
//                                 adp.DeleteCommand = cmdBuilder.GetDeleteCommand();
//                                 int val = adp.Update(tbl_lookup);
//                                 tbl_lookup.AcceptChanges();
//                             }
//                             break;
//                         case "textcombo":
//                             {
//                                 string listvalues = row["listvalues"].ToString().Trim();
//                                 row["listvalues"] = listvalues.Replace(selected.Tag.ToString().Trim() + "," + selected.Text, "");
//                                 SqlDataAdapter adp = new SqlDataAdapter(sql, Conn);
//                                 SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(adp);
//                                 adp.UpdateCommand = cmdBuilder.GetUpdateCommand();
//                                 int val = adp.Update(tblMetaInfo);
//                                 tblMetaInfo.AcceptChanges();
//                             }
//                             break;
//                         default:
//                             break;
//                     }
//                 }

                // 更新主表记录
//                 ArrayList ls = new ArrayList();
//                 FindAllOffspringNodesByLevel(selected, ref ls, CatFields.Length);

                string strQuotation = string.Empty;
                string strTypeName = Helper.GetFieldDataType(MainTableName, CatFields[selected.Level], Conn);
                if (strTypeName == "System.String")
                {
                    strQuotation = "'";
                }

                string sQl = string.Format("SELECT * FROM {0} WHERE [{1}]={2}{3}{4}", MainTableName, CatFields[selected.Level], strQuotation, selected.Tag is object[] ? (selected.Tag as object[])[0] : selected.Tag, strQuotation);
                string filter = string.Format("[{0}]={1}{2}{3}", CatFields[selected.Level], strQuotation, selected.Tag is object[] ? (selected.Tag as object[])[0] : selected.Tag, strQuotation);
                TreeNode parent_node = selected.Parent;
                while (parent_node != null)
                {
                    strQuotation = string.Empty;
                    strTypeName = Helper.GetFieldDataType(MainTableName, CatFields[parent_node.Level], Conn);
                    if (strTypeName == "System.String")
                    {
                        strQuotation = "'";
                    }

                    sQl += string.Format(" AND [{0}]={1}{2}{3}", CatFields[parent_node.Level], strQuotation, parent_node.Tag, strQuotation);
                    filter += string.Format(" AND [{0}]={1}{2}{3}", CatFields[parent_node.Level], strQuotation, parent_node.Tag, strQuotation);
                    parent_node = parent_node.Parent;
                }
                //DataTable tblrecord = Helper.GetDataTable(sQl, Conn);
                DataTable tblrecord = Helper.GetDataTableProxy(MainTableName, filter, null, Conn);
                foreach (DataRow r in tblrecord.Rows)
                {
                    r.Delete();
                }

                

                /* remoting
                SqlDataAdapter Adp = new SqlDataAdapter(sQl, Conn);
                SqlCommandBuilder CmdBuilder = new SqlCommandBuilder(Adp);
                Adp.DeleteCommand = CmdBuilder.GetDeleteCommand();
                int Val = Adp.Update(tblrecord);
                tblrecord.AcceptChanges();
                */

                int Val = Helper.SaveTable(tblrecord, sQl, Conn);

                deleteCount = Val;

                // 删除树的相关结点
                RecordDeleteNodes(selected, "删除节点", strRemarks);
                selected.Remove();
                
//                 foreach (TreeNode node in selected.Nodes)
//                     node.Remove();
            }

            else if (!LoadTreeWithLua && selected.Level == CatFields.Length || bNoCatActually) // 无lua,删除结点
            {
                deleteCount = SqlRemoveRecord(MainTableName, selected.Tag);
                RecordDeleteNodes(selected, "删除节点", strRemarks);
                selected.Remove();
                
            }

            MessageBox.Show("删除完成!\r\n\r\n删除记录条数: " + deleteCount.ToString());

            if (dbClass.ExistLuaFunction("PostDeleteNode"))
                dbClass.CallLuaFunction("PostDeleteNode", new object[] { selected.Tag });
        }
Ejemplo n.º 42
0
        public void ExecCommand(string strCmd, object data)
        {
            try
            {
                switch (strCmd.Trim().ToLower())
                {
                case "savedocument":
                    if ((!Program.m_bUseNewAcl || this.CanSaveDB) && !Program.m_bLockDBForCompetition)
                    {
                        if (m_bRecordChanged || CustomTabHasChanged())
                        {
                            //设置记录备注
                            string strRemarks = "未添加备注";
                            if (Program.m_bCommentOnSave)
                            {
                                InputBoxForm ibf = new InputBoxForm();
                                if (ibf.ShowDialog() == DialogResult.OK)
                                {
                                    strRemarks = ibf.Remarks;
                                }
                                else
                                {
                                    UnlockRecord();
                                    break;
                                }
                            }
                            Helper.AddLog(string.Format("{0}:正在存档...", DateTime.Now.ToLongTimeString()));
                            SaveDocument(strRemarks);
                            Helper.AddLog(string.Format("{0}:存档完成", DateTime.Now.ToLongTimeString()));
                        }
                        
                    }
                    else
                    {
                        MessageBox.Show("您对于当前编辑器没有写权限!请申请开通。", "权限不足", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    break;
                case "findrecord":
                        {
                            if (m_bPluginTree || m_FindFrm != null)                    
                                return;
                            ArrayList arrExtraFindColumnField = new ArrayList();
                            DBCustomClass dbClass = ((PageDesc)m_Pages[0]).dbClass;
                            if (dbClass.ExistLuaFunction("AddExtraFindColumnFields"))
                            {
                                object[] args = new object[1];
                                args[0] = arrExtraFindColumnField;
                                dbClass.CallLuaFunction("AddExtraFindColumnFields", args);
                            }

                            FindForm1 findfrm = new FindForm1(this, baseTree, TblMain, DisplayField, arrExtraFindColumnField);
                            m_FindFrm = findfrm;
                            findfrm.Show();

                        }                   
                    break;
                case "cmdexport":
                    break;
                case "cmdimport":
                    break;
                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 43
0
 public bool AddDataRecord(string extraRemarks)
 {
     //设置记录备注
     string strRemarks = "未添加备注";
     if (Program.m_bCommentOnSave)
     {
         InputBoxForm ibf = new InputBoxForm();
         if (ibf.ShowDialog() == DialogResult.OK)
         {
             strRemarks = ibf.Remarks;
         }
         else
         {
             return false;
         }
     }
     strRemarks = string.Format("{0}:({1})", strRemarks, extraRemarks);
     // 记录表的值
     DataRecord dataRecord = DataRecord.GetDataRecord();
     dataRecord.Conn = m_conn; // sql连接            
     dataRecord.CurrentNode = m_lua["SelectedNode"] as TreeNode; // 树结点
     dataRecord.Time = DateTime.Now; // 当前修改时间
     dataRecord.UserName = Helper.GetHostName(); // 当前用户名
     dataRecord.Remarks = strRemarks;
     dataRecord.Save();
     return true;
 }
Ejemplo n.º 44
0
        //public static string Execute(string Prompt)
        //{
        //    using (var f = new MyInputDialog())
        //    {
        //        f.lblPrompt.Text = Prompt;
        //        f.ShowModal();
        //        return f.txtInput.Text;
        //    }
        //}
        private void btnDestroy_Click(object sender, EventArgs e)
        {
            INDoc _infoDoc = new INDoc();
            _infoDoc.BranchID = cmbBranchID.SelectedValue.ToString();

            if (txtDocNbr.Text != "")
                _infoDoc.DocNbr = txtDocNbr.Text;
            _infoDoc.Module = "IN";
            _infoDoc.TranType = _strFistChar;
            _infoDoc.TotQty = float.Parse(txtTotalQty.Number.ToString());
            _infoDoc.WhID = cmbWhID.SelectedValue.ToString();
            _infoDoc.ToWhID = cmbToWhID.SelectedValue.ToString();
            _infoDoc.TotAmt = float.Parse(txtTotalAmt.Number.ToString());
            _infoDoc.DocDate = dtmDocDate.Value.Date;
            _infoDoc.DocDescr = txtDocDescr.Text;
            _infoDoc.RsID = cmbReason.SelectedValue.ToString();
            _infoDoc.Rlsed = -1;
            InputBoxForm ib = new InputBoxForm("text", "default", "caption");
            ib.ShowDialog();
            _infoDoc.Note = ib.txtOut.Text ;
            _infoDoc.Crtd_DateTime = DateTime.Now;
            _infoDoc.Crtd_Prog = _strPro;
            _infoDoc.Crtd_User = _strUser;
            _infoDoc.LUpd_DateTime = DateTime.Now;
            _infoDoc.LUpd_Prog = _strPro;
            _infoDoc.LUpd_User = _strUser;
            _infoDoc.Version = label1.Text;
            int kq;
            if (_infoDoc.DocNbr != "" && _infoDoc.DocNbr != "")
                kq = IN202Ctrl.SaveINDoc(_infoDoc);
            _BindDocList();
            _BinEditPanel(cmbBranchID.SelectedValue.ToString(), txtDocNbr.Text, "IN");
        }