| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Drawing;
- using System.Net;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Forms
- {
- public partial class QcmZbsLanguageYuLan : FrmBase
- {
- private string billNo = "";
- private string orderNo = "";
- private string ordLnDlyPk = "";
- private string metricSystem = "";
- private string languageCode = "";
- private string billNoSeq = "";
- private ArrayList parm = null;
- public QcmZbsLanguageYuLan(string _billNo, string _orderNo, string _ordLnDlyPk, string _metricSystem, string _languageCode, string _billNoSeq, ArrayList _parm, OpeBase _ob)
- {
- InitializeComponent();
- ob = _ob;
- billNo = _billNo;
- orderNo = _orderNo;
- ordLnDlyPk = _ordLnDlyPk;
- metricSystem = _metricSystem;
- languageCode = _languageCode;
- billNoSeq = _billNoSeq;
- parm = _parm;
- }
- private void QcmZbsLanguageYuLan_Load(object sender, EventArgs e)
- {
- //查询语言要求
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderAskSub", new object[] { "12100704" }, ob);
- comAsk.DataSource = dt1;
- comAsk.DisplayMember = "ASK_ITEM_DESC";
- comAsk.ValueMember = "ASK_ITEM_NO";
- Query();
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void Query()
- {
- ////DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage", new object[] { billNo, ordLnDlyPk }, ob);
- ////GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }
- private void craftImg1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
- string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
- string filePath = row.GetValue("ZBS_PATH");
- string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt&op=view"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&YULAN=1&ORD_LN_DLY_PK=" + ordLnDlyPk;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "质保书";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- else
- {
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- //dlgOrderAskDown askDown = new dlgOrderAskDown(ob, filePath);
- //askDown.Show();
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string pdfName = billNoSeq + askSubItmeValNo;
- string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/";
- var serverFileList = FileHelper.Download(filePathNew);
- if (serverFileList.Count > 0)
- {
- MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- return;
- }
- //保存
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAdd";
- ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string craftPath = filePathNew + pdfName + ".pdf";
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt&format=pdf"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&YULAN=1&ORD_LN_DLY_PK=" + ordLnDlyPk;
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF ,请重新生成!");
- return;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- var a = FileHelper.Upload(listPdf);
- if (a)
- {
- //MessageUtil.ShowTips("上传成功!");
- row.Cells["ZBS_NAME"].Value = pdfName + ".pdf";
- row.Cells["ZBS_PATH"].Value = filePathNew;
- Query();
- }
- }
- }
- else
- {
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- //删除
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doDelete";
- ccp.ServerParams = new object[] { row.Cells["ZBS_NAME"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- var a = FileHelper.Delete(filePath);
- if (a)
- {
- Query();
- }
- }
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null)
- {
- row.Cells["BILL_NO"].Value = billNo;
- row.Cells["ORDER_NO"].Value = orderNo;
- row.Cells["ORD_LN_DLY_PK"].Value = ordLnDlyPk;
- row.Cells["METRIC_SYSTEM"].Value = metricSystem;
- row.Cells["LANGUAGE_CODE"].Value = languageCode;
- }
- if (row.Cells["BILL_NO"].Text.Equals(""))
- {
- row.Cells["BILL_NO"].Value = billNo;
- row.Cells["ORDER_NO"].Value = orderNo;
- row.Cells["ORD_LN_DLY_PK"].Value = ordLnDlyPk;
- row.Cells["METRIC_SYSTEM"].Value = metricSystem;
- row.Cells["LANGUAGE_CODE"].Value = languageCode;
- }
- }
- private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- }
- private void craftImgJG_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
- string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
- string filePath = row.GetValue("ZBS_PATH_JG");
- string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt&op=view"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&YULAN=1&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "接箍质保书";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- else
- {
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- //dlgOrderAskDown askDown = new dlgOrderAskDown(ob, filePath);
- //askDown.Show();
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string pdfName = "JG" + billNoSeq + askSubItmeValNo;
- string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/JG/";
- var serverFileList = FileHelper.Download(filePathNew);
- if (serverFileList.Count > 0)
- {
- MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- return;
- }
- //保存
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAddJG";
- ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string craftPath = filePathNew + pdfName + ".pdf";
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt&format=pdf"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk;
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF ,请重新生成!");
- return;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- var a = FileHelper.Upload(listPdf);
- if (a)
- {
- //MessageUtil.ShowTips("上传成功!");
- row.Cells["ZBS_NAME_JG"].Value = pdfName + ".pdf";
- row.Cells["ZBS_PATH_JG"].Value = filePathNew;
- Query();
- }
- }
- }
- else
- {
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- //删除
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doDeleteJG";
- ccp.ServerParams = new object[] { row.Cells["ZBS_NAME_JG"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- var a = FileHelper.Delete(filePath);
- if (a)
- {
- Query();
- }
- }
- }
- }
- private void craftImgZB_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- if (parm.Count < 1)
- {
- MessageUtil.ShowTips("请选择招标质保书的炉号!");
- return;
- }
- string JudgeStoveNoBatchNo = "";
- foreach (String a in parm)
- {
- JudgeStoveNoBatchNo += a + "','";
- }
- string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
- string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
- string filePath = row.GetValue("ZBS_PATH_ZB");
- string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt&op=view"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&YULAN=1&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&JUDGE_STOVE_NO_BATCH_NO=" + JudgeStoveNoBatchNo;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "招标质保书";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- else
- {
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string pdfName = "ZB" + billNoSeq + askSubItmeValNo;
- string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/ZB/";
- var serverFileList = FileHelper.Download(filePathNew);
- if (serverFileList.Count > 0)
- {
- MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- return;
- }
- //保存
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAddZB";
- ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string craftPath = filePathNew + pdfName + ".pdf";
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt&op=view&format=pdf"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&JUDGE_STOVE_NO_BATCH_NO=" + JudgeStoveNoBatchNo;
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF ,请重新生成!");
- return;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- var a = FileHelper.Upload(listPdf);
- if (a)
- {
- //MessageUtil.ShowTips("上传成功!");
- row.Cells["ZBS_NAME_ZB"].Value = pdfName + ".pdf";
- row.Cells["ZBS_PATH_ZB"].Value = filePathNew;
- Query();
- }
- }
- }
- else
- {
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- //删除
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doDeleteZB";
- ccp.ServerParams = new object[] { row.Cells["ZBS_NAME_ZB"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- var a = FileHelper.Delete(filePath);
- if (a)
- {
- Query();
- }
- }
- }
- }
- }
- }
|