Exemplo n.º 1
0
        /// <summary>
        /// 更新标签状态
        /// </summary>
        private void UpdateBarcode2(string strBarcode)
        {
            string         strSql     = "update Mes_Barcode set B_Status = '1' where B_Barcode = '" + strBarcode + "'";
            Mes_BarcodeBLL BarcodeBLL = new Mes_BarcodeBLL();

            BarcodeBLL.Update(strSql);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 删除原卡信息
        /// </summary>
        /// <param name="strGoodsCode"></param>
        /// <returns></returns>
        private void DeleteData(string strBarcode)
        {
            Mes_BarcodeBLL BarcodeBLL = new Mes_BarcodeBLL();
            //string strSql = "Update Mes_Barcode set B_Remark = '已经分写' where B_Barcode = '"+ strBarcode +"'";

            string strSql = "delete from Mes_Barcode where B_Barcode = '" + strBarcode + "'";

            BarcodeBLL.Update(strSql);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 保存标签条码
        /// </summary>
        /// <param name="B_Barcode"></param>
        /// <param name="B_Code"></param>
        /// <param name="B_Name"></param>
        /// <param name="B_Qty"></param>
        /// <param name="B_WorkShopCode"></param>
        private void SaveBarcode(string B_Barcode, string B_Code, string B_Name, decimal B_Qty, string B_WorkShopCode)
        {
            Mes_BarcodeEntity BarcodeEntity = new Mes_BarcodeEntity();
            Mes_BarcodeBLL    BarcodeBLL    = new Mes_BarcodeBLL();

            BarcodeEntity.B_Barcode      = B_Barcode;
            BarcodeEntity.B_Code         = B_Code;
            BarcodeEntity.B_Name         = B_Name;
            BarcodeEntity.B_Qty          = B_Qty;
            BarcodeEntity.B_WorkShopCode = B_WorkShopCode;
            BarcodeEntity.B_Ptime        = DateTime.Now;
            BarcodeEntity.B_Status       = 1;
            BarcodeBLL.SaveEntity("", BarcodeEntity);
        }
Exemplo n.º 4
0
        private void Search()
        {
            string         strSql     = "select * from Mes_Barcode where B_WorkShopCode = '" + txtCode.Text + "' and B_Status = '1' order by B_Code";
            Mes_BarcodeBLL BarcodeBLL = new Mes_BarcodeBLL();
            var            row        = BarcodeBLL.GetList_Mes_Barcode(strSql);

            int nLen = row.Count;

            this.listView1.Items.Clear();
            this.listView1.BeginUpdate();
            for (int i = 0; i < nLen; i++)
            {
                ListViewItem lvi = new ListViewItem(row[i].B_Code);
                lvi.SubItems.Add(row[i].B_Name);
                lvi.SubItems.Add(row[i].B_Qty.ToString());

                this.listView1.Items.Add(lvi);
            }

            this.listView1.EndUpdate();
        }
Exemplo n.º 5
0
 /// <summary>
 /// 删除ESL标签条码
 /// </summary>
 /// <param name="strId"></param>
 /// <returns></returns>
 private bool DeleteBarcode(string strBarcode)
 {
     try
     {
         string         strSql     = "delete from Mes_Barcode where B_Barcode = '" + strBarcode + "'";
         Mes_BarcodeBLL BarcodeBLL = new Mes_BarcodeBLL();
         int            nRow       = BarcodeBLL.Update(strSql);
         if (nRow > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 保存标签条码
        /// </summary>
        /// <param name="B_Barcode"></param>
        /// <param name="B_Code"></param>
        /// <param name="B_Name"></param>
        /// <param name="B_Qty"></param>
        /// <param name="B_WorkShopCode"></param>
        private void SaveBarcode(string B_Barcode, string B_Code, string B_Name, decimal B_Qty, string B_WorkShopCode)
        {
            Mes_BarcodeEntity BarcodeEntity = new Mes_BarcodeEntity();
            Mes_BarcodeBLL    BarcodeBLL    = new Mes_BarcodeBLL();

            BarcodeEntity.B_Barcode      = B_Barcode;
            BarcodeEntity.B_Code         = B_Code;
            BarcodeEntity.B_Name         = B_Name;
            BarcodeEntity.B_Qty          = B_Qty;
            BarcodeEntity.B_WorkShopCode = B_WorkShopCode;
            DateTime dt = DateTime.Now;

            BarcodeEntity.B_Ptime  = dt;
            BarcodeEntity.B_Itime  = dt;
            BarcodeEntity.B_Otime  = dt;
            BarcodeEntity.B_Utime  = dt;
            BarcodeEntity.B_Remark = "由" + txtQty.Text + "分写而来";

            BarcodeEntity.B_Status = 1;
            BarcodeBLL.SaveEntity("", BarcodeEntity);
        }
Exemplo n.º 7
0
        private void txtBarcode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyValue == 13)
                {
                    string strBarcode = txtBarcode.Text;
                    if (strBarcode.IndexOf('*') > 0)
                    {
                        string[] strTemp = strBarcode.Split('*');
                        txtCode.Text = strTemp[0].ToString();
                        txtPc.Text   = strTemp[1].ToString();
                        txtQty.Text  = strTemp[2].ToString();


                        MesGoodsBLL GoodsBLL   = new MesGoodsBLL();
                        var         Goods_rows = GoodsBLL.GetListCondit("where G_Code = '" + txtCode.Text + "'");
                        int         nLen       = Goods_rows.Count;
                        if (nLen > 0)
                        {
                            txtName.Text  = Goods_rows[0].G_Name;
                            txtPrice.Text = Goods_rows[0].G_Price.ToString();
                            strUnit       = Goods_rows[0].G_Unit.ToString();
                        }
                    }
                    else
                    {
                        string[] strTemp = strBarcode.Split(',');


                        //MessageBox.Show(strTemp.Length.ToString());
                        txtCode.Text = Resolve(strTemp[0].ToString());
                        txtPc.Text   = Resolve(strTemp[1].ToString());
                        txtQty.Text  = Resolve(strTemp[2].ToString());
                        m_strBarcode = strTemp[4].ToString();
                        Mes_BarcodeBLL BarcodeBLL   = new Mes_BarcodeBLL();
                        var            Barcode_rows = BarcodeBLL.GetList_Mes_Barcode("select * from Mes_Barcode where B_Status = 1 and B_Barcode = '" + m_strBarcode + "'");
                        if (Barcode_rows.Count > 0)
                        {
                        }
                        else
                        {
                            MessageBox.Show("此标签已经入库, 或者状态不对");
                            txtBarcode.Text = "";
                            txtBarcode.Focus();
                            txtBarcode.SelectAll();
                            return;
                        }

                        MesGoodsBLL GoodsBLL   = new MesGoodsBLL();
                        var         Goods_rows = GoodsBLL.GetListCondit("where G_Code = '" + txtCode.Text + "'");
                        int         nLen       = Goods_rows.Count;
                        if (nLen > 0)
                        {
                            txtName.Text  = Goods_rows[0].G_Name;
                            strUnit       = Goods_rows[0].G_Unit;
                            txtPrice.Text = Goods_rows[0].G_Price.ToString();
                        }
                    }

                    Save();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }