private void btnPicking_Click(object sender, EventArgs e) { frmPicking frm = new frmPicking(); frm.Width = 750; frm.txtProdOrder.Text = this.txtPrdOrder.Text.Trim(); frm.lblMatName.Text = this.lblMaterial.Text.Trim(); frm.lblLoc.Text = this.lblLocation.Text.Trim(); frm.lblPlant.Text = this.lblPlant.Text.Trim(); frm.lblBOMVer.Text = this.lblBOMVer.Text.Trim(); frm.lblLocCode.Text = this.strLocCode; frm.lblPlantCode.Text = strPlantCode; frm.lblMatCode.Text = strMatCode; frm.lblPrdQty.Text = this.txtQty.Text.Trim(); frm.ShowDialog(); frm.Dispose(); //ToDo 0710 NP_Cls.SqlSelect = "SELECT DISTINCT 1 AS ItemNo, t_PrdOrder.PrdODate, t_PrdOrder.MaterialCode AS HMatCode, t_PrdOrder.MaterialName AS HMatName, t_PrdOrder.PrdQuantity, t_PrdOrder.PlantCode AS HPlantCode, t_PrdOrder.PlantName AS HPlant, t_PrdOrder.BOMVersion, t_PrdOrder.LocCode AS HLocCode,t_PrdOrder.LocName AS HLoc, t_PrdOrderDetail.ComponentCode AS MaterialCode, t_PrdOrderDetail.ComponentName AS MaterialName, t_PrdOrderDetail.PrdOQuantity AS Qty, t_PrdOrderDetail.UnitCode, t_PrdOrderDetail.UnitName, t_PrdOrderDetail.PlantCode, t_PrdOrderDetail.PlantName, t_PrdOrderDetail.LocCode, t_PrdOrderDetail.LocName, t_PrdOrder.Remark, t_PrdOrder.IsPicking FROM t_PrdOrder INNER JOIN t_PrdOrderDetail ON t_PrdOrder.PrdONumber = t_PrdOrderDetail.PrdONumber WHERE (t_PrdOrder.PrdONumber = N'" + this.txtPrdOrder.Text.Trim() + "')"; DataSet dsTmp = new DataSet(); dsTmp = NP.GetClientDataSet(NP_Cls.SqlSelect); this.cbMaterialCode.SelectedIndex = 0; this.cbMaterialCode.SelectedValue = dsTmp.Tables[0].Rows[0]["HMatName"].ToString(); this.lblMaterial.Text = dsTmp.Tables[0].Rows[0]["HMatName"].ToString(); this.txtRemark.Text = dsTmp.Tables[0].Rows[0]["Remark"].ToString(); this.lblLocation.Text = dsTmp.Tables[0].Rows[0]["HLoc"].ToString(); this.lblPlant.Text = dsTmp.Tables[0].Rows[0]["HPlant"].ToString(); this.lblBOMVer.Text = dsTmp.Tables[0].Rows[0]["BOMVersion"].ToString(); this.txtQty.Text = Convert.ToDouble(dsTmp.Tables[0].Rows[0]["PrdQuantity"]).ToString(); this.txtDocDate.Text = Convert.ToDateTime(dsTmp.Tables[0].Rows[0]["PrdODate"]).ToString("dd/MM/yyyy"); this.strLocCode = dsTmp.Tables[0].Rows[0]["HLocCode"].ToString(); this.strMatCode = dsTmp.Tables[0].Rows[0]["HMatCode"].ToString(); this.strPlantCode = dsTmp.Tables[0].Rows[0]["HPlantCode"].ToString(); this.cbMaterialCode.Enabled = false; this.txtQty.Enabled = false; this.txtRemark.Enabled = false; this.btnRunProd.Visible = false; this.btnSave.Visible = false; dsTmp.Tables[0].Columns.Remove("HMatCode"); dsTmp.Tables[0].Columns.Remove("HMatName"); dsTmp.Tables[0].Columns.Remove("Remark"); dsTmp.Tables[0].Columns.Remove("HLoc"); dsTmp.Tables[0].Columns.Remove("HLocCode"); dsTmp.Tables[0].Columns.Remove("BOMVersion"); dsTmp.Tables[0].Columns.Remove("HPlant"); dsTmp.Tables[0].Columns.Remove("HPlantCode"); dsTmp.Tables[0].Columns.Remove("PrdQuantity"); dsTmp.Tables[0].Columns.Remove("PrdODate"); for (byte ii = 0; ii < dsTmp.Tables[0].Rows.Count; ii++) { dsTmp.Tables[0].Rows[ii]["ItemNo"] = Convert.ToInt32(ii + 1); } //ToDo 0510 IsPicking this.btnPicking.Visible = !Convert.ToBoolean(dsTmp.Tables[0].Rows[0]["IsPicking"]); this.lblAl.Visible = Convert.ToBoolean(dsTmp.Tables[0].Rows[0]["IsPicking"]); this.btnUpdate.Visible = !lblAl.Visible; this.btnCancel.Visible = !lblAl.Visible; dsTmp.Tables[0].Columns.Remove("IsPicking"); this.dgvView.DataSource = dsTmp.Tables[0]; }