Frm_PalletAdd.xaml.cs 1.87 KB
using HHWCS.Bll;
using HHWCS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace HHWCSHost.View.Pallet
{
    /// <summary>
    /// Frm_PalletAdd.xaml 的交互逻辑
    /// </summary>
    public partial class Frm_PalletAdd : Window
    {
        public Frm_PalletAdd()
        {
            InitializeComponent();
        }

        private void btn_Add_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txt_PalletCode.Text))
            {
                MessageBox.Show("请输入条码");
            }
            else
            {
                var temp = Bll.GetAllContainer(txt_PalletCode.Text, false, false);
                if (temp.Success)
                {
                    MessageBox.Show($"托盘{txt_PalletCode.Text}已存在");
                }
                else
                {
                    var temp2 = Bll.CreateContainer(txt_PalletCode.Text, AppCommon.WarehouseCode, AppCommon.WarehouseId, 1);
                    if (temp2.Success)
                    {
                        MessageBox.Show("创建成功");
                    }
                    else
                    {
                        MessageBox.Show("创建失败");
                    }
                }
            }
        }

        private void btn_BatchAdd_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txt_Begin.Text) || string.IsNullOrEmpty(txt_End.Text) || string.IsNullOrEmpty(txt_Length.Text))
            {

            }
            int begin;
            int end;
            
        }
    }
}