using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Stone.Common; using Stone.Entity; using Stone.WinModule.JISData; namespace Stone.WinModule.JISData { public partial class frmJISLAB : Stone.WinModule.BasicData.frmBaseMain { public frmJISLAB() { InitializeComponent(); this.tlbAdd.Visible = false; this.tlbAddCopy.Visible = false; this.tlbEdit.Visible = false; this.tlbDelete.Visible = false; this.tlbInput.Visible = false; this.tlbFilter.Visible = false; this.txtPackageGroupName.DataSource = Stone.Common.MyDataSet.GetDataByStrings(";SY78;SY88").Tables[0]; this.txtPackageGroupName.DisplayMember = "Str"; this.txtPackageGroupName.ValueMember = "Str"; this.dateTimePicker2.Value = DateTime.Now.AddYears(2); } public override void init() { this.strWhere = "ID = 0"; base.init(); } public override void Search(string code) { string d1 = MyDateTime.Format(this.dateTimePicker1.Value, MyDateTimeType.Date); string d2 = MyDateTime.Format(this.dateTimePicker2.Value, MyDateTimeType.Date); if (code == "") { strWhere = "1=1"; } else { strWhere = " [PartNumber] like '%" + code + "%' or "; strWhere += " [Description] like '%" + code + "%' or "; strWhere += " [releaseId] like '%" + code + "%' or "; strWhere += " [location] like '%" + code + "%' or "; strWhere += " [locationCode] like '%" + code + "%' or "; strWhere += " [filename] like '%" + code + "%' "; } strWhere = "[startDate]>='" + d1 + "' and [startDate]<='" + d2 + "' and (" + strWhere + ")"; string PackageGroupName = this.txtPackageGroupName.SelectedValue.ToString(); if (PackageGroupName != "") { strWhere += $" and [fileType]='{PackageGroupName}'"; } } private void frmJISLog_Load(object sender, EventArgs e) { timer1.Enabled = true; } private void timer1_Tick(object sender, EventArgs e) { this.timer1.Enabled = false; try { DataSet dsData = m_Base.entityView.GetDataDistinct("partNumber", "[description] is null", "partNumber"); if (dsData.Tables[0].Rows.Count > 0) { frmTodNowProduct frm = new frmTodNowProduct(); frm.dgrdView.DataSource = dsData.Tables[0]; Stone.Common.MyGridViewStyle.SetDataGridRowNumber(frm.dgrdView); Stone.Common.MyGridViewStyle.SetDataGridMenuCommon(frm.dgrdView); frm.ShowDialog(); frm.Dispose(); } } catch (Exception ex) { MyMessageBox.ShowErrorMessage(ex.Message); } } } }