Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                string strSql = "select * from Mes_WorkShopWeight where W_Remark = '" + m_strBarcode + "'";
                Mes_WorkShopWeightBLL    WorkShopWeightBLL    = new Mes_WorkShopWeightBLL();
                Mes_WorkShopWeightEntity WorkShopWeightEntity = new Mes_WorkShopWeightEntity();
                DataSet ds = new DataSet();
                ds = WorkShopWeightBLL.GetList_WorkShop(strSql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string  strOrderNo   = ds.Tables[0].Rows[0]["W_OrderNo"].ToString();
                    string  strGoodsCode = ds.Tables[0].Rows[0]["W_SecGoodsCode"].ToString();
                    string  strBatch     = ds.Tables[0].Rows[0]["W_SecBatch"].ToString();
                    string  strQty       = ds.Tables[0].Rows[0]["W_SecQty"].ToString();
                    decimal d            = Convert.ToDecimal(strQty);
                    strQty = d.ToString("0.####");
                    //string strPrice = dataGridView2.Rows[dataGridView1.SelectedCells[0].RowIndex].Cells["价格2"].Value.ToString();
                    string strGoodsName = ds.Tables[0].Rows[0]["W_SecGoodsName"].ToString();
                    string strBarcode   = ds.Tables[0].Rows[0]["W_Remark"].ToString();
                    //string strDate = dataGridView1.Rows[dataGridView1.SelectedCells[0].RowIndex].Cells["W_Price"].Value.ToString();

                    if (MessageBox.Show("物料是否要补写?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                    {
                        try
                        {
                            this.Enabled   = false;
                            Cursor.Current = Cursors.WaitCursor;

                            GetImg("物料" + strGoodsCode + "批次" + strBatch + "单号" + Globels.strOrderNo, strGoodsName, strQty, strBZQ, strBarcode);
                            //DeleteData(strId);
                            //SaveBarcode(strBarcode, strGoodsCode, strGoodsName, Convert.ToDecimal(strQty), strWorkShop);
                            this.Enabled   = true;
                            Cursor.Current = Cursors.Default;
                        }
                        catch (Exception ex)
                        {
                            this.Enabled   = true;
                            Cursor.Current = Cursors.Default;
                        }
                    }
                }
                else
                {
                    MessageBox.Show("不好意思,您还没有打印过任何标签");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                //lblTS.Text = "系统提示:请选中某一行进行补写";
            }
        }
Beispiel #2
0
        private void frmOrgres_Load(object sender, EventArgs e)
        {
            MesProductOrderHeadBLL ProductOrderHeadBLL = new MesProductOrderHeadBLL();
            var row_ProductOrder = ProductOrderHeadBLL.GetListAll();

            for (int i = 0; i < row_ProductOrder.Count; i++)
            {
                //cmb  .Items.Add(row_ProductOrder[i].W_Code);
                comOrderNo.Items.Add(row_ProductOrder[i].P_OrderNo);
            }

            MesWorkShopBLL WorkShopBLL = new MesWorkShopBLL();
            var            rows        = WorkShopBLL.GetList();

            for (int i = 0; i < rows.Count; i++)
            {
                cmbWorkShop.Items.Add(rows[i].W_Code);
                cmbWorkShopName.Items.Add(rows[i].W_Name);
            }

            if (cmbWorkShop.Items.Contains(Globels.strWorkShop))
            {
                cmbWorkShop.Text = Globels.strWorkShop;
            }

            MesRecordBLL RecordBLL   = new MesRecordBLL();
            var          Record_rows = RecordBLL.GetList();

            for (int i = 0; i < Record_rows.Count; i++)
            {
                cmbRecord.Items.Add(Record_rows[i].R_Record);
                cmbRecordName.Items.Add(Record_rows[i].R_Name);
            }


            Mes_ProceBLL ProceBLL = new Mes_ProceBLL();
            var          row      = ProceBLL.GetList_Proce(" where 1 = 1 ");

            for (int i = 0; i < row.Count; i++)
            {
                cmbProce.Items.Add(row[i].P_ProNo);
                cmbProceName.Items.Add(row[i].P_ProName);
            }
            if (cmbProce.Items.Contains(Globels.strProce))
            {
                cmbProce.Text = Globels.strProce;
            }



            Mes_TeamBLL TeamBLL   = new Mes_TeamBLL();
            var         Team_rows = TeamBLL.GetList_Team(" where 1 = 1 ");

            for (int i = 0; i < Team_rows.Count; i++)
            {
                cmbTeam.Items.Add(Team_rows[i].T_Code);
                cmbTeamName.Items.Add(Team_rows[i].T_Name);
            }
            if (cmbTeam.Items.Contains(Globels.strTeam))
            {
                cmbTeam.Text = Globels.strTeam;
            }

            string strSql = "Select distinct W_SecGoodsName from Mes_WorkShopWeight where W_WorkShopCode = '" + cmbWorkShop.Text + "'";
            Mes_WorkShopWeightBLL WorkShopWeightBL = new Mes_WorkShopWeightBLL();
            DataSet ds   = WorkShopWeightBL.GetList_WorkShop(strSql);
            int     nLen = ds.Tables[0].Rows.Count;

            comboBox1.Items.Clear();
            comboBox1.Items.Add("");
            for (int i = 0; i < nLen; i++)
            {
                comboBox1.Items.Add(ds.Tables[0].Rows[i]["W_SecGoodsName"].ToString());
            }
            Search();
        }