예제 #1
0
        private void btnSet_Click(object sender, EventArgs e)
        {
            if (!ValidControlCargo())
            {
                return;
            }
            this.cargo = new MyClass.Cargo();
            GetControlCargo(this.cargo);

            bool result = this.cargo.Select();

            if (result)
            {
                MessageBox.Show("该货仓已经设置");
            }
            else
            {
                bool temp = this.cargo.Insert();
                if (temp)
                {
                    MessageBox.Show("设置成功");
                    SetControlCargo(this.cargo);
                }
                else
                {
                    MessageBox.Show("设置失败");
                }
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //实例化Register类与Cargo类
            regs  = new MyClass.Register();
            cargo = new MyClass.Cargo();

            regs.TagID = cmbCardID.Text.Trim();

            //获取登记商品的通道号
            int value = MyClass.Register.TabSelect(cmbCardID.Text.Trim());

            txtSeat.Text   = value.ToString();
            cargo.Tab_Name = Convert.ToInt32(txtSeat.Text.Trim());

            int result = MyClass.Register.StatusSelect(cmbCardID.Text.Trim());

            //MessageBox.Show(result.ToString());
            if (result == 0)
            {
                int num = cargo.GetGoodsCount();
                //传递一个状态值为 1,入库时间为当前时间,出库时间为空。
                bool Temp = regs.Update(1, DateTime.Now);

                if (Temp)
                {
                    num++;
                    cargo.Update(num);
                    MessageBox.Show("入库成功");
                    //设置通道号和设置LED屏状态显示
                    MyClass.ClassAll.Antenna(txtSeat.Text.Trim(), false);
                }
                else
                {
                    MessageBox.Show("入库失败");
                }
            }
            else if (result == 1)
            {
                MessageBox.Show("该商品已经入库");
            }
            else
            {
                MessageBox.Show("该商品已经出库了,无法再入库");
            }
        }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Thread.Sleep(100);

            regs       = new MyClass.Register();
            cargo      = new MyClass.Cargo();
            regs.TagID = cmbCardID.Text.Trim();

            //将商品所在入库的通道号的值显示在控件中
            int value = MyClass.Register.TabSelect(cmbCardID.Text.Trim());

            txtSeat.Text   = value.ToString();
            cargo.Tab_Name = Convert.ToInt32(txtSeat.Text.Trim());

            int result = MyClass.Register.StatusSelect(cmbCardID.Text.Trim());

            if (result == 1)
            {
                int num = cargo.GetGoodsCount();
                //传递一个状态值为 1,入库时间为当前时间,出库时间为空。
                bool Temp = regs.Update(2, DateTime.Now);

                if (Temp)
                {
                    num--;
                    cargo.Update(num);
                    MessageBox.Show("出库成功");

                    MyClass.ClassAll.Antenna(txtSeat.Text.Trim(), false);
                }
                else
                {
                    MessageBox.Show("出库失败");
                }
            }
            else if (result == 0)
            {
                MessageBox.Show("该商品未入库,请先入库");
            }
            else
            {
                MessageBox.Show("该商品已经出库");
            }
        }
예제 #4
0
        private void btnRevise_Click(object sender, EventArgs e)
        {
            if (!ValidControlCargo())
            {
                return;
            }
            this.cargo = new MyClass.Cargo();
            GetControlCargo(this.cargo);
            bool Temp = this.cargo.Update();

            if (Temp)
            {
                MessageBox.Show("修改成功");
            }
            else
            {
                MessageBox.Show("修改失败");
            }
        }
예제 #5
0
        public UCWarehouse(MyClass.Cargo cargo)
        {
            InitializeComponent();
            this.cargo = cargo;

            this.groupBox1.Text = "货仓:" + this.cargo.Tab_Name.ToString();


            List <MyClass.Register> list = MyClass.Register.GetObjectList(this.cargo);

            this.label1.Text = list.Count.ToString();

            foreach (MyClass.Register reg in list)
            {
                ListViewItem item = new ListViewItem();
                item.Text = reg.TagID;
                item.Tag  = reg;
                item.SubItems.Add(reg.Name);

                this.listView1.Items.Add(item);
            }
        }
예제 #6
0
 private void GetControlCargo(MyClass.Cargo cargo)
 {
     cargo.Tab_Name = Convert.ToInt32(this.cmbCargo.Text.Trim());
     cargo.Max      = Convert.ToInt32(this.txtMax.Text.Trim());
     cargo.Min      = Convert.ToInt32(this.txtMin.Text.Trim());
 }
예제 #7
0
 private void SetControlCargo(MyClass.Cargo cargo)
 {
     this.cmbCargo.Text = cargo.Tab_Name.ToString();
     this.txtMax.Text   = cargo.Max.ToString();
     this.txtMin.Text   = cargo.Min.ToString();
 }