Exemple #1
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;
            }
        }
Exemple #2
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();
        }
Exemple #3
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;
        }
    }
 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;
 }
Exemple #5
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();
 }
    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);
    }
Exemple #7
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);
     }
 }
Exemple #8
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);
            }
Exemple #9
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");
    }
Exemple #10
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;
 }
        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);
        }
 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);
 }
    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);
    }
    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);
        }
    }
        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);
        }
Exemple #16
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 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;
        }
Exemple #18
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);
            }
        }
        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);
        }
Exemple #20
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);
            }
        }
    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" );
    }
Exemple #22
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();
         }
     }
 }
Exemple #23
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;
        }
Exemple #24
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 });
        }
Exemple #25
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);
                 }
             }
         }
     }
 }
Exemple #26
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;
 }
    public static async void LoadLoadout()
    {
        Task saveBakTask = SaveLoadoutAuto(Serializer.GetMMDataFolder() + "LastLoadoutStateBackup.mlf", false);


        OpenFileDialog fileDialog = new OpenFileDialog()
        {
            InitialDirectory = string.IsNullOrEmpty(modsData.lastSaveDialoguePath) ? Serializer.GetMMDataFolder() : modsData.lastSaveDialoguePath,
            AddExtension     = true, Filter = selectDialogFilter, ValidateNames = true, Multiselect = false, CheckFileExists = true
        };

        var result = fileDialog.ShowDialog();

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

        await saveBakTask;

        try {
            ModsData loadoutData = Serializer.LoadObj(fileDialog.FileName) as ModsData;


            List <string> issues = new List <string>();

            foreach (var loadMod in loadoutData.modInfos)
            {
                //Console.WriteLine("");
                //foreach(var file in loadMod.archiveFiles) {
                //    Console.WriteLine($"{file.installed}: {file.path}");
                //}

                //Console.WriteLine($"{mod.modName}: {mod.intalledText}");

                if (!loadMod.archiveExists)
                {
                    issues.Add($"Couldnt Find: {loadMod.shortPath}");
                    continue;
                }

                ModInfo matchingMod = modsData.modInfos.Find(realMod => realMod.modName == loadMod.modName);

                if (!matchingMod)
                {
                    issues.Add($"Archive Not Loaded: {loadMod.modPath}");
                    continue;
                }


                RestoreModState(loadMod);
                foreach (var file in loadMod.archiveFiles)
                {
                    //not sure if neccessary but just clear the temporary belonging nodes just in case
                    file.belongingNode = null;

                    //update the installed status of the real mod archive files to match the status of the loadout files
                    ArchiveFile matchFile = matchingMod.archiveFiles.First(x => x.path == file.path);
                    if (matchFile)
                    {
                        matchFile.installed    = file.installed;
                        matchFile.installedCRC = file.installedCRC;
                    }
                }
            }

            IEnumerable <ModInfo> newlyAddedMods = modsData.modInfos.Where(mod => !loadoutData.modInfos.Find(loadmod => loadmod.modName == mod.modName));

            if (newlyAddedMods.Count() > 0)
            {
                InputBoxForm watDoBox = InputBoxForm.OKBOX("New Files Were Added!", "", "Uninstall New Mods");
                watDoBox.TitleLabel.ForeColor = Color.LightYellow;
                watDoBox.buttonClose.Visible  = false;

                watDoBox.richTextBox1.AppendText("\nSince this loadout was created, new mod archives have been added.\nWhat would you like to do about this?");
                watDoBox.richTextBox1.CenterText();

                watDoBox.buttonCancel.Width += 50;
                watDoBox.buttonCancel.Left  -= 50;

                watDoBox.buttonNoAll.Text    = "Leave As Is";
                watDoBox.buttonNoAll.Visible = true;
                watDoBox.buttonNoAll.Width  += 45;
                watDoBox.buttonNoAll.Left    = watDoBox.buttonCancel.Left - watDoBox.buttonNoAll.Width - 10;

                watDoBox.checkBoxGeneric1.Text    = "Update Loadout With Changes";
                watDoBox.checkBoxGeneric1.Visible = true;
                watDoBox.checkBoxGeneric1.Checked = true;
                watDoBox.checkBoxGeneric1.Top     = watDoBox.buttonNoAll.Top + 5;
                watDoBox.checkBoxGeneric1.Left    = 10;


                result = watDoBox.ShowDialog();
                if (result == DialogResult.No)
                {
                    //uninstall
                    foreach (var mod in newlyAddedMods)
                    {
                        foreach (var file in mod.archiveFiles)
                        {
                            file.belongingNode = new TreeNode()
                            {
                                Checked = true
                            }
                        }
                        ;
                        ArchiveManager.UninstallSelected(mod, false, true);
                        foreach (var file in mod.archiveFiles)
                        {
                            file.belongingNode = null;
                        }
                    }
                }
                else
                {
                    //leave be
                }

                if (watDoBox.checkBoxGeneric1.Checked)
                {
                    await SaveLoadoutAuto(fileDialog.FileName, false);
                }
            }

            ArchiveManager.DeleteEmptyDirs(Serializer.GetGameModFolder());

            InputBoxForm infoBox;

            if (issues.Count > 0)
            {
                infoBox = InputBoxForm.OKBOX("Completed With Warnings", "");
                infoBox.TitleLabel.ForeColor = Color.Orange;
                infoBox.richTextBox1.AppendText("The loadout was restored but there were some issues.\n\n");

                infoBox.Height += 100;
                infoBox.richTextBox1.Height += 95;

                foreach (string issue in issues)
                {
                    infoBox.richTextBox1.AppendText(issue, Color.LightYellow, true);
                }

                infoBox.checkBoxGeneric1.Text    = "Update Loadout With These Removed";
                infoBox.checkBoxGeneric1.Visible = true;
                infoBox.checkBoxGeneric1.Top     = infoBox.buttonNoAll.Top + 5;
                infoBox.checkBoxGeneric1.Left    = 10;
            }
            else
            {
                infoBox = InputBoxForm.OKBOX("Success", "");
                infoBox.TitleLabel.ForeColor = Color.PaleGreen;
                infoBox.richTextBox1.AppendText("\nMod loadout state succesfully restored.", Color.LawnGreen, true);
            }

            infoBox.richTextBox1.CenterText();
            infoBox.ShowDialog();

            if (infoBox.checkBoxGeneric1.Checked)
            {
                await SaveLoadoutAuto(fileDialog.FileName, false);
            }


            MainForm.RefreshListView();
            MainForm.RefreshTreeView();
        } catch (Exception ex) {
            InputBoxForm successBox = InputBoxForm.OKBOX("Failure", "");
            successBox.richTextBox1.AppendText("An error occured while trying to restore your mod loadout.", Color.Salmon, true);
            successBox.richTextBox1.AppendText("Heres the error:\n\n");
            successBox.richTextBox1.CenterText();

            successBox.richTextBox1.AppendText(ex.ToString());
        }
    }
Exemple #28
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;
 }
        //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");
        }