private void InitItemInfo(string RmesID, string type1) { SNBomTempEntity ent_bom = SNBomTempFactory.GetByKey(RmesID); PlineCode = ent_bom.PLINE_CODE; LocationCode = ent_bom.LOCATION_CODE; PlanCode = ent_bom.PLAN_CODE; ProductSn = ent_bom.SN; txtItemCode.Text = ent_bom.ITEM_CODE; txtProcessCode.Text = ent_bom.PROCESS_CODE; txtVendorCode.Text = VendorCode;// == "" ? ent_bom.VENDOR_CODE : VendorCode; txtItemQty.Text = ent_bom.ITEM_QTY.ToString(); txtCompleteQty.Text = ent_bom.COMPLETE_QTY.ToString(); txtBatchCode.Text = BatchCode;// ent_bom.ITEM_BATCH; string item_type = ent_bom.ITEM_TYPE; Type2 = item_type; if (item_type == "A") { button1.Visible = false; chkKeyItem.Checked = true; LoadItemSn(RmesID); //if (BatchCode != "") lstSn.Items.Add(BatchCode); } else if (item_type == "B") { if (txtItemQty.Text == "1") { button1.Visible = false; } else { button1.Visible = true; } chkKeyItem.Checked = true; LoadItemSn1(RmesID); } else if (item_type == "D") { button1.Visible = false; chkKeyItem.Checked = true; LoadItemSn(RmesID); } }
private void btnOK_Click(object sender, EventArgs e) { if (selCount == 0) { return; } progressBar1.Maximum = selCount + 1; progressBar1.Value = 0; for (int i = 0; i < dgvBom.Rows.Count; i++) { if (dgvBom.Rows[i].Cells["colItemChecked"].EditedFormattedValue.ToString() == "True") { string rmes_id = dgvBom.Rows[i].Cells["colRmesID"].Value.ToString(); string strItemQty = dgvBom.Rows[i].Cells["colItemQty"].Value.ToString(); string item_code = dgvBom.Rows[i].Cells["colItemCode"].Value.ToString(); object obj_vendor_code = dgvBom.Rows[i].Cells["colVendorCode"].Value; object obj_batch_code = dgvBom.Rows[i].Cells["colItemBatch"].Value; float complete_qty = float.Parse(strItemQty); string vendor_code = obj_vendor_code == null ? "" : obj_vendor_code.ToString(); string batch_code = obj_batch_code == null ? "" : obj_batch_code.ToString(); SNBomTempFactory.HandleBomItemComplete(companyCode, rmes_id, item_code, vendor_code, batch_code, complete_qty); LineSideStockFactory.OutOfStorage(item_code, vendor_code, batch_code, LinesideStock, plineCode, complete_qty); progressBar1.Value = progressBar1.Value + 1; } } progressBar1.Value = progressBar1.Maximum; MessageBox.Show("物料消耗数据批处理完成!"); RMESEventArgs thisEventArg = new RMESEventArgs(); thisEventArg.MessageHead = "BOM"; thisEventArg.MessageBody = SN; SendDataChangeMessage(thisEventArg); (Parent as frmBomItemMng).Close(); }
//dataConn dc = new dataConn(); public ctrlProcessNote(string PlanCode, string ProcessCode) { InitializeComponent(); company_code = LoginInfo.CompanyInfo.COMPANY_CODE; pline_code = LoginInfo.ProductLineInfo.PLINE_CODE; stationcode = LoginInfo.StationInfo.STATION_CODE; plan_code = PlanCode; process_code = ProcessCode; string so1 = "", fdjxl1 = ""; try { so1 = dataConn.GetValue("select plan_so from data_plan where plan_code='" + plan_code + "' and rownum=1 "); } catch { } { SNBomTempFactory.ShowBomZJTS(company_code, plan_code, pline_code, stationcode, "", fdjxl1, so1, stationcode); richTextBox1.Text = ""; string sql = "select gwdm,czts,nvl(note_color,''),nvl(note_font,'') from rstbomts where zddm='" + stationcode + "' order by gwdm,czts"; DataTable dt = dataConn.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { try { string note = "*" + dt.Rows[i][1].ToString().Replace((char)13, ' ').Trim(); string notecolor = dt.Rows[i][2].ToString(); richTextBox1.AppendText(note + (char)13 + (char)10); if (notecolor != "") { Color fontColor = System.Drawing.ColorTranslator.FromHtml(notecolor); int p1 = richTextBox1.Text.IndexOf(note); int p2 = note.Length; //richTextBox1.ForeColor = fontColor; richTextBox1.Select(richTextBox1.Text.Length - p2 - 1, p2); richTextBox1.SelectionColor = fontColor; } string notefont = dt.Rows[i][3].ToString(); if (notefont != "") { FontFamily myFontFamily = new FontFamily("微软雅黑"); //采用哪种字体 int font1 = Convert.ToInt32(notefont); Font myFont = new Font(myFontFamily, font1, FontStyle.Regular); //字是那种字体(幼圆),显示的风格(粗体) int p1 = richTextBox1.Text.IndexOf(note); int p2 = note.Length; richTextBox1.Select(richTextBox1.Text.Length - p2 - 1, p2); richTextBox1.SelectionFont = myFont; } //richTextBox1.Text = richTextBox1.Text + note + (char)13 + (char)10; } catch { string note = dt.Rows[i][1].ToString(); richTextBox1.AppendText("*" + note + (char)13 + (char)10); } } } //InitProcessNote(); }