using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace OAM
|
{
|
public partial class frm_MeetingItemList : Form
|
{
|
public frm_MeetingItem ofrm_MeetingItem = new frm_MeetingItem();
|
public frm_MeetingItemList()
|
{
|
InitializeComponent();
|
}
|
|
|
private void Display()
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
DataSet Ds;
|
string sSQL;
|
sSQL = "Select * from h_v_Oa_MeetingitemList order by 项目代码";
|
//Select id hid,fromoperator 用户,opdate 时间,context 内容 from oa_msg where fromoperator='内销部经理' or fromoperator= '景焕章' and tooperator='景焕章' or tooperator='内销部经理'
|
Ds = oCn.RunProcReturn(sSQL, "h_v_Oa_MeetingitemList", ref DBUtility.ClsPub.sExeReturnInfo);
|
if (Ds == null)
|
{
|
MessageBox.Show("显示失败!原因:" + DBUtility.ClsPub.sExeReturnInfo);
|
return;
|
}
|
grdmain.DataSource = Ds.Tables[0].DefaultView;
|
|
DBUtility.Xt_BaseBillFun.DisplayGrid(grdmain, this.Name, "", 0);
|
}
|
|
private void timer1_Tick(object sender, EventArgs e)
|
{
|
timer1.Enabled = false;
|
Display();
|
}
|
|
|
private void grdmain_DoubleClick(object sender, EventArgs e)
|
{
|
if (grdmain.CurrentRow == null)
|
{
|
MessageBox.Show("没有选择项目!");
|
return;
|
}
|
else
|
{
|
Int64 sInterID = DBUtility.ClsPub.isLong(grdmain.Rows[grdmain.CurrentRow.Index].Cells["hitemid"].Value);
|
ofrm_MeetingItem.HMeet = DBUtility.ClsPub.isStrNull(grdmain.Rows[grdmain.CurrentRow.Index].Cells["项目名称"].Value);
|
ofrm_MeetingItem.HMeetNumber = DBUtility.ClsPub.isStrNull(grdmain.Rows[grdmain.CurrentRow.Index].Cells["项目代码"].Value);
|
ofrm_MeetingItem.HInterID = sInterID;
|
ofrm_MeetingItem.zt = false;
|
ofrm_MeetingItem.ShowDialog();
|
Display();
|
}
|
}
|
|
private void frm_MeetingItemList_Load(object sender, EventArgs e)
|
{
|
|
}
|
|
private void tc_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
|
private void xz_Click(object sender, EventArgs e)
|
{
|
ofrm_MeetingItem.HMeet = "";
|
ofrm_MeetingItem.HMeetNumber = "";
|
ofrm_MeetingItem.zt = true;
|
ofrm_MeetingItem.ShowDialog();
|
Display();
|
}
|
|
private void dj_Click(object sender, EventArgs e)
|
{
|
|
if (grdmain.CurrentRow == null)
|
{
|
MessageBox.Show("没有选择项目!");
|
return;
|
}
|
else
|
{
|
Int64 sInterID = DBUtility.ClsPub.isLong(grdmain.Rows[grdmain.CurrentRow.Index].Cells["hitemid"].Value);
|
ofrm_MeetingItem.HMeet = DBUtility.ClsPub.isStrNull(grdmain.Rows[grdmain.CurrentRow.Index].Cells["项目名称"].Value);
|
ofrm_MeetingItem.HMeetNumber = DBUtility.ClsPub.isStrNull(grdmain.Rows[grdmain.CurrentRow.Index].Cells["项目代码"].Value);
|
ofrm_MeetingItem.HInterID = sInterID;
|
ofrm_MeetingItem.zt = false;
|
ofrm_MeetingItem.ShowDialog();
|
Display();
|
}
|
}
|
|
private void sc_Click(object sender, EventArgs e)
|
{
|
if (!DBUtility.ClsPub.Security_Log("Oa_Meetingitem", 1, true, DBUtility.ClsPub.CurUserName))
|
{
|
return;
|
}
|
if (grdmain.CurrentRow == null)
|
{
|
MessageBox.Show("没有选择项目!");
|
return;
|
}
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
Int64 sInterID = DBUtility.ClsPub.isLong(grdmain.Rows[grdmain.CurrentRow.Index].Cells["hitemid"].Value);
|
if (MessageBox.Show("确定要删除当前单据?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
|
{
|
oCn.RunProc(" Delete from Oa_Meetingitem where hitemid=" + sInterID.ToString());
|
//Refresh1();
|
Display();
|
}
|
}
|
|
}
|
}
|