public Config()
        {
            if (ReadFile(ConfigFilePath))
            {
                try
                {
                    string[] settingsDefaultString = MostUsed.ReadFile(ConfigFilePath).Split('\n');
                    this.QuestionNumber = Convert.ToInt32(settingsDefaultString[0].Split(':')[1]);
                    this.Remembered     = Convert.ToBoolean(settingsDefaultString[1].Split(':')[1]);

                    if (this.Remembered)
                    {
                        this.DefaultUserName = Cipher.CesarDecifrar(settingsDefaultString[2].Split(':')[1].TrimEnd(), 5);
                        this.DefaultPassword = Cipher.CesarDecifrar(settingsDefaultString[3].Split(':')[1].TrimEnd(), 5);
                    }
                    else
                    {
                        this.DefaultUserName = "";
                        this.DefaultPassword = "";
                    }
                }
                catch (Exception)
                {
                    string defaultValues = "QuestionNumber:10\nRemembered:false\nDefaultUserName: \nDefaultPassword: ";
                    MostUsed.WriteFile(this.ConfigFilePath, defaultValues);
                    string[] settingsDefaultString = MostUsed.ReadFile(ConfigFilePath).Split('\n');
                    this.QuestionNumber  = Convert.ToInt32(settingsDefaultString[0].Split(':')[1]);
                    this.Remembered      = Convert.ToBoolean(settingsDefaultString[1].Split(':')[1]);
                    this.DefaultUserName = Cipher.CesarDecifrar(settingsDefaultString[2].Split(':')[1].TrimEnd(), 5);
                    this.DefaultPassword = Cipher.CesarDecifrar(settingsDefaultString[3].Split(':')[1].TrimEnd(), 5);
                }
            }
        }
Example #2
0
 public void ButtonInterrupt_Click(object sender, EventArgs e)
 {
     MostUsed.OpenFormInPanel(FatherForm, FatherForm.FatherForm.pnl_FormContainer);
     FatherForm.Questionaire     = null;
     FatherForm.NextQuestionArea = null;
     this.Dispose();
     this.Close();
 }
        public void SaveCurrentData()
        {
            string valuesToSave = "QuestionNumber:" + this.QuestionNumber +
                                  "\nRemembered:" + this.Remembered.ToString() +
                                  "\nDefaultUserName:"******"\nDefaultPassword:" + Cipher.CesarCifrar(this.DefaultPassword, 5);

            MostUsed.WriteFile(this.ConfigFilePath, valuesToSave);
        }
 public void OpenFileUrl()
 {
     try
     {
         string finalUrl = DOCUMENTS_FOLDER_PATH + "/" + Url;
         MostUsed.ExecuteShellUrl(finalUrl);
     }
     catch (Exception)
     {
         //throw;
     }
 }
 public void OpenFileUrl()
 {
     try
     {
         string finalUrl = VideosFolderPath + "/" + Url;
         MostUsed.ExecuteShellUrl(finalUrl);
     }
     catch (Exception)
     {
         //throw;
     }
 }
 private void Btn_Start_Click(object sender, EventArgs e)
 {
     try
     {
         int value             = Convert.ToInt32(TextMaxNumber.Text);
         int CuestionMaxNumber = Convert.ToInt32(TextMaxNumber.Text);
         Questionaire     = new DatabaseClass.Questionaire(FatherForm.CURRENT_USER, CuestionMaxNumber);
         NextQuestionArea = new QuestionsMain(this);
         MostUsed.OpenFormInPanel(NextQuestionArea, FatherForm.pnl_FormContainer);
     }
     catch (Exception)
     {
     }
 }
 private static bool ReadFile(string Path)
 {
     if (File.Exists(Path))
     {
         return(true);
     }
     else
     {
         try
         {
             File.Create(Path);
             string defaultValues = "QuestionNumber:10\nRemembered:false\nDefaultUserName: \nDefaultPassword: ";
             MostUsed.WriteFile(Path, defaultValues);
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }
 private void Btn_usersList_Click(object sender, EventArgs e)
 {
     MostUsed.OpenFormInPanel(userListForm, this.fatherForm.pnl_FormContainer);
 }
Example #9
0
        private void Verify()
        {
            var QuestionNumber = CurrentQuestionaire.Preguntas.Count;

            if (buttonVerify.Text == "Verificar")
            {
                int CorrectNumber    = CurrentQuestionaire.Preguntas[index].CorrectQuestionNumber;
                int SelectedBoxIndex = GetSelectedCheck();

                GetCorrectCheck().TextColor = Color.FromArgb(185, 238, 119);
                GetCorrectCheck(SelectedBoxIndex).TextColor = Color.FromArgb(234, 139, 132);

                if (SelectedBoxIndex == CorrectNumber)
                {
                    GetCorrectCheck(SelectedBoxIndex).TextColor = Color.FromArgb(152, 195, 109);
                    correct++;
                }

                if (index + 1 == QuestionNumber)
                {
                    NextQuestion();
                }

                //buttonVerify.Text = "Siguiente";
                if ((index + 2) <= QuestionNumber)
                {
                    buttonVerify.Text = "Siguiente";
                }
                else
                {
                    buttonVerify.Text = "Finalizar";
                }
            }
            else if (buttonVerify.Text == "Siguiente")
            {
                if ((index + 1) <= QuestionNumber)
                {
                    buttonVerify.Text = "Verificar";
                    NextQuestion();
                }

                if (index + 1 == QuestionNumber)
                {
                    buttonVerify.Text = "Verificar";
                    PrepareAll();
                }
            }
            else
            {
                try
                {
                    CurrentQuestionaire.Insert();
                    FinishForm = new QuestionFinish(this);
                    MostUsed.OpenFormInPanel(FinishForm, FatherForm.FatherForm.pnl_FormContainer);
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }
Example #10
0
 private void Btn_Back_Click(object sender, EventArgs e)
 {
     MostUsed.OpenFormInPanel(FatherForm, FatherForm.fatherForm.pnl_FormContainer);
 }
        private void ButtonRanking_Click(object sender, EventArgs e)
        {
            fatherForm.RANKING_FORM.StartReading();

            MostUsed.OpenFormInPanel(fatherForm.RANKING_FORM, fatherForm.pnl_FormContainer);
        }
 private void Btn_books_Click(object sender, EventArgs e)
 {
     MostUsed.OpenFormInPanel(fatherForm.VIDEOS_VIEW, this.formsHolder);
 }
 private void ButtonGithub_Click(object sender, EventArgs e)
 {
     MostUsed.ExecuteShellUrl(Properties.Resources.GitHubLink);
 }
 private void IconButton1_Click(object sender, EventArgs e)
 {
     MostUsed.OpenFormInPanel(questionsListForm, this.fatherForm.pnl_FormContainer);
 }
Example #15
0
 private void Label1_Click(object sender, EventArgs e)
 {
     MostUsed.ExecuteShellUrl(Documento.GetFullUrl());
 }
 private void Btn_Documents_Click(object sender, EventArgs e)
 {
     MostUsed.OpenFormInPanel(documentListForm, this.fatherForm.pnl_FormContainer);
 }
Example #17
0
 private void PictureBox1_Click(object sender, EventArgs e)
 {
     MostUsed.ExecuteShellUrl(CurrentVideo.getFullUrl());
 }