public void ASPxButton1_Click(object sender, EventArgs e) { string planSO = txtPlanSO.Text; if (string.IsNullOrWhiteSpace(planSO)) { Response.Write("<script>alert('成品号不能为空!');</script>"); return; } List <PlanEntity> plan = PlanFactory.GetByPlanSO(planSO); string orderCode = ""; if (plan != null && plan.Count > 0) { orderCode = plan[0].ORDER_CODE; } List <IMESLine2LineEntity> entity = IMESLine2LineFactory.GetByOrderCode(orderCode); if (entity == null || entity.Count == 0) { Response.Write("<script>alert('没有该订单号的相关记录!');</script>"); return; } ASPxGridView1.DataSource = entity; ASPxGridView1.DataBind(); }
public void BindData() { string _b = cdate1.Date.ToString("yyyyMMdd") + "000000"; string _e = cdate2.Date.ToString("yyyyMMdd") + "235959"; List <IMESPlanProcessEntity> entity = db.Fetch <IMESPlanProcessEntity>("where SERIAL between @0 and @1 order by AUFNR", _b, _e); string planSO = txtPlanSO.Text; string orderCode = ""; if (!string.IsNullOrEmpty(planSO)) { List <PlanEntity> plan = PlanFactory.GetByPlanSO(planSO); if (plan != null && plan.Count > 0) { orderCode = plan[0].ORDER_CODE; } if (!string.IsNullOrEmpty(orderCode)) { entity = (from s in entity where s.AUFNR == orderCode select s).ToList <IMESPlanProcessEntity>(); } } ASPxGridView1.DataSource = entity; DataTable dt = new DataTable(); dt.Columns.Add("Text"); dt.Columns.Add("Value"); dt.Rows.Add("初始状态", "0"); dt.Rows.Add("传送中", "1"); dt.Rows.Add("已传送", "2"); GridViewDataComboBoxColumn colPrind = ASPxGridView1.Columns["PRIND"] as GridViewDataComboBoxColumn; colPrind.PropertiesComboBox.DataSource = dt; colPrind.PropertiesComboBox.TextField = "Text"; colPrind.PropertiesComboBox.ValueField = "Value"; DataTable dt1 = new DataTable(); dt1.Columns.Add("Text"); dt1.Columns.Add("Value"); dt1.Rows.Add("完成", "X"); GridViewDataComboBoxColumn colPrind1 = ASPxGridView1.Columns["OPFLG"] as GridViewDataComboBoxColumn; colPrind1.PropertiesComboBox.DataSource = dt1; colPrind1.PropertiesComboBox.TextField = "Text"; colPrind1.PropertiesComboBox.ValueField = "Value"; ASPxGridView1.DataBind(); }
private void SetQualFiles(string pSn, string pPlineCode) { Microsoft.Office.Interop.Excel.Application apps = new Microsoft.Office.Interop.Excel.Application(); //string filename = System.Windows.Forms.Application.StartupPath+"\\..\\.." + file_template; string filename = System.Windows.Forms.Application.StartupPath + file_template; object oMissing = System.Reflection.Missing.Value; Workbook _wkbook = apps.Workbooks.Open(filename, 0, true, 5, oMissing, oMissing, true, 1, oMissing, false, false, oMissing, false, oMissing, oMissing); Worksheet _wksheet = _wkbook.Sheets["sheet1"]; //OPCStationEntity aa=OPCStationFactory.GetByPlineCode( //List<OPCTagsEntity> qual_list=OPCTagsFactory.GetQualityItems( //_wksheet.Cells[1,7]="123"; //_wksheet.Range["G1"].Value = "123"; List <SNDetectdDataEntity> lst_detect = SNDetectFactory.GetByPlineCodeSn(theCompanyCode, pPlineCode, pSn); foreach (OPCTagsEntity s in OPC_TAGS) { SNDetectdDataEntity detect_data = (from p in lst_detect where p.DETECT_DATA_CODE == s.OPC_TAG_NAME select p).First(); //string ssi = _wksheet.Range[s.OPC_TAG_NAME].Value; string detect_value = detect_data.DETECT_DATA_VALUE.ToUpper(); if (detect_value == "TRUE") { detect_value = "合格"; } else if (detect_value == "FALSE") { detect_value = "不合格"; } _wksheet.Range[s.OPC_TAG_NAME].Value = detect_value; } List <PlanEntity> plan_data = PlanFactory.GetByPlanSO(pSn); //if (plan_data.Count != 0) //{ // _wksheet.Cells[3, 4] = plan_data.First().PRODUCT_SERIES.ToString(); // _wksheet.Cells[4, 6] = plan_data.First().PROJECT_CODE.ToString(); //} _wksheet.Cells[4, 4] = pSn; //_wkbook.Save(); apps.Visible = true; _wksheet.PrintPreview(null); //apps.Visible = false; _wkbook.Close(0, oMissing, oMissing); apps.Quit(); GC.Collect(); }