Example #1
0
 private void btnCreateModule_Click(object sender, EventArgs e)
 {
     changed = false;
     tbModuleName.Text.Trim();
     tbModuleName.Text = Program.p.ReplaceMultispaces(tbModuleName.Text);
     if (tbDescription.Text == "Описание модуля")
     {
         tbDescription.Text = "";
     }
     if (tbModuleName.Text== " " || tbModuleName.Text == "" || tbModuleName.Text == "Название модуля")
     {
         MessageBox.Show("Заполнены не все поля");
     }
     else
     {
         if (!error)
         {
             pnlAdded.Visible = true;
             pnlWhite.BringToFront();
             timer1.Enabled = true;
             _currentModuleName = tbModuleName.Text;
             NewModule newModule = new NewModule(tbModuleName.Text, tbDescription.Text, pbImage.RectangleToScreen(pbImage.ClientRectangle));
             pnlWhite.Visible = true;
             pnlWhite.BringToFront();
             Program.p.currentModuleFilename = tbModuleName.Text;
         }
     }
 }
Example #2
0
 private void btnSaveChanges_Click(object sender, EventArgs e)
 {
     changed = false;
     lName.Text.Trim();
     lName.Text = Program.p.ReplaceMultispaces(lName.Text);
     if (lDescription.Text == "Описание модуля")
     {
         lDescription.Text = "";
     }
     if (lName.Text == " " || lName.Text == "" || lName.Text == "Название модуля")
     {
         MessageBox.Show("Заполнены не все поля");
     }
     else
     {
         Program.p.currentModule._filename = lName.Text;
         NewModule newModule = new NewModule(lName.Text, lDescription.Text, pbModule.RectangleToScreen(pbModule.ClientRectangle), oldModuleName);
         oldModuleName = currentModule._filename;
         pnlEdited.Visible = true;
         timer1.Enabled = true;
         btnSaveChanges.Enabled = false;
         btnSaveChanges.BackColor = Color.FromArgb(226, 226, 226);
     }
 }