private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (e.ColumnIndex != 14) { return; } string sProcStd = dataGridView1.Rows[e.RowIndex].Cells[13].Value.ToString(); string sql = @"select proc_no, concat(proc_no,'.',proc_name) as proc_name from tb_gi_process where proc_std = '" + sProcStd + "' order by proc_no"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { lbProcList.DataSource = table; lbProcList.ValueMember = "proc_no"; lbProcList.DisplayMember = "proc_name"; } }
private void P1D01_MACHINECARD_Load(object sender, EventArgs e) { txtPath.Text = string.Empty; ListSearch(); this.ActiveControl = tbHo; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'Z' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbGroup.DataSource = table; cbGroup.ValueMember = "co_code"; cbGroup.DisplayMember = "co_item"; } sql = @"select user_name from tb_sys_user where authority <> 'A' and user_flag = 1 order by user_name"; m = new MariaCRUD(); table = m.dbDataTable(sql, ref msg); if (msg == "OK") { foreach (DataRow row in table.Rows) { cbCharge.Items.Add(row[0].ToString()); } } }
//공지사항 private void Notify() { MariaCRUD m = new MariaCRUD(); string sql = @"select subject, contents from tb_sys_notify where noti_flag = 1 order by noti_dt desc limit 1"; string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg != "OK") { return; } DataRow[] row = table.Select(); if (row.Length > 0) { string curDT = string.Empty; if (ReadRegistry(ref curDT)) { if (curDT == DateTime.Today.ToString("yyyy-MM-dd")) { return; } } FormNotify sub = new FormNotify(); sub.lblSubject.Text = row[0][0].ToString(); sub.tbContents.Text = row[0][1].ToString(); sub.ShowDialog(); } }
private void P1C04_MATERIAL_USE_Load(object sender, EventArgs e) { dtpFromDate.Value = Convert.ToDateTime(DateTime.Today.ToString("yyyy-MM-01")); string sql = @"select t.co_code, t.co_item from (select '%' as co_code, '<전체>' as co_item union select co_code, co_item from tb_gi_common where co_kind = 'B') as t order by t.co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } // sql = @"select t.co_code, t.co_item from (select '%' as co_code, '<전체>' as co_item union select co_code, co_item from tb_gi_common where co_kind = 'C') as t order by t.co_code"; m = new MariaCRUD(); msg = string.Empty; table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbKind.DataSource = table; cbKind.ValueMember = "co_code"; cbKind.DisplayMember = "co_item"; } }
private void P1C04_MATERIAL_USE_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]") { this.ActiveControl = lblProd; } else { rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; useID = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString(); dtpDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString()); tbProd.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString(); tbProd.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString(); tbQty.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString(); cbDepot.SelectedValue = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString(); this.ActiveControl = btnSave; } }
private void P1C03_PROD_DONE_NG_Load(object sender, EventArgs e) { lblMsg.Text = ""; //불량항목 string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'L' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { lbNgList.DataSource = table; lbNgList.ValueMember = "co_code"; lbNgList.DisplayMember = "co_item"; } if (parentWin.tbNgQty.Tag == null || string.IsNullOrEmpty(parentWin.tbNgQty.Tag.ToString())) { return; } lbNgList.SelectedValue = parentWin.tbNgQty.Tag.ToString(); if (!string.IsNullOrEmpty(parentWin.tbNgQty.Text)) { tbQty.Text = parentWin.tbNgQty.Text; } }
private void PosSearch(string pos) { lblMsg.Text = ""; MariaCRUD m = new MariaCRUD(); string sql = @"select com_name, ceo, homepage, busi_no, bubin_no, uptae, jongmog, post_no, address1, address2, tel, fax, SEC_TO_TIME(job_starttime) " + "from tb_sys_pos where pos = '" + pos + "'"; string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg != "OK") { return; } DataRow[] row = table.Select(); if (row.Length > 0) { tbName.Text = row[0][0].ToString(); tbCeo.Text = row[0][1].ToString(); tbHomePage.Text = row[0][2].ToString(); tbBusiNo.Text = row[0][3].ToString(); tbBubinNo.Text = row[0][4].ToString(); tbUpTae.Text = row[0][5].ToString(); tbJongMong.Text = row[0][6].ToString(); tbPostNo.Text = row[0][7].ToString(); tbAddr1.Text = row[0][8].ToString(); tbAddr2.Text = row[0][9].ToString(); tbTel.Text = row[0][10].ToString(); tbFax.Text = row[0][11].ToString(); mtbJobStartTime.Text = row[0][12].ToString().Substring(0, 5); } }
private void P1C02_PROD_RESULT_NG_Load(object sender, EventArgs e) { lblMsg.Text = ""; //불량항목 string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'L' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { lbNgList.DataSource = table; lbNgList.ValueMember = "co_code"; lbNgList.DisplayMember = "co_item"; } TextBox tbNgQty = parentWin.Controls.Find("tbNgQty" + sGroup, true).FirstOrDefault() as TextBox; if (tbNgQty.Tag == null || string.IsNullOrEmpty(tbNgQty.Tag.ToString())) { return; } lbNgList.SelectedValue = tbNgQty.Tag.ToString(); if (!string.IsNullOrEmpty(tbNgQty.Text)) { tbQty.Text = tbNgQty.Text; } }
protected void ufConnection() { lblMsg.Text = ""; string empPwd = tbPWD.Text.Trim(); if (String.IsNullOrEmpty(empPwd)) { lblMsg.Text = "패스워드를 입력하세요."; tbPWD.Focus(); return; } G.UserID = cbID.SelectedValue.ToString(); string sql = @"select po.pos, po.com_name, po.pos_name, us.user_name, us.pwd, us.authority " + "from tb_sys_user us inner join tb_sys_pos po on us.pos = po.pos " + "where us.user_id = '" + G.UserID + "'"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg != "OK") { MessageBox.Show(msg); return; } DataRow[] row = table.Select(); string strPwd; if (row.Length > 0) { strPwd = row[0][4].ToString(); if (new MyClass().EncryptSHA512(empPwd) != strPwd) { lblMsg.Text = "패스워드가 정확하지 않습니다."; tbPWD.Focus(); return; } G.Pos = row[0][0].ToString(); G.ComName = row[0][1].ToString(); G.PosName = row[0][2].ToString(); G.UserName = row[0][3].ToString(); G.Authority = row[0][5].ToString(); WriteRegistry(G.UserID); m.TransLogCreate(G.Authority, G.UserID, "I", "FormLogin", "Login", "로그인"); this.DialogResult = DialogResult.OK; } }
private void P1A04_PROCESS_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'D' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbKind.DataSource = table; cbKind.ValueMember = "co_code"; cbKind.DisplayMember = "co_item"; } cbKind.SelectedIndex = parentWin.cbStd.SelectedIndex; if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]") { cbGroup.Text = "A.CNC"; this.ActiveControl = tbName; } else { rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; procStd = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString(); procNo = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString(); tbNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString(); tbName.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString(); tbTool.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString(); string sTime = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString(); if (!string.IsNullOrEmpty(sTime)) { tbTime.Text = float.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString()).ToString("0.0"); } cbGroup.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString(); string sFinal = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString(); if (sFinal == "O") { ckFinalFlag.Checked = true; } cbKind.Enabled = false; tbNo.Enabled = false; this.ActiveControl = tbName; } }
private void FormLogin_Load(object sender, EventArgs e) { //if (!IsRunningAsAdministrator()) //{ // ProcessStartInfo processStartInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().CodeBase); // { // var withBlock = processStartInfo; // withBlock.UseShellExecute = true; // withBlock.Verb = "runas"; // Process.Start(processStartInfo); // Application.Exit(); // } //} // timer1.Start(); lblMsg.Text = ""; string sql = @"select com_name from tb_sys_pos where pos = 'A'"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; string com = m.dbRonlyOne(sql, ref msg).ToString(); if (msg == "OK") { lblCompany.Text = com; } else { lblCompany.Text = ""; } sql = @"select user_id, concat(user_name, if(authority='B',' (관리자)','')) as user_name from tb_sys_user where user_flag = 1 order by authority, user_id"; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbID.DataSource = table; cbID.ValueMember = "user_id"; cbID.DisplayMember = "user_name"; } string ID = string.Empty; if (ReadRegistry(ref ID)) { cbID.SelectedValue = ID; } }
private void P1ED03_QC_AS_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; string sql = @"select user_id, user_name from tb_sys_user where authority in ('B','C') and user_flag = 1 order by user_name"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbCharge.DataSource = table; cbCharge.ValueMember = "user_id"; cbCharge.DisplayMember = "user_name"; } if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]") { cbState.SelectedIndex = 1; //처리중 cbCharge.SelectedValue = G.UserID; this.ActiveControl = lblDeliID; } else { try { rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; tbNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString(); cbState.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[12].Value.ToString(); tbDeli.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[13].Value.ToString(); tbQty.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString(); dtpClaimDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString()); tbClaimContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString(); dtpActionDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString()); tbActionContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[8].Value.ToString(); tbMoney.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[9].Value.ToString(); cbCharge.SelectedValue = parentWin.dataGridView1.Rows[rowIndex].Cells[10].Value.ToString(); this.ActiveControl = btnSave; } catch (FormatException) { return; } } }
private void P1A01_CUSTOMER_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; string sql = @"select saleman from tb_gi_customer where use_flag = 'O' group by saleman order by saleman"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbSaleMan.DataSource = table; cbSaleMan.ValueMember = "saleman"; cbSaleMan.DisplayMember = "saleman"; } if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]") { this.ActiveControl = tbCustName; cbGubun.SelectedIndex = 0; } else { rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; custCode = parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString(); tbCustName.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString(); tbCeo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString(); cbGubun.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString(); tbBusiNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString(); cbSaleMan.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[20].Value.ToString(); tbPostNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[11].Value.ToString(); tbAddr1.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[12].Value.ToString(); tbAddr2.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[13].Value.ToString(); tbTel.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[15].Value.ToString(); tbFax.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[16].Value.ToString(); tbCustMan.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[17].Value.ToString(); tbHp.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[18].Value.ToString(); tbContents.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[21].Value.ToString(); if (parentWin.dataGridView1.Rows[rowIndex].Cells[22].Value.ToString() == "X") { cbFlag.Checked = true; } this.ActiveControl = btnSave; } }
private void P1A04_PROCESS_Load(object sender, EventArgs e) { string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'D' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbStd.DataSource = table; cbStd.ValueMember = "co_code"; cbStd.DisplayMember = "co_item"; cbStd.SelectedIndex = 0; } this.ActiveControl = cbStd; }
private void P1A05_STOCK_MOVE_Load(object sender, EventArgs e) { dtpFromDate.Value = Convert.ToDateTime(DateTime.Today.ToString("yyyy-01-01")); string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } cbGubun.SelectedIndex = 0; }
private void P1B13_STOCK_TABLE_MOVE_Load(object sender, EventArgs e) { lblMsg.Text = ""; rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } sql = @"select co_code, co_item from tb_gi_common where co_kind = 'E' order by co_code"; m = new MariaCRUD(); table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbKind.DataSource = table; cbKind.ValueMember = "co_code"; cbKind.DisplayMember = "co_item"; } dtpDate.Value = parentWin.dtpToDate.Value; if (parentWin.cbDepot.SelectedValue.ToString() == "%") { cbDepot.SelectedIndex = 0; } else { cbDepot.SelectedValue = parentWin.cbDepot.SelectedValue; } tbProd.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString(); tbProd.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString(); cbKind.SelectedValue = "0003"; this.ActiveControl = tbQty; }
private void P1A04_PDCLOSE_Load(object sender, EventArgs e) { udY.Value = DateTime.Today.Year - 1; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } //cbDepot.SelectedIndex = 0; cbGubun.SelectedIndex = 0; //ListSearch(); }
private void P1C01_PROD_ORDER_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; tbJobNo.Text = getCode(); cbPart.SelectedIndex = 0; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'D' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbProcStd.DataSource = table; cbProcStd.ValueMember = "co_code"; cbProcStd.DisplayMember = "co_item"; } ListSearch(); this.ActiveControl = tbSearch; }
private void P1A04_PDCLOSE_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } udY.Value = parentWin.udY.Value; cbDepot.SelectedIndex = parentWin.cbDepot.SelectedIndex; if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]") { this.ActiveControl = lblProd; } else { rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; tbProd.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString(); tbProd.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString(); tbQty.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString(); udY.Enabled = false; cbDepot.Enabled = false; lblProd.Enabled = false; lblProd.Font = new Font(lblProd.Font, FontStyle.Regular); this.ActiveControl = btnSave; } }
private void P1C03_PROD_DONE_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; //운전자 string sql = @"select user_id, user_name from tb_sys_user where user_flag = 1 and authority = 'C' order by authority, user_id"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbUser.DataSource = table; cbUser.ValueMember = "user_id"; cbUser.DisplayMember = "user_name"; } // rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; tbJobNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString(); tbMachine.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString(); tbMachine.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString(); cbUser.SelectedValue = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString(); tbProd.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[9].Value.ToString(); tbName.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[10].Value.ToString(); tbSize.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[11].Value.ToString(); tbGdQty.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[12].Value.ToString(); tbNgQty.Text = Int32.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[13].Value.ToString()).ToString("#,##0"); tbSumQty.Text = Int32.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[14].Value.ToString()).ToString("#,##0"); tbNgQty.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[15].Value.ToString(); lblProc.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[26].Value.ToString(); lblProc.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[27].Value.ToString(); dtpDate1.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[17].Value.ToString()); dtpDate2.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[18].Value.ToString()); this.ActiveControl = btnSave; }
private void P1ED01_QC_FINAL_Load(object sender, EventArgs e) { dtpFromDate.Value = DateTime.Today.AddDays(-15); string sql = @"select t.user_id, t.user_name from( select '-' as user_id, '-' as user_name union select user_id, user_name from tb_sys_user where authority in ('B','C') and user_flag = 1) as t order by t.user_name"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbQcMan.DataSource = table; cbQcMan.ValueMember = "user_id"; cbQcMan.DisplayMember = "user_name"; } }
private void P1C09_PROD_NG_Load(object sender, EventArgs e) { dtpFromDate.Value = Convert.ToDateTime(DateTime.Today.ToString("yyyy-MM-01")); string sql = @"select t.co_code, t.co_item from( select '%' as co_code, '<전체>' as co_item union select co_code, co_item from tb_gi_common where co_kind = 'L') as t order by t.co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbItem.DataSource = table; cbItem.ValueMember = "co_code"; cbItem.DisplayMember = "co_item"; } cbGrp.SelectedIndex = 0; }
private void P1C02_PROD_RESULT_FINISH_Load(object sender, EventArgs e) { lblMsg.Text = ""; //제품창고 string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } rowIndex = parentWin.dataGridViewY.CurrentCell.RowIndex; jobNo = parentWin.dataGridViewY.Rows[rowIndex].Cells[0].Value.ToString(); procNo = parentWin.dataGridViewY.Rows[rowIndex].Cells[1].Value.ToString(); tbJobNo.Text = jobNo; dtpDate.Value = DateTime.Parse(parentWin.dataGridViewY.Rows[rowIndex].Cells[14].Value.ToString()); tbQty.Text = parentWin.dataGridViewY.Rows[rowIndex].Cells[15].Value.ToString(); if (parentWin.dataGridViewY.Rows[rowIndex].Cells[17].Value.ToString() == "O") { btnOk.Enabled = false; this.ActiveControl = btnCancel; } else { btnCancel.Enabled = false; this.ActiveControl = btnOk; } }
private void P1C02_PROD_RESULT_IDLE_Load(object sender, EventArgs e) { lblMsg.Text = ""; //비가동항목 string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'F' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { lbIdleList.DataSource = table; lbIdleList.ValueMember = "co_code"; lbIdleList.DisplayMember = "co_item"; } DataGridView gridIdle = parentWin.Controls.Find("gridIdle" + sGroup, true).FirstOrDefault() as DataGridView; if (gridIdle.RowCount == 0) { return; } int iRow = gridIdle.RowCount - 1; if (gridIdle.Rows[iRow].Cells[5].Value == null || string.IsNullOrEmpty(gridIdle.Rows[iRow].Cells[5].Value.ToString())) { lbIdleList.SelectedValue = gridIdle.Rows[iRow].Cells[6].Value.ToString(); lbIdleList.Enabled = false; btnStart.Enabled = false; btnFinish.Enabled = true; seq = gridIdle.Rows[iRow].Cells[3].Value.ToString(); } }
private void P1C02_PROD_RESULT_Load(object sender, EventArgs e) { //작업조 cbPart.SelectedIndex = 0; //설비명 string sql = @"select machine_id, machine_name from tb_machinecard order by machine_no"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbFacilityA.DataSource = table; cbFacilityA.ValueMember = "machine_id"; cbFacilityA.DisplayMember = "machine_name"; cbFacilityB.DataSource = table; cbFacilityB.ValueMember = "machine_id"; cbFacilityB.DisplayMember = "machine_name"; cbFacilityC.DataSource = table; cbFacilityC.ValueMember = "machine_id"; cbFacilityC.DisplayMember = "machine_name"; cbFacilityD.DataSource = table; cbFacilityD.ValueMember = "machine_id"; cbFacilityD.DisplayMember = "machine_name"; cbFacilityE.DataSource = table; cbFacilityE.ValueMember = "machine_id"; cbFacilityE.DisplayMember = "machine_name"; } //운전자 sql = @"select user_id, user_name from tb_sys_user where user_flag = 1 and authority = 'C' order by authority, user_id"; m = new MariaCRUD(); msg = string.Empty; table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbUserA.DataSource = table; cbUserA.ValueMember = "user_id"; cbUserA.DisplayMember = "user_name"; cbUserB.DataSource = table; cbUserB.ValueMember = "user_id"; cbUserB.DisplayMember = "user_name"; cbUserC.DataSource = table; cbUserC.ValueMember = "user_id"; cbUserC.DisplayMember = "user_name"; cbUserD.DataSource = table; cbUserD.ValueMember = "user_id"; cbUserD.DisplayMember = "user_name"; cbUserE.DataSource = table; cbUserE.ValueMember = "user_id"; cbUserE.DisplayMember = "user_name"; } cbUserA.SelectedValue = G.UserID; ////제품창고 //sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; //m = new MariaCRUD(); //msg = string.Empty; //table = m.dbDataTable(sql, ref msg); //if (msg == "OK") //{ // cbDepotA.DataSource = table; // cbDepotA.ValueMember = "co_code"; // cbDepotA.DisplayMember = "co_item"; // cbDepotB.DataSource = table; // cbDepotB.ValueMember = "co_code"; // cbDepotB.DisplayMember = "co_item"; // cbDepotC.DataSource = table; // cbDepotC.ValueMember = "co_code"; // cbDepotC.DisplayMember = "co_item"; // cbDepotD.DataSource = table; // cbDepotD.ValueMember = "co_code"; // cbDepotD.DisplayMember = "co_item"; // cbDepotE.DataSource = table; // cbDepotE.ValueMember = "co_code"; // cbDepotE.DisplayMember = "co_item"; //} }
private void P1A02_PRODUCT_SUB_Load(object sender, EventArgs e) { lblMsg.Text = ""; if (gubun == "A") { cbGubun.Text = "A.정품"; } else if (gubun == "B") { cbGubun.Text = "B.부품"; } else if (gubun == "C") { cbGubun.Text = "C.반제품"; } else if (gubun == "D") { cbGubun.Text = "D.세트"; } else { cbGubun.Text = "Z.기타"; } string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'C' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbKind.DataSource = table; cbKind.ValueMember = "co_code"; cbKind.DisplayMember = "co_item"; } if (lblTitle.Text.Substring(lblTitle.Text.Length - 4, 4) == "[추가]") { cbKind.SelectedIndex = 0; this.ActiveControl = tbProdName; } else { rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; prodCode = parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString(); cbKind.SelectedValue = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value; tbProdName.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString(); tbSize.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString(); tbUnit.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[6].Value.ToString(); tbUnitSub.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString(); if (parentWin.dataGridView1.Rows[rowIndex].Cells[8].Value.ToString() == "0") { ckbStockFlag.Checked = true; } if (parentWin.dataGridView1.Rows[rowIndex].Cells[10].Value.ToString() == "X") { ckbUseFlag.Checked = true; } cbGubun.Enabled = false; this.ActiveControl = btnSave; } }
private void P1B10_PURCHASE_MAT_IN_Load(object sender, EventArgs e) { lblMsg.Text = ""; string sql = @"select co_code, co_item from tb_gi_common where co_kind = 'B' order by co_code"; MariaCRUD m = new MariaCRUD(); string msg = string.Empty; DataTable table = m.dbDataTable(sql, ref msg); if (msg == "OK") { cbDepot.DataSource = table; cbDepot.ValueMember = "co_code"; cbDepot.DisplayMember = "co_item"; } rowIndex = parentWin.dataGridView1.CurrentCell.RowIndex; tbNo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[0].Value.ToString(); tbCust.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[2].Value.ToString(); tbCust.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[3].Value.ToString(); tbRorderCust.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[12].Value.ToString(); tbRorderCust.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[13].Value.ToString(); dtpPutchDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[1].Value.ToString()); dtpRequestDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[11].Value.ToString()); tbProd.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[4].Value.ToString(); tbProd.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[5].Value.ToString(); tbSize.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[7].Value.ToString(); tbQty.Text = long.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[8].Value.ToString()).ToString("#,##0"); tbDanga.Text = long.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[9].Value.ToString()).ToString("#,##0"); lblTitle.Tag = parentWin.dataGridView1.Rows[rowIndex].Cells[15].Value.ToString(); tbBigo.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[23].Value.ToString(); if (parentWin.dataGridView1.Rows[rowIndex].Cells[25].Value.ToString() == "1") { lblAsap.Visible = true; } // if (lblTitle.Tag.ToString() == "0") { long lQty = long.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[8].Value.ToString()); long lDanga = long.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[9].Value.ToString()); tbInQty.Text = lQty.ToString(); tbAmount.Text = (lQty * lDanga).ToString(); tbVat.Text = (lQty * lDanga * 0.1).ToString(); tbMoney.Text = ((lQty * lDanga) + (lQty * lDanga * 0.1)).ToString("#,##0"); lblDel.Visible = false; } else { dtpInDate.Value = DateTime.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[16].Value.ToString()); tbInQty.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[17].Value.ToString(); tbAmount.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[18].Value.ToString(); tbVat.Text = parentWin.dataGridView1.Rows[rowIndex].Cells[19].Value.ToString(); cbDepot.SelectedValue = parentWin.dataGridView1.Rows[rowIndex].Cells[21].Value; long lAmount = long.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[18].Value.ToString()); long lVat = long.Parse(parentWin.dataGridView1.Rows[rowIndex].Cells[19].Value.ToString()); tbMoney.Text = (lAmount + lVat).ToString("#,##0"); } this.ActiveControl = btnSave; }