/// <summary> /// 选中行删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { if (gridView1.RowCount == 0 || lstDeleteInfo.Count == 0) { return; } DialogResult result = MessageBox.Show("确定删除吗吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { foreach (object obj in lstDeleteInfo) { for (int i = 0; i < gridView1.RowCount; i++) { object val = gridView1.GetRowCellValue(i, gridView1.Columns["创建时间"]); if (val.ToString().Equals(obj.ToString())) { gridView1.DeleteRow(i); break; } } } } gridView1.Columns["材料"].SummaryItem.SummaryType = SummaryItemType.Count; gridView1.Columns["材料"].SummaryItem.DisplayFormat = "选中: 0"; SecuGlobal.showOK(panelStatus, lblStatus, "OK"); }
/// <summary> /// 申请单删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { try { SecuGlobal.showOK(panelStatus, lblStatus, "正在删除申请单数据,请稍等..."); if (gridView2.RowCount <= 0) { SecuGlobal.showNG(panelStatus, lblStatus, "没有申请单信息"); return; } DialogResult dr = MessageBox.Show("确认删除吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { if (bReqDocDelete()) { SecuGlobal.showOK(panelStatus, lblStatus, "OK"); } } } catch (Exception btnDelete_Click) { SecuGlobal.showNG(panelStatus, lblStatus, btnDelete_Click.Message); } }
private void MeterialGi_Load(object sender, EventArgs e) { SecuGlobal.setDate(dateEditFrom, dateEditTo); if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C660A")) { cbPlant.Text = "SSDP"; } else { cbPlant.Text = "SESC"; } plantInsert = cbPlant.Text; string bufVend = SecuGlobal.getPopVendorInfo(PaCSGlobal.LoginUserInfo.Venderid, PaCSGlobal.LoginUserInfo.Fct_code); if (!bufVend.Equals("")) { cbVendor.Text = bufVend; } else { cbVendor.Text = PaCSGlobal.LoginUserInfo.Venderid + ":" + PaCSGlobal.LoginUserInfo.Vendername; //苏州法人 } if (!bGetInfo(bufVend.Substring(0, 4))) { SecuGlobal.showNG(panelStatus, lblStatus, "材料信息/line 信息获取失败"); return; } SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); }
/// <summary> /// 记载基本信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SecuStockCheck_Load(object sender, EventArgs e) { SecuGlobal.setAllVendorInfo(PaCSGlobal.LoginUserInfo.Fct_code, cbVendor); dateEditFrom.Text = PaCSTools.PaCSGlobal.GetServerDateTime(3); dateEditTo.Text = PaCSTools.PaCSGlobal.GetServerDateTime(3); SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); }
/// <summary> /// 加载材料编号,日期,厂家CODE /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SecuReport_Load(object sender, EventArgs e) { SecuGlobal.setAllVendorInfo(PaCSGlobal.LoginUserInfo.Fct_code, cbVendor); SecuGlobal.getMeterialCode(cbMeterial); xtraTabControl1_Click(sender, e); SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); }
private void cbAssyAdd_SelectedIndexChanged(object sender, EventArgs e) { if (cbAssyAdd.SelectedIndex != -1) { SecuGlobal.showOK(panelStatus, lblStatus, "材料选择发生变化,请确认后扫描数据"); } }
/// <summary> /// 查询库存信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cbMeterial_SelectedIndexChanged(object sender, EventArgs e) { try { if (cbMeterial.SelectedIndex != -1) { meterialCode = cbMeterial.Properties.Items[cbMeterial.SelectedIndex].ToString(); } else { SecuGlobal.showNG(panelStatus, lblStatus, "请选择材料信息"); return; } DataTable dt = OracleHelper.ExecuteDataTable(getSql(ls_company, ls_plant, meterialCode)); //ls_company ('BP3A') ls_plant('SSDP') if (dt != null) { foreach (DataRow dr in dt.Rows) { barcode = dr["barcode_flag"].ToString(); assyDesc = dr["description"].ToString(); txtRemain.Text = dr["stock_qty"].ToString(); remain = txtRemain.Text.Trim(); } } SecuGlobal.showOK(panelStatus, lblStatus, "材料选择改变,请确认信息" + meterialCode); } catch (Exception error) { SecuGlobal.showNG(panelStatus, lblStatus, error.Message); } }
/// <summary> /// 成卷/ONE 选择 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void rdType_SelectedIndexChanged(object sender, EventArgs e) { secuType = ""; tbQty.Text = ""; if (rdType.SelectedIndex == 0) { secuType = "SAMSUNG"; if (rdInput.SelectedIndex == 1) { tbQty.Text = "2500"; } else { tbQty.Text = "1"; } } else if (rdType.SelectedIndex == 1) { secuType = "XEROX"; if (rdInput.SelectedIndex == 1) { tbQty.Text = "10000"; } else { tbQty.Text = "1"; } } else { SecuGlobal.showNG(panelStatus, lblStatus, "获取类型异常错误"); } SecuGlobal.showOK(panelStatus, lblStatus, "Ready ! 当前类型:" + secuType + "投入类型:" + inputType); }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { this.Invoke((MethodInvoker) delegate { btnSave.Enabled = false; string doc_seq = OracleHelper.ExecuteScalar("select 'SECU'||to_char(sysdate,'yyyymmdd')||" + "fn_gene_seq('SECU','REQ',to_char(sysdate,'yyyymmdd'),'N','N','N',4) doc_seq from dual").ToString(); //申请单号 //需要保存HEADER 信息 OracleHelper.ExecuteNonQuery(getSql2(doc_seq)); for (int i = 0; i < gridView1.RowCount; i++) { object valAssy = gridView1.GetRowCellValue(i, gridView1.Columns["材料"]); object valReq = gridView1.GetRowCellValue(i, gridView1.Columns["申请数量"]); OracleHelper.ExecuteNonQuery(getSql1(doc_seq, (i + 1).ToString(), valAssy.ToString(), valReq.ToString(), "0", "Y")); } SecuGlobal.showOK(panelStatus, lblStatus, "材料申请OK,申请单号:" + doc_seq); btnSave.Enabled = true; bFirstAdd = true; }); } catch (Exception err) { SecuGlobal.showOK(panelStatus, lblStatus, err.Message); } }
/// <summary> /// 申请单入库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGr_Click(object sender, EventArgs e) { try { SecuGlobal.showOK(panelStatus, lblStatus, "正在进行入库,请稍等..."); bRun = true; btnGr.Enabled = false; if (gridView2.RowCount == 0 || grCount.Equals(0)) { SecuGlobal.showNG(panelStatus, lblStatus, "请选择申请单信息"); return; } DialogResult dlg = MessageBox.Show("您确认要进行入库:" + doc_no + "?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dlg == DialogResult.OK) { int iCount = 0; for (int i = 0; i < gridView2.RowCount; i++) { for (int j = 0; j < gridView2.Columns.Count; j++) { if ((bool)gridView2.GetRowCellValue(i, gridView2.Columns[0])) { iCount += 1; break; } } } if (iCount == 0) { SecuGlobal.showNG(panelStatus, lblStatus, "请选中要入库的信息"); return; } if (!bgrDataUpload()) //失败 { return; } doc_no = ""; btnQuery_Click(sender, e); } SecuGlobal.showOK(panelStatus, lblStatus, "OK"); } catch (Exception btnGr_Click) { SecuGlobal.showNG(panelStatus, lblStatus, btnGr_Click.Message); } finally { bRun = false; btnGr.Enabled = true; } }
private void btnExport_Click(object sender, EventArgs e) { if (grdView1.RowCount <= 0) { SecuGlobal.showNG(panelStatus, lblStatus, "没有数据,请先查询!"); } SecuGlobal.showOK(panelStatus, lblStatus, "数据导出中,请稍等..."); PaCSGlobal.ExportGridToFile(grdView1, "Security Invoice Info"); SecuGlobal.showOK(panelStatus, lblStatus, "OK"); }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { string dtFrom = dateEditFrom.Text.Trim().Replace("-", ""); string dtTo = dateEditTo.Text.Trim().Replace("-", ""); StringBuilder sql = new StringBuilder(" select FCT_CODE as \"Fct Code\" , " + " sec_boxno as \"Sec Boxno\" , sec_itemcd as \"Sec Itemcd\", sec_rollfrom as \"Sec Rollfrom\", " + " sec_rollto as \"Sec Rollto\", sec_start as \"Sec Start\", sec_end as \"Sec end\", " + " sec_cnt as \"Sec cnt\", delivery_date as \"Delivery Date\", invoice_no as \"Invoice No\", " + " add_date as \"Add Date\", add_time as \"Add Time\", add_user as \"Add User\", " + " add_ip as \"Add Ip\", " + " case when " + " (select count(*) from " + SecuGlobal.tbSecurityInTest + " b where b.fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' and b.roll_no between a.sec_rollfrom and a.sec_rollto) >= 1 then " + " 'Y' " + " else " + " 'N' " + " end 是否入库 " + " from " + SecuGlobal.tbSecurityInvoice + " a " + " where 1 = 1 and a.fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "'"); if (!string.IsNullOrEmpty(dtFrom) && !string.IsNullOrEmpty(dtTo)) { sql.Append(" and add_date between '" + dtFrom + "' and '" + dtTo + "' "); } if (!string.IsNullOrEmpty(tbBoxNo.Text)) { sql.Append(" and sec_boxno = '" + tbBoxNo.Text.Trim() + "'"); } if (!string.IsNullOrEmpty(tbRollNo.Text)) { sql.Append(" and '" + tbRollNo.Text.Trim() + "' between sec_rollfrom and sec_rollto"); } if (!string.IsNullOrEmpty(tbSecuLabel.Text)) { sql.Append(" and sec_start = '" + tbSecuLabel.Text.Trim() + "'"); } sql.Append(" order by sec_boxno "); DataTable dt = OracleHelper.ExecuteDataTable(sql.ToString()); this.Invoke((MethodInvoker) delegate { gridControl1.DataSource = dt; grdView1.BestFitColumns(); grdView1.Columns["Sec Itemcd"].SummaryItem.SummaryType = SummaryItemType.Count; grdView1.Columns["Sec Itemcd"].SummaryItem.DisplayFormat = "共 {0:f0} 条记录"; SecuGlobal.showOK(panelStatus, lblStatus, "OK"); }); }
/// <summary> /// 加载Vendor信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void StockQuery_Load(object sender, EventArgs e) { setDicVendor(PaCSGlobal.LoginUserInfo.Fct_code); if (dicVendor.Count <= 0) { SecuGlobal.showNG(panelStatus, lblStatus, "没有找到VENDOR 信息,请联系管理员"); return; } SecuGlobal.setAllVendorInfo(PaCSGlobal.LoginUserInfo.Fct_code, cbVendor); SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); }
private void ckClipBorad_CheckedChanged(object sender, EventArgs e) { btnSave.Enabled = false; SecuGlobal.GridViewInitial(grdView1, gridControl1); if (ckClipBorad.Checked) { SecuGlobal.showOK(panelStatus, lblStatus, "剪贴板方式:打开EXCEL-复制要上载的数据<标题栏除外>,然后点击批量上载"); } else { SecuGlobal.showOK(panelStatus, lblStatus, "Excel方式"); } }
/// <summary> /// 查询类型获取《汇总:SUMMARY / 详细:DETAIL》 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void radioGroup2_SelectedIndexChanged(object sender, EventArgs e) { if (radioGroup2.SelectedIndex == 0) { queryType = "SUMMARY"; SecuGlobal.showOK(panelStatus, lblStatus, "汇总查询"); } else { queryType = "DETAIL"; SecuGlobal.showOK(panelStatus, lblStatus, "明细查询"); } }
/// <summary> /// 数据查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnApply_Click(object sender, EventArgs e) { try { SecuGlobal.showOK(panelStatus, lblStatus, "正在查询数据,请稍等..."); backgroundWorker1.RunWorkerAsync(); SplashScreenManager.ShowForm(typeof(WaitLoading)); } catch (Exception ex) { SecuGlobal.showNG(panelStatus, lblStatus, ex.Message); } }
/// <summary> /// 后台查询数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { getVariable(); DataTable dt = OracleHelper.ExecuteDataTable(getSql(company, ls_material_code, ls_plant)); if (dt != null) { dt.Columns["plant"].ColumnName = "厂家"; dt.Columns["material_code"].ColumnName = "材料"; dt.Columns["description"].ColumnName = "材料描述"; dt.Columns["stock_qty"].ColumnName = "厂家库存"; dt.Columns["trans_qty"].ColumnName = "厂家转移库存"; } string vendorDesc = ""; foreach (DataRow dr in dt.Rows) { dicVendor.TryGetValue(dr["COMPANY"].ToString(), out vendorDesc); dr["COMPANY"] = vendorDesc; } this.Invoke((MethodInvoker) delegate { gridControl1.DataSource = dt; grdView1.BestFitColumns(); grdView1.Columns["材料"].SummaryItem.SummaryType = SummaryItemType.Count; grdView1.Columns["材料"].SummaryItem.DisplayFormat = "All:{0:f0}"; grdView1.Columns["厂家库存"].SummaryItem.SummaryType = SummaryItemType.Sum; grdView1.Columns["厂家库存"].SummaryItem.DisplayFormat = "{0:f0}"; grdView1.Columns["厂家转移库存"].SummaryItem.SummaryType = SummaryItemType.Sum; grdView1.Columns["厂家转移库存"].SummaryItem.DisplayFormat = "{0:f0}"; //指定列对齐方式 grdView1.Columns["材料描述"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdView1.Columns["厂家库存"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdView1.Columns["厂家转移库存"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; SecuGlobal.showOK(panelStatus, lblStatus, "OK"); }); } catch (Exception err) { //XtraMessageBox.Show(this, "System error[ShowData]: " + err.Message); SecuGlobal.showNG(panelStatus, lblStatus, err.Message); } }
private void btnOpenFile_Click(object sender, EventArgs e) { try { if (ckClipBorad.Checked) //从剪切板获取数据 - 某些EXCEL 格式异常,采用此方式进行 { if (!bGetDataClipboradAndAnalysis()) { return; } else { btnSave.Enabled = true; // 遍历上传的数据,如果都可用,则Save Enabled = TRUE SecuGlobal.showOK(panelStatus, lblStatus, "数据读取和分析OK ,请按保存按钮上传数据..."); return; } } SecuGlobal.showOK(panelStatus, lblStatus, "文件打开中,请稍等..."); SecuGlobal.GridViewInitial(grdView1, gridControl1); OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Excel文件(*.xls;*.xlsx)|*.xls;*.xlsx"; //过滤文件类型 fd.InitialDirectory = Application.StartupPath + "\\Temp\\"; fd.ShowReadOnly = true; DialogResult r = fd.ShowDialog(); if (r == DialogResult.OK) { excelFileName = fd.FileName; excelFirstTable = GetExcelFirstTableName(excelFileName); DataTable dt = dtImportExcel(excelFileName, excelFirstTable); gridControl1.DataSource = dt; if (!bAnalysisUploadData(dt)) { return; } btnSave.Enabled = true; // 遍历上传的数据,如果都可用,则Save Enabled = TRUE SecuGlobal.showOK(panelStatus, lblStatus, "数据读取和分析OK ,请按保存按钮上传数据..."); } } catch (Exception btnOpenFile_Click) { SecuGlobal.showNG(panelStatus, lblStatus, btnOpenFile_Click.Message); } }
/// <summary> /// 选中对应申请单之后,数据显示到控件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void selection_SelectionChanged(object sender, EventArgs e) { iCount = 0; for (int i = 0; i < gridView1.RowCount; i++) { if ((bool)gridView1.GetRowCellValue(i, gridView1.Columns[0])) { type = gridView1.GetRowCellValue(i, gridView1.Columns["移库类型"]).ToString(); string assy = gridView1.GetRowCellValue(i, gridView1.Columns["材料"]).ToString(); cbMaterial.Text = assy; tbDesc.Text = gridView1.GetRowCellValue(i, gridView1.Columns["材料描述"]).ToString(); barCode = gridView1.GetRowCellValue(i, gridView1.Columns["条形码"]).ToString(); string sql = "select nvl(sum(STOCK_QTY),0) stock_qty from " + SecuGlobal.tbSecurityStock + " where " + "material_code = '" + assy + "' AND company = '" + vend4 + "' AND PLANT = '" + plantInsert + "' and " + "FCT_CODE = '" + PaCSGlobal.LoginUserInfo.Fct_code + "'"; //plantInsert -SSDP OR SESC tbStockQty.Text = OracleHelper.ExecuteScalar(sql).ToString(); SecuGlobal.showOK(panelStatus, lblStatus, "选中材料是:" + assy); if (ckCancle.Checked) // 出库取消模式下,不是NOR 的不允许取消 { string mov = gridView1.GetRowCellValue(i, gridView1.Columns["移库方向"]).ToString(); if (!mov.Equals("NOR") || type.Equals("GR")) { SecuGlobal.showNG(panelStatus, lblStatus, "此记录不能做出库取消,请再次确认"); gridView1.SetRowCellValue(i, gridView1.Columns[0], false); return; } else { btnSave.Enabled = true; bk_docno = gridView1.GetRowCellValue(i, gridView1.Columns["申请单号"]).ToString(); //RTN 记录单号 ls_bk_company = gridView1.GetRowCellValue(i, gridView1.Columns["厂家"]).ToString(); //RTN 厂家信息 if (!bCheckCancleQty(ls_bk_company, bk_docno, "1")) { SecuGlobal.showNG(panelStatus, lblStatus, "数据取消分析NG,请在确认"); btnSave.Enabled = false; return; } SecuGlobal.showOK(panelStatus, lblStatus, "数据可以取消,请继续..."); } } iCount += 1; break; } } }
private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { this.Invoke((MethodInvoker) delegate { SecuGlobal.showOK(panelStatus, lblStatus, "数据上传中,请耐心等待..."); try { //MessageBox.Show(grdView1.RowCount.ToString()); for (int i = 0; i < grdView1.RowCount; i++) { StringBuilder sql = new StringBuilder("insert into " + SecuGlobal.tbSecurityInvoice + "(sec_boxno,sec_itemcd,sec_rollfrom,sec_rollto,sec_start,sec_end,sec_cnt,delivery_date,invoice_no,add_date,add_time,add_user,add_ip,FCT_CODE) " + "values (:sec_boxno,:sec_itemcd,:sec_rollfrom,:sec_rollto,:sec_start,:sec_end,:sec_cnt,:delivery_date,:invoice_no," + "to_char(sysdate,'yyyymmdd'),to_char(sysdate,'hh24miss'),:add_user,:add_ip,:FCT_CODE)"); OracleParameter[] parameters = new OracleParameter[] { new OracleParameter(":sec_boxno", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[5]))), new OracleParameter(":sec_itemcd", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[0]))), new OracleParameter(":sec_rollfrom", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[1]))), new OracleParameter(":sec_rollto", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[2]))), new OracleParameter(":sec_start", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[3]))), new OracleParameter(":sec_end", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[4]))), new OracleParameter(":sec_cnt", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[6]))), new OracleParameter(":delivery_date", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[7]))), new OracleParameter(":invoice_no", Convert.ToString(grdView1.GetRowCellValue(i, grdView1.Columns[8]))), //new OracleParameter(":add_date", to_char(sysdate,'yyyymmdd')), //new OracleParameter(":add_time", "to_char(sysdate,'hh24miss')"), new OracleParameter(":add_user", PaCSTools.PaCSGlobal.LoginUserInfo.Name), new OracleParameter(":add_ip", PaCSTools.PaCSGlobal.GetClientIp()), new OracleParameter(":FCT_CODE", PaCSTools.PaCSGlobal.LoginUserInfo.Fct_code) }; OracleHelper.ExecuteNonQuery(sql.ToString(), parameters); } SecuGlobal.showOK(panelStatus, lblStatus, "数据保存 OK"); } catch (Exception DoWork) { SecuGlobal.showNG(panelStatus, lblStatus, DoWork.Message); // rollback ? } finally { if (ckClipBorad.Checked) //剪贴板模式恢复到EXCEL模式, { //System.Windows.Forms.Clipboard.Clear(); //剪贴板不能清空,否则会导致数据显示异常 ckClipBorad.Checked = false; } } }); }
/// <summary> /// 保存数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { try { if (!bGetValues()) { return; } if (!bAnalysis()) { return; } DialogResult dr = MessageBox.Show("是否保存修改的内容", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr != DialogResult.OK) { SecuGlobal.showOK(panelStatus, lblStatus, "用户取消作业"); return; } if (!bInsertData()) //数据写入到TB_SECURITY_DOC { return; } int li_check = iUpdateStockQty(); // 更新库存数量tb_security_stock if (li_check == 0) { if (ckCancle.Checked) { ckCancle.Checked = false; } btnApply_Click(sender, e); SecuGlobal.showOK(panelStatus, lblStatus, "OK"); Reset(); //数据初始化 } else { SecuGlobal.showNG(panelStatus, lblStatus, "库存数量更新失败,请联系管理员"); } } catch (Exception er) { SecuGlobal.showNG(panelStatus, lblStatus, er.Message); } }
private void btnQuery_Click(object sender, EventArgs e) { try { SecuGlobal.showOK(panelStatus, lblStatus, "数据查询中,请稍等..."); SecuGlobal.GridViewInitial(grdView1, gridControl1); backgroundWorker1.RunWorkerAsync(); SplashScreenManager.ShowForm(typeof(WaitLoading)); } catch (Exception ex) { SecuGlobal.showNG(panelStatus, lblStatus, ex.Message); } }
private void btnQuery_Click(object sender, EventArgs e) { try { SecuGlobal.showOK(panelStatus, lblStatus, "正在查询数据,请稍等..."); getVariable(); backgroundWorker1.RunWorkerAsync(); SplashScreenManager.ShowForm(typeof(WaitLoading)); SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); } catch (Exception btnQuery_Click) { SecuGlobal.showNG(panelStatus, lblStatus, btnQuery_Click.Message); } }
/// <summary> /// 后台查询数据并且显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { getVariable(); DataTable dt = null; this.Invoke((MethodInvoker) delegate { switch (queryType) { case "SUMMARY": dt = OracleHelper.ExecuteDataTable(getSqlSummary(ls_req_vendor, ls_sdate, ls_edate, ls_material_code, ls_plant)); if (dt != null) { dt = setDtHeader(dt); } SecuGlobal.GridViewInitial(grdView1, gridControl1); gridControl1.DataSource = dt; grdView1.BestFitColumns(); grdView1.Columns["描述"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; grdView1.Columns["描述"].SummaryItem.SummaryType = SummaryItemType.Count; grdView1.Columns["描述"].SummaryItem.DisplayFormat = "All: {0:f0}"; break; case "DETAIL": dt = OracleHelper.ExecuteDataTable(getSqlDetail(ls_req_vendor, ls_sdate, ls_edate)); SecuGlobal.GridViewInitial(grdView1, gridControl1); gridControl1.DataSource = dt; grdView1.BestFitColumns(); grdView1.Columns["REQ_VENDOR"].SummaryItem.SummaryType = SummaryItemType.Count; grdView1.Columns["REQ_VENDOR"].SummaryItem.DisplayFormat = "All: {0:f0}"; break; } SecuGlobal.showOK(panelStatus, lblStatus, "OK"); }); } catch (Exception err) { XtraMessageBox.Show(this, "System error[ShowData]: " + err.Message); } }
/// <summary> /// 加载基本信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReqListVendor_Load(object sender, EventArgs e) { SecuGlobal.showOK(panelStatus, lblStatus, "正在加载数据,请稍等..."); SecuGlobal.setDate(dateEditFrom, dateEditTo); fctCode = PaCSGlobal.LoginUserInfo.Fct_code; if (fctCode.Equals("C6H0A")) { plantCode = "SESC"; } else { plantCode = "SSDP"; } cbPlant.Text = plantCode; string bufVend = SecuGlobal.getPopVendorInfo(PaCSGlobal.LoginUserInfo.Venderid, PaCSGlobal.LoginUserInfo.Fct_code); if (!bufVend.Equals("")) { cbVendor.Text = bufVend; } else { cbVendor.Text = PaCSGlobal.LoginUserInfo.Venderid + ":" + PaCSGlobal.LoginUserInfo.Vendername; //苏州法人 } vendorInfo = cbVendor.Text; if (!string.IsNullOrEmpty(vendorInfo)) { if (!vendorInfo.Equals("ALL")) { string[] split = vendorInfo.Split(new Char[] { ':' }); vendorCode4 = split[0].Trim(); } else { vendorCode4 = "%"; } } SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); }
/// <summary> /// 申请单信息删除 /// </summary> /// <returns></returns> private bool bReqDocDelete() { int iC = 0; for (int i = 0; i < gridView2.RowCount; i++) { for (int j = 0; j < gridView2.Columns.Count; j++) { if ((bool)gridView2.GetRowCellValue(i, gridView2.Columns[0])) { iC += 1; string ls_req_doc = gridView2.GetRowCellValue(i, gridView2.Columns["申请单号"]).ToString(); string li_req_seq = gridView2.GetRowCellValue(i, gridView2.Columns["序号"]).ToString(); string ls_status = gridView2.GetRowCellValue(i, gridView2.Columns["状态"]).ToString(); if (!ls_status.Equals("RQ")) { SecuGlobal.showNG(panelStatus, lblStatus, li_req_seq + "该申请单不允许删除"); return(false); } string sql = " update " + SecuGlobal.tbSecurityRequestD + " " + " set status = 'DE', " + " update_date = to_char(sysdate,'yyyymmdd'), " + " update_time = to_char(sysdate,'hh24MIss'), " + " update_user = '******', " + " update_ip = '" + PaCSGlobal.GetClientIp() + "' " + " where req_doc = '" + ls_req_doc + "' " + " and req_seq = '" + li_req_seq + "' and FCT_CODE = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' "; OracleHelper.ExecuteNonQuery(sql); } } } if (iC == 0) { SecuGlobal.showNG(panelStatus, lblStatus, "没有选中内容,请确认"); return(false); } else { SecuGlobal.showOK(panelStatus, lblStatus, "OK"); return(true); } }
/// <summary> ///加载日期 、Vendor信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RequestList_Load(object sender, EventArgs e) { radioGroup2_SelectedIndexChanged(sender, e); // 获取查询类型 SecuGlobal.setDate(dateEditFrom, dateEditTo); if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C660A")) { cbPlant.Text = "SSDP"; } else { cbPlant.Text = "SESC"; } SecuGlobal.setAllVendorInfo(PaCSGlobal.LoginUserInfo.Fct_code, cbVendor); //根据FCT CODE 获取所有的VENDOR 信息 SecuGlobal.showOK(panelStatus, lblStatus, "Ready"); }
/// <summary> /// 根据选择内容,获取截取字符串 /// 设置基本信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void radioGroup2_SelectedIndexChanged_1(object sender, EventArgs e) { tbQty.Text = ""; switch (is_security_type) { case "SAMSUNG": if (radioGroup2.SelectedIndex == 0) //整箱 { strUnitType = "BOX"; tbQty.Text = "20000"; getScanSplitValue("353"); } else if (radioGroup2.SelectedIndex == 1) //整卷 { strUnitType = "ROLL"; tbQty.Text = "2500"; getScanSplitValue("354"); } else //单个 { strUnitType = "ONE"; tbQty.Text = "1"; SecuGlobal.GridViewInitial(grdScanSetting, grdControl2); } break; case "XEROX": if (radioGroup2.SelectedIndex == 1) //整卷 { strUnitType = "ROLL"; tbQty.Text = "10000"; getScanSplitValue("355"); } else if (radioGroup2.SelectedIndex == 2) //单个 { strUnitType = "ONE"; tbQty.Text = "1"; } break; } clear(); SecuGlobal.showOK(panelStatus, lblStatus, "投入类型为:" + is_security_type + " < " + strUnitType + " >"); }
/// <summary> /// 出库取消 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ckCancle_CheckedChanged(object sender, EventArgs e) { Reset(); if (ckCancle.Checked) { SecuGlobal.showOK(panelStatus, lblStatus, "出库取消模式 - 请选择信息,然后保存"); cbDocMvt.Text = "RTN:" + SecuGlobal.getMoveType("RTN"); tbDocType.Text = "入库"; cbDocMvt.Properties.ReadOnly = true; } else { SecuGlobal.showOK(panelStatus, lblStatus, "正常模式- 请选择信息,然后保存"); cbDocMvt.Properties.ReadOnly = false; cbDocMvt.Text = ""; tbDocType.Text = ""; btnSave.Enabled = true; } }
/// <summary> /// 数据删除及显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { SecuGlobal.showOK(panelStatus, lblStatus, "删除数据中,请稍等..."); SecuGlobal.strMeterialCode = grdView1.GetRowCellValue(grdView1.GetSelectedRows()[0], "材料").ToString(); string sql = "delete from " + SecuGlobal.tbMaster + " where material_code = '" + SecuGlobal.strMeterialCode + "'"; DialogResult result = XtraMessageBox.Show("确定删除:" + SecuGlobal.strMeterialCode + "?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { OracleHelper.ExecuteNonQuery(sql); ShowData(null); SecuGlobal.showOK(panelStatus, lblStatus, "OK"); } else { SecuGlobal.showOK(panelStatus, lblStatus, "用户取消,数据未删除"); return; } }