北京安通林JIS系统
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.
 
 
 

109 lines
3.4 KiB

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;
namespace Stone.WinModule.BasicData
{
public partial class frmJISLog : Stone.WinModule.BasicData.frmBaseMain
{
public frmJISLog()
{
InitializeComponent();
this.tlbAdd.Visible = false;
this.tlbAddCopy.Visible = false;
this.tlbEdit.Visible = false;
this.tlbDelete.Visible = false;
this.tlbInput.Visible = false;
this.tlbView.Visible = false;
base.CreateButton("Check", 3, 0).Click += new EventHandler(frmJISLog_Click);
this.dgrdView.CellDoubleClick += new DataGridViewCellEventHandler(dgrdView_CellDoubleClick);
}
void dgrdView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
frmJISLog_Click(new object(), new EventArgs());
}
public void frmJISLog_Click(object sender, EventArgs e)
{
try
{
if (this.dgrdView.SelectedRows.Count == 0) throw new Exception("记录不存在");
if (this.dgrdView.SelectedRows[0].Cells["ProcessState"].Value.ToString() == "Failed" ||
this.dgrdView.SelectedRows[0].Cells["ProcessState"].Value.ToString() == "")
{
string id = this.dgrdView.SelectedRows[0].Cells["ID"].Value.ToString();
Entity.Entity_t_JIS_Log t_JIS_Log = new Entity.Entity_t_JIS_Log();
DataTable dtData = t_JIS_Log.GetData("[ID]=" + id).Tables[0];
if (dtData.Rows.Count == 0) throw new Exception("Not found record");
frmJISLogCheck frm = new frmJISLogCheck();
frm.txtMemo.Text = dtData.Rows[0]["Memo"].ToString();
frm.txtReason.Text = dtData.Rows[0]["Reason"].ToString();
frm.dtData = dtData;
if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
UpdateGridView();
}
frm.Dispose();
}
else
{
throw new Exception("The current record cannot do this");
}
}
catch (Exception ex)
{
MyMessageBox.ShowErrorMessage(ex.Message);
}
}
//public override void init()
//{
// this.strWhere = "ID = 0";
// try
// {
// strWhere = "convert(varchar(10),StartTime,120)='" + MyDateTime.Format( MyDateTimeType.Date) + "'";
// }
// catch { }
// base.init();
//}
public override void Search(string code)
{
if (code == "")
{
strWhere = "1=1";
}
else
{
strWhere = " [FileType] like '%" + code + "%' or ";
strWhere += " [FileName] like '%" + code + "%' or ";
strWhere += " [ProcessState] like '%" + code + "%' or ";
strWhere += " [Memo] like '%" + code + "%' ";
}
}
private void frmJISLog_Load(object sender, EventArgs e)
{
}
}
}