Beispiel #1
0
        private void lblBanner_DoubleClick(object sender, EventArgs e)
        {
            string passwordCommands = Parameters.PasswordManualCommands;

            if (string.IsNullOrEmpty(passwordCommands))
            {
                MessageBox.Show("No ha sido carga la contraseña, verifique que exista el parámetro\nen la BD o consulte con el administrador",
                                "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            InputBoxDialog ib = new InputBoxDialog();

            ib.FormPrompt   = "Contraseña";
            ib.FormCaption  = "Comandos";
            ib.DefaultValue = string.Empty;
            ib.ModeToShow   = InputBoxDialog.ModeTextBox.Password;
            ib.ShowDialog();

            string s = ib.InputResponse;

            ib.Close();

            if (s.Equals(Parameters.PasswordManualCommands))
            {
                frmManualCommands frm = new frmManualCommands();
                frm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Contraseña incorrecta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public static string InputBox(string prompt, string title, string defaultValue)
 {
     var ib = new InputBoxDialog {FormPrompt = prompt, FormCaption = title, DefaultValue = defaultValue};
     ib.ShowDialog();
     ib.Close();
     return ib.InputResponse;
 }
Beispiel #3
0
 public static string InputBox(string prompt, string title)
 {
     InputBoxDialog ib = new InputBoxDialog(prompt,title);
     ib.ShowDialog();
     string s = ib.InputResponse;
     ib.Close();
     return s;
 }
Beispiel #4
0
 ///// <summary>
 ///// Replacement for VB InputBox, returns user input string.  Requires InputBoxDialog.cs
 ///// </summary>
 ///// <param name="prompt"></param>
 ///// <param name="title"></param>
 ///// <param name="defaultValue"></param>
 ///// <returns></returns>
 public static string InputBox(string prompt, string title, string defaultValue)
 {
     InputBoxDialog ib = new InputBoxDialog();
     ib.FormPrompt = prompt;
     ib.FormCaption = title;
     ib.DefaultValue = defaultValue;
     ib.ShowDialog();
     string s = ib.InputResponse;
     ib.Close();
     return s;
 }
Beispiel #5
0
        private static string InputBox(string texto)
        {
            InputBoxDialog ib = new InputBoxDialog();

            ib.FormPrompt   = texto;
            ib.DefaultValue = "";
            ib.ShowDialog();
            string s = ib.InputResponse;

            ib.Close();
            return(s);
        }
        /// <summary>
        /// Metodo del InputBox
        /// </summary>
        /// <param name="TextoIntroducido">Texto que se introduce en el InputBox</param>
        /// <returns>Devuelve un string</returns>
        private static string InputBox(string TextoIntroducido)
        {
            InputBoxDialog InputBox = new InputBoxDialog();

            InputBox.FormPrompt   = TextoIntroducido;
            InputBox.DefaultValue = "";
            InputBox.ShowDialog();
            string ReturnInput = InputBox.InputResponse;

            InputBox.Close();
            return(ReturnInput);
        }
Beispiel #7
0
        public static string InputBox(string prompt, string title, string defaultValue)
        {
            InputBoxDialog ib = new InputBoxDialog();

            ib.FormPrompt   = prompt;
            ib.FormCaption  = title;
            ib.DefaultValue = defaultValue;
            ib.ShowDialog();
            string s = ib.InputResponse;

            ib.Close();
            return(s);
        }
Beispiel #8
0
        /// <summary>
        /// Verifica la contraseña del perfil para tener acceso a la información
        /// </summary>
        private void AccessProfile(string Profile)
        {
            string pwdProfile = string.Empty;

            if (ucProfileSearch.star1Info.Count > 0)
            {
                if (!(!string.IsNullOrEmpty(Login.ProfileAllAccess) && Login.ProfileAllAccess.Equals("A")))
                {
                    foreach (Star1stLevelInfo line in ucProfileSearch.star1Info)
                    {
                        if (line.Type.Equals(Resources.Profiles.Constants.LINE_TYPE_N) && line.Text.Contains(Resources.Profiles.Constants.PWD_ID))
                        {
                            string[] password = line.Text.Split(new char[] { '*' });
                            pwdProfile = password[1];
                            break;
                        }
                    }
                }

                if (!string.IsNullOrEmpty(pwdProfile))
                {
                    InputBoxDialog ib = new InputBoxDialog();
                    ib.FormPrompt   = Resources.Profiles.Constants.INTRODUCE_PASSWORD;
                    ib.FormCaption  = string.Concat(Resources.Profiles.Constants.MODAL_PWD_TITLE, " ", Profile);
                    ib.DefaultValue = string.Empty;
                    ib.ModeToShow   = InputBoxDialog.ModeTextBox.Password;
                    ib.ShowDialog();

                    string s = ib.InputResponse.ToUpper();
                    ib.Close();

                    if (s.Equals(pwdProfile))
                    {
                        frmProfiles._ucProfileSearch = null;
                        LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_PROFILE_INFO_DISPLAY);
                    }
                    else
                    {
                        MessageBox.Show(Resources.Profiles.Constants.PASSWORD_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    frmProfiles._ucProfileSearch = null;
                    LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_PROFILE_INFO_DISPLAY);
                }
            }
        }
Beispiel #9
0
        private void btnSaveNewConfig_Click(object sender, EventArgs e)
        {
            // no focus
            gbxPadding.Focus();

            // exit modifying
            modifyingPresetConfigurationExit();

            // get name of new configuration
            InputBoxDialog ib = new InputBoxDialog();
                ib.FormPrompt = "Enter preset name";
                ib.FormCaption = "New preset configuration";
                ib.DefaultValue = "";

            // show the dialog
            if (ib.ShowDialog() == DialogResult.OK)
            {
                // close dialog
                ib.Close();

                // create a new output configuration
                OutputConfiguration oc = new OutputConfiguration();

                // load current form to config
                loadFormToOutputConfiguration(ref oc);

                // set display name
                oc.displayName = ib.InputResponse;

                // save new configuration to end of list
                m_outputConfigurationManager.configurationAdd(ref oc);

                // re-populate dropdown
                m_outputConfigurationManager.comboboxPopulate(cbxOutputConfigurations);

                // set selected index
                cbxOutputConfigurations.SelectedIndex = cbxOutputConfigurations.Items.Count - 1;

                // re-save
                m_outputConfigurationManager.saveToFile("OutputConfigs.xml");
            }
        }
Beispiel #10
0
        void UploadFiles()
        {
            FTP ftplib = new FTP();

            try
            {
                // there are server, user and password properties
                // that can be set within the ftplib object as well
                // those properties are actually set when
                // you call the Connect(server, user, pass) function
                String host = Settings.Default.Host;
                ftplib.Connect("ftp." + host,
                               Settings.Default.Username,
                               Settings.Default.Password);

                InputBoxDialog inputBox = new InputBoxDialog();
                inputBox.FormPrompt = "FTP Directory";
                inputBox.FormCaption = "FTP Directory";
                inputBox.DefaultValue = Settings.Default.DefaultDir;
                inputBox.ShowDialog();
                String directory = inputBox.InputResponse;
                inputBox.Close();

                if (directory == "" || directory == null)
                    Application.Exit();


                // Populate clipboard
                String clipboard = "";
                foreach (String filename in resizedPictureFiles)
                {
                    FileInfo fileInfo = new FileInfo(filename);
                    clipboard += "http://" + host + "/" + directory + fileInfo.Name + "\r\n";
                }
                Clipboard.SetDataObject(clipboard, true);

                try
                {
                    ftplib.ChangeDir(directory);
                }
                catch (Exception)
                {
                    // Directory probably didn't exist. Create it.
                    ftplib.MakeDir(directory,true);
                }


                // open the file with resume support if it already exists, the last 
                // peram should be false for no resume
                foreach (String filename in resizedPictureFiles)
                {
                    FileInfo fileInfo = new FileInfo(filename);
                    ftplib.OpenUpload(fileInfo.FullName, fileInfo.Name);
                    while (ftplib.DoUpload() > 0)
                    {
                        //perc = (int)((ftplib.BytesTotal * 100) / ftplib.FileSize);
                        //Console.Write("\rDownloading: {0}/{1} {2}%",
                        //  ftplib.BytesTotal, ftplib.FileSize, perc);
                        //Console.Out.Flush();
                    }
                    //Console.WriteLine("");
                }

                MessageBox.Show("Upload Complete!");

                Application.Exit();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #11
0
        private void mnuUnretire_Click(object sender, System.EventArgs e)
        {
            debugLogger.WriteDebug_3("Begin Method: frmMain.mnuUnretire_Click(object,EventArgs) (" + sender.ToString() + "," + e.ToString() + ")");

            InputBoxDialog input = new InputBoxDialog();
            input.FormPrompt = "Who do you want to unretire? ";
            input.FormCaption = "Unretire Query";
            input.ShowDialog();
            string person = input.InputResponse;
            input.Close();
            TableViewer table = new TableViewer(this,TableViewer.DKPUPDATE,"UPDATE DKS SET DKS.Name = \"" + person + "\",DKS.Comment = \" \" WHERE (((DKS.Name)=\"zzzDKP Retired\" AND (DKS.Comment=\"" + person + "\")))",false);
            StatusMessage = "Performing UPDATE query...";

            debugLogger.WriteDebug_3("End Method: frmMain.mnuUnretire_Click()");
        }
Beispiel #12
0
        private void mnuEnterSQL_Click(object sender, System.EventArgs e)
        {
            debugLogger.WriteDebug_3("Begin Method: frmMain.mnuEnterSQL_Click(object,EventArgs) (" + sender.ToString() + "," + e.ToString() + ")");

            InputBoxDialog input = new InputBoxDialog();
            input.FormPrompt = "Enter Query: ";
            input.FormCaption = "SQL Query";
            input.ShowDialog();
            string query = input.InputResponse;
            input.Close();
            debugLogger.WriteDebug_3("InputBox.InputResponse returns " + query);

            if (query.StartsWith("SELECT"))
            {
                debugLogger.WriteDebug_2("SELECT query entered");

                TableViewer table = new TableViewer(this,TableViewer.DKPSELECT,query,true);
                table.Show();
                StatusMessage = "Performing SELECT query...";
            }
            else if (query.StartsWith("UPDATE")||query.StartsWith("DELETE")||query.StartsWith("INSERT"))
            {
                debugLogger.WriteDebug_2("UPDATE, DELETE, or INSERT query entered");

                TableViewer table = new TableViewer(this,TableViewer.DKPUPDATE,query,false);
                StatusMessage = "Performing UPDATE query...";
            }
            else
            {
                debugLogger.WriteDebug_2("Invalid query entered");

                MessageBox.Show("Invalid SQL Query","Error");
            }

            debugLogger.WriteDebug_3("End Method: frmMain.mnuEnterSQLQuery_Click()");
        }