1
jingh
2021-08-07 5420dd53d614631cf6fad6e9fdcc50eb8bc9562c
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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();
            }
        }
 
    }
}