Example #1
0
        private void biAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //判断什么为填写
            var nullstr = CheckNull();

            if (!string.IsNullOrEmpty(nullstr))
            {
                MessageBox.Show(nullstr + @" 数据异常,请先完成班次制令单后,
再操作此功能", @"错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            using (
                var wpc = new WorkTrackProductLabelCreate(txtcInvCode.Text, utecInvName.Text, txtcOrderNumber.Text,
                                                          dtpdDate.Value.ToShortDateString()))
            {
                if (wpc.ShowDialog() != DialogResult.Yes)
                {
                    return;
                }
                var wf  = new WmsFunction(BaseStructure.WmsCon);
                var cmd = new SqlCommand("proc_GenerateProductLabel")
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
                cmd.Parameters.AddWithValue("@iQuantity", wpc.Quantity);
                cmd.Parameters.AddWithValue("@SerialQty", wpc.SerialQty);
                cmd.Parameters.AddWithValue("@cMemo", wpc.Memo);
                wf.ExecSqlCmd(cmd);
                productLabelTableAdapter.Fill(dataInventory.ProductLabel, lblTitleMain.lblcSerialNumber.Text);
            }
        }
        private void biAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //判断什么为填写
            var nullstr = CheckNull();
            if (!string.IsNullOrEmpty(nullstr))
            {
                MessageBox.Show(nullstr + @" 数据异常,请先完成班次制令单后,
再操作此功能", @"错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            using (
                var wpc = new WorkTrackProductLabelCreate(txtcInvCode.Text, utecInvName.Text, txtcOrderNumber.Text,
                    dtpdDate.Value.ToShortDateString()))
            {
                if (wpc.ShowDialog() != DialogResult.Yes)
                    return;
                var wf=new WmsFunction(BaseStructure.WmsCon);
                var cmd = new SqlCommand("proc_GenerateProductLabel"){CommandType = CommandType.StoredProcedure};
                cmd.Parameters.AddWithValue("@cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
                cmd.Parameters.AddWithValue("@iQuantity", wpc.Quantity);
                cmd.Parameters.AddWithValue("@SerialQty", wpc.SerialQty);
                cmd.Parameters.AddWithValue("@cMemo", wpc.Memo);
                wf.ExecSqlCmd(cmd);
                productLabelTableAdapter.Fill(dataInventory.ProductLabel, lblTitleMain.lblcSerialNumber.Text);}
        }