Ejemplo n.º 1
0
 private void SplitPackagesForm_Shown(object sender, EventArgs e)
 {
     while (!SplashForm.bCreated)
     {
         ;
     }
     FormEvent            = eShow;
     AnimateTimer.Enabled = true;
     EqualCountTextBox.Focus();
 }
Ejemplo n.º 2
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            if (NotEqualOrdersButton.Checked)
            {
                if (!Int32.TryParse(ProductCountTextBox.Text, out SplitStruct.EqualCount) || SplitStruct.TotalCount <= SplitStruct.EqualCount)
                {
                    Infinium.LightMessageBox.Show(ref TopForm, false,
                                                  "Введено неверное значение", "Ошибка");

                    ProductCountTextBox.Clear();
                    ProductCountTextBox.Focus();
                    return;
                }

                SplitStruct.LastCount = SplitStruct.TotalCount - SplitStruct.EqualCount;

                SplitStruct.OrdersCount = 1;
                SplitStruct.IsEqual     = false;
            }

            if (EqualOrdersButton.Checked)
            {
                if (!Int32.TryParse(EqualCountTextBox.Text, out SplitStruct.EqualCount) || SplitStruct.TotalCount <= SplitStruct.EqualCount)
                {
                    Infinium.LightMessageBox.Show(ref TopForm, false,
                                                  "Введено неверное значение", "Ошибка");

                    EqualCountTextBox.Clear();
                    EqualCountTextBox.Focus();
                    return;
                }

                //decimal OrdersCount = Math.Floor(Convert.ToDecimal(SplitStruct.TotalCount) / Convert.ToDecimal(SplitStruct.EqualCount));

                SplitStruct.OrdersCount = SplitStruct.TotalCount / SplitStruct.EqualCount;
                SplitStruct.LastCount   = SplitStruct.TotalCount - SplitStruct.OrdersCount * SplitStruct.EqualCount;

                SplitStruct.IsEqual = true;
            }

            SplitStruct.IsSplit  = true;
            FormEvent            = eClose;
            AnimateTimer.Enabled = true;
        }
Ejemplo n.º 3
0
 private void EqualOrdersButton_Click(object sender, EventArgs e)
 {
     EqualPanel.BringToFront();
     EqualCountTextBox.Focus();
 }