123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using HslCommunication;
- using System;
- using System.Data;
- using System.Drawing;
- using System.Windows.Forms;
- using UAS_MES_NEW.DataOperate;
- using UAS_MES_NEW.Entity;
- using UAS_MES_NEW.PublicMethod;
- namespace UAS_MES_NEW.Query
- {
- public partial class Query_DateRate : Form
- {
- string querysql = "";
- DataHelper dh = SystemInf.dh;
- DataTable Dbfind;
- LogStringBuilder sql = new LogStringBuilder();
- //存放产品信息
- DataTable dt;
- //存放标签信息
- DataTable listA;
- public Query_DateRate()
- {
- InitializeComponent();
- }
- private void Export_Click(object sender, EventArgs e)
- {
-
- }
- //选择导出Excel时是选择导出数据的还是模板
- private void ExcelExport(string DataOrTemplet)
- {
-
- }
- private void Query_SpecialReport_Load(object sender, EventArgs e)
- {
- pi_inoutno.TableName = "prodinout ";
- pi_inoutno.SelectField = "pi_inoutno # 出库单号";
- pi_inoutno.FormName = Name;
- pi_inoutno.SetValueField = new string[] { "pi_inoutno" };
- pi_inoutno.Condition = "pi_class in ('生产领料单','其它出库单')";
- pi_inoutno.DbChange += pr_code_DbChange;
- }
- private void pr_code_DbChange(object sender, EventArgs e)
- {
- Dbfind = pi_inoutno.ReturnData;
- BaseUtil.SetFormValue(this.Controls, Dbfind);
- }
- private void pr_code_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- //判断产品是否存在
- dt = (DataTable)dh.ExecuteSql("select pr_code,pr_detail,pr_spec from product where pr_code='" + pr_code.Text + "' and pr_statuscode ='AUDITED'", "select");
- //查询没有值,返回提示用户“产品:XXX,不存在或者为审核”,清空产品代码输入框中的值
- if (dt.Rows.Count == 0)
- {
- OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者未审核\n", Color.Red, pr_code);
- return;
- }
- //查询产品是否有自定义的标签模板
- sql.Clear();
- sql.Append("select la_code,la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault ");
- sql.Append("from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault");
- listA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
- if (listA.Rows.Count == 0)
- {
- OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red, pr_code);
- return;
- }
- string la_id = listA.Rows[0]["la_id"].ToString();
- string la_code = listA.Rows[0]["la_code"].ToString();
- {
- //说明没有默认的模板,那就取pl_id最大的
- listA = (DataTable)dh.ExecuteSql("select fp_name la_url,'" + la_id + "' la_id,'" + la_code + "'la_code from FILEPATH where fp_id in (select * from table(select parsestring(LA_SOFTTYPE,';') from label where la_id='" + la_id + "' ) where COLUMN_VALUE is not null)", "select");
- }
- //标签显示
- PrintLabel.DataSource = listA;
- PrintLabel.DisplayMember = "la_url";
- PrintLabel.ValueMember = "la_id";
- //有值,填充界面
- BaseUtil.SetFormValue(this.Controls, dt);
- }
- }
- }
- }
|