예제 #1
0
        private void btnStockCheck_Click(object sender, EventArgs e)
        {
            string strStorageID = UniversalFunction.GetStorageID(cmbStorage.Text);

            if (txtProductCode.Text.Trim() == "")
            {
                if (cmbStorage.Text.Contains("下线"))
                {
                    dgvStockInfo.DataSource = m_sell.GetInsertingCoilStockInfo(cmbStorage.Text);
                }
                else
                {
                    DataTable dt = m_sell.GetStockProductCodeCountInfo(strStorageID);

                    if (cmbStorage.Text.Contains("售后"))
                    {
                        dt.Columns.Add("已返修");
                        dt.Columns.Add("待返修");

                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            dt.Rows[i]["已返修"] = m_sell.GetProductRepairStatusCount(
                                strStorageID, Convert.ToInt32(dt.Rows[i]["物品ID"]), true);
                            dt.Rows[i]["待返修"] = m_sell.GetProductRepairStatusCount(
                                strStorageID, Convert.ToInt32(dt.Rows[i]["物品ID"]), false);
                        }
                    }

                    dgvStockInfo.DataSource = dt;
                }

                dgvStockInfo.Columns["物品ID"].Visible = false;
            }
            else
            {
                dgvStockInfo.DataSource = m_sell.GetStockProductCodeInfo(cmbStorage.Tag.ToString(),
                                                                         Convert.ToInt32(txtProductCode.Tag), "", txtProductCode.Text, "");
                dgvStockInfo.Columns["产品ID"].Visible = false;
                dgvStockInfo.Columns["库房ID"].Visible = false;
            }

            dgvOperationInfo.DataSource    = null;
            dgvCustomerInfo.DataSource     = null;
            dgvTruckLoadingInfo.DataSource = null;
            dgvERecord.DataSource          = null;

            lbOffLineTestInfo.Text = "";
            lbAuditDate.Text       = "";
            lbTightness.Text       = "";
            lbTightnessDate.Text   = "";
            lbWeigh.Text           = "";
            lbWeighDate.Text       = "";
        }