Beispiel #1
0
        public static DialogResult ShowMsgBox(string string_9, string string_10, string string_11, params string[] msgParams)
        {
            DialogResult result2;

            try
            {
                string         messageBody = "";
                MessageManager manager     = new MessageManager(string_9);
                DialogResult   oK          = DialogResult.OK;
                if (manager.MessageBody != null)
                {
                    messageBody = manager.MessageBody;
                    if ((msgParams != null) && (msgParams.Length > 0))
                    {
                        for (int i = 0; i < msgParams.Length; i++)
                        {
                            messageBody = messageBody.Replace("{" + i.ToString() + "}", msgParams[i]);
                        }
                    }
                }
                if (string.Empty.Equals(messageBody))
                {
                    messageBody = string_9;
                }
                if (((!(manager.string_3 == "CC") && !(manager.string_3 == "CI")) && (!(manager.string_3 == "CE") && !(manager.string_3 == "CQ"))) && !(manager.string_3 == "CW"))
                {
                    oK = new SysMessageBox(((string_10 == null) || (string_10 == "")) ? manager.string_4 : string_10, messageBody, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                else
                {
                    oK = new CusMessageBox(((string_10 == null) || (string_10 == "")) ? manager.string_4 : string_10, DateTime.Now.ToString(), ((string_11 == null) || (string_11 == "")) ? manager.string_5 : string_11, manager.string_1, messageBody, manager.string_6, manager.string_7, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                result2 = oK;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result2);
        }
Beispiel #2
0
        public static DialogResult ShowMsgBox(string string_9)
        {
            //return MessageBox.Show(string_9, "发生异常", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            DialogResult result2;

            try
            {
                string         messageBody = "";
                MessageManager manager     = new MessageManager(string_9);
                DialogResult   oK          = DialogResult.OK;
                if (manager.MessageBody != null)
                {
                    messageBody = manager.MessageBody;
                }
                if (string.Empty.Equals(messageBody))
                {
                    messageBody = string_9;
                }
                if (((!(manager.string_3 == "CC") && !(manager.string_3 == "CI")) && (!(manager.string_3 == "CE") && !(manager.string_3 == "CQ"))) && !(manager.string_3 == "CW"))
                {
                    oK = new SysMessageBox(manager.string_4, messageBody, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                else
                {
                    oK = new CusMessageBox(manager.string_4, DateTime.Now.ToString(), manager.string_5, manager.string_1, messageBody, manager.string_6, manager.string_7, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                result2 = oK;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result2);
        }
Beispiel #3
0
        public static DialogResult ShowMsgBox(string string_9, List <KeyValuePair <string, string> > attrsCollection, string[] string_10, string[] string_11)
        {
            DialogResult result2;

            try
            {
                string         messageBody = "";
                string         solution    = "";
                MessageManager manager     = new MessageManager(string_9);
                DialogResult   oK          = DialogResult.OK;
                if ((attrsCollection != null) && (attrsCollection.Count > 0))
                {
                    foreach (KeyValuePair <string, string> pair in attrsCollection)
                    {
                        if (pair.Key.Equals("type"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_3 = pair.Value;
                            }
                        }
                        else if (pair.Key.Equals("value"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_2 = pair.Value;
                            }
                        }
                        else if (pair.Key.Equals("title"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_4 = pair.Value;
                            }
                        }
                        else if (pair.Key.Equals("operate"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_5 = pair.Value;
                            }
                        }
                        else if ((pair.Key.Equals("solution") && (pair.Value != null)) && (pair.Value != ""))
                        {
                            manager.string_6 = pair.Value;
                        }
                    }
                }
                if (manager.MessageBody != null)
                {
                    messageBody = manager.MessageBody;
                    if ((string_10 != null) && (string_10.Length > 0))
                    {
                        for (int i = 0; i < string_10.Length; i++)
                        {
                            messageBody = messageBody.Replace("{" + i.ToString() + "}", string_10[i]);
                        }
                    }
                }
                if (manager.Solution != null)
                {
                    solution = manager.Solution;
                    if ((string_11 != null) && (string_11.Length > 0))
                    {
                        for (int j = 0; j < string_11.Length; j++)
                        {
                            solution = solution.Replace("{" + j.ToString() + "}", string_11[j]);
                        }
                    }
                }
                if (string.Empty.Equals(messageBody))
                {
                    messageBody = string_9;
                }
                if (((!(manager.string_3 == "CC") && !(manager.string_3 == "CI")) && (!(manager.string_3 == "CE") && !(manager.string_3 == "CQ"))) && !(manager.string_3 == "CW"))
                {
                    oK = new SysMessageBox(manager.string_4, messageBody, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                else
                {
                    oK = new CusMessageBox(manager.string_4, DateTime.Now.ToString(), manager.string_5, manager.string_1, messageBody, solution, manager.string_7, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                result2 = oK;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result2);
        }