You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.5 KiB

3 years ago
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;
namespace Stone.WinModule.JISAdmin
{
public partial class frmEdiPrintASNOutNew : Form
{
public Entity.EntityBase t_base = null;
public frmEdiPrintASNOutNew()
{
InitializeComponent();
}
private void frmEdiPrintASNOutNew_Load(object sender, EventArgs e)
{
this.cbFields.SelectedIndex = 0;
}
private void btnQuery_Click(object sender, EventArgs e)
{
this.btnQuery.Enabled = false;
this.btnQuery.Update();
try
{
string Fields = this.cbFields.SelectedItem.ToString();
string value = this.txtKey.Text.Trim();
string d1 = MyDateTime.Format(this.dateTimePicker1.Value, MyDateTimeType.Date) + " 00:00:00";
string d2 = MyDateTime.Format(this.dateTimePicker2.Value, MyDateTimeType.Date) + " 23:59:59";
string strWhere = "[SwetTime]>='{1}' and [SwetTime]<='{2}' {3}";
object[] obj = new object[10];
obj[1] = d1;
obj[2] = d2;
obj[3] = " and " + Fields + "='" + value + "'";
if (value == "") obj[3] = "";
strWhere = string.Format(strWhere, obj);
DataSet dsData = t_base.GetData("", strWhere, "[SwetTime] asc");
this.dgrdView1.DataSource = dsData.Tables[0];
this.dgrdView1.Columns["ID"].Visible = false;
MyGridViewStyle.SetDataGridMenuCommon(this.dgrdView1);
MyGridViewStyle.SetDataGridRowNumber(this.dgrdView1);
object obj_sum = dsData.Tables[0].Compute("Sum([quantity])", "1=1");
if (obj_sum.ToString() == "") obj_sum = "0";
this.lblState.Text = "��¼����" + dsData.Tables[0].Rows.Count + " �������ϼƣ�" + obj_sum.ToString();
}
catch (Exception ex)
{
MyMessageBox.ShowErrorMessage(ex.Message);
}
finally
{
this.btnQuery.Enabled = true;
Application.DoEvents();
}
}
private void btnOutput_Click(object sender, EventArgs e)
{
MyExport.ShowExport(this.dgrdView1);
}
}
}