Пример #1
0
        private void CrearPallet()
        {
            if (txtCodigo.Text == "")
            {
                MessageBox.Show("Debe Ingresar Código De Pallet", "Creación De Pallet", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                return;
            }
            else if (txtPeso.Text == "" || !(txtPeso.Text.IsNumeric()))
            {
                MessageBox.Show("Peso No Válido", "Creación De Pallet", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                return;
            }

            var pallet = new Pallet
            {
                Codigo     = txtCodigo.Text,
                FechaCarga = DateTime.Now,
                Peso       = decimal.Parse(txtPeso.Text)
            };

            PalletBusiness.Insert(pallet);
        }