雅琪诺MES智能条码管理系统
ouyangqing
2021-01-14 d0ec7958763621981a856f2fe42eaffd5ddc15c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace SCM
{
    public partial class Gy_BarCodeMain : Form
    {
        public Gy_BarCodeMain()
        {
            InitializeComponent();
            dateTimePicker1.Text = DateTime.Now.AddDays(-7).ToString();
            dateTimePicker2.Text = DateTime.Now.ToString();
            oWeb.Url = SCM.ClsPub1.WEBSURL;
        }
        public frmBillQueryCondition_Base frmCondition;
        public string ViewName = "h_c_barcodemain";
        public string ModCaption = "成品分切检验汇报表";
        public const string ModName = "1250";
        public string sDlgWhere = "";  //外窗体递入
        public int selectRow = 0;
        SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
        private void cx_Click(object sender, EventArgs e)
        {
            Display();
        }
        private void Display()
        {
            StringBuilder whereBuilder = new StringBuilder();
            if (string.IsNullOrEmpty(dateTimePicker1.Text) || string.IsNullOrEmpty(dateTimePicker2.Text))
            {
                MessageBox.Show("输入时间不能为空");
                return;
            }
            if (DateTime.Parse(dateTimePicker1.Text) > DateTime.Parse(dateTimePicker2.Text))
            {
                MessageBox.Show("开始时间不能大于截至时间");
                return;
            }
            whereBuilder.Append(" and a.FDATE>''" + dateTimePicker1.Text+ "'' and a.FDATE<''" + dateTimePicker2.Text+"''");
            if (!string.IsNullOrEmpty(txtHBillNo.Text))
                whereBuilder.Append(" and a.FBILLNO like ''%" + txtHBillNo.Text+"%''");
            if (!string.IsNullOrEmpty(textBox1.Text))
                whereBuilder.Append(" and e.FNUMBER like ''%"+textBox1.Text+"%''");
            if (!string.IsNullOrEmpty(textBox2.Text))
                whereBuilder.Append(" and c.HMaterName like ''%"+textBox2.Text+"%''");
            var execSql = "exec "+ViewName+" '"+whereBuilder+"'";
            DataSet DSet = oWeb.getDataSetBySQL(execSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
            {
                MessageBox.Show("没有返回任何结果,请在过滤框中点击【恢复】按钮,尝试再次查询!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            //
            grdMain.DataSource = DSet.Tables[0].DefaultView;
        }
 
        private void tc_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}