Esempio n. 1
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     //if (MessageBox.Show(this, "Close current Workspace and create a new one?", "Are You Sure?", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         InputMessageForm inputMessageForm = new InputMessageForm();
         if (inputMessageForm.ShowDialog() == DialogResult.OK)
         {
             if (string.IsNullOrEmpty(inputMessageForm.textBox1.Text))
             {
                 return;
             }
             MainEngine.Instance.SaveWarkSpace();
             if (inputMessageForm.checkBox1.Checked == false)
             {
                 MainEngine.Instance.RemoveSourcePathes();
                 MainEngine.Instance.CreateWorkspace(inputMessageForm.textBox1.Text);
             }
             else
             {
                 MainEngine.Instance.CloneWorkspace(inputMessageForm.textBox1.Text);
             }
             if (inputMessageForm.checkBox2.Checked == true)
             {
                 MainEngine.Instance.CloseAllDocuments();
             }
             MainEngine.Instance.SaveWarkSpace();
             _workspaceListPanel.SetWorkspaceList();
             MainEngine.Instance.SetMainFormCaption();
         }
     }
 }
Esempio n. 2
0
 private void tfGross_KeyDown(object sender, KeyEventArgs e)
 {
     if (toDecimal(tfWeight.EditValue) > 0)
     {
         InputMessageForm imf = new InputMessageForm("Informe o Valor Bruto 'R$'", TruckSystem.UI.Utils.InputMessageForm.FormatValue.Decimal);
         if (imf.ShowDialog() == DialogResult.OK)
         {
             if (toDecimal(imf.Value) > 0)
             {
                 decimal gross  = toDecimal(imf.Value);
                 decimal weight = toDecimal(tfWeight.EditValue);
                 decimal ton    = toDecimal(gross / weight);
                 tfValueTon.EditValue = ton;
                 ((freight)bdgFreight.Current).value_ton = ton;
             }
         }
     }
 }