yangle
2023-03-03 c2a9a460e38c7c196fe98a94e29e6330eac3626f
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
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 frmLT : Form
    {
        public frmLT()
        {
            InitializeComponent();
        }
 
        string BillType = "4503";
        private void cmdSend_Click(object sender, EventArgs e)
        {
            if (txtContext.Text == "")
            {
                MessageBox.Show("请录入主题");
                return;
            }
            if (Add())
            {
                this.Close();
            }
        }
        private bool Add()
        {
            string sDate;
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            long MainID;
            MainID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
            sDate = DateTime.Now.ToString();
            string Context = txtContext.Text.Replace("'", "‘");
            string Desc = txtDesc.Text.Replace("'", "‘");
            oCn.RunProc("Insert into oa_ltmain(id,operator,context,description,opdate) values(" + MainID + ",'" + DBUtility.ClsPub.CurUserName + "','" + Context + "','" + Desc + "','" + sDate + "')");
            oCn.RunProc("Insert into oa_ltsub(id,mainid,operator,context,opdate) values(-1," + MainID + ",'" + DBUtility.ClsPub.CurUserName + "','" + Context + "','" + sDate + "')");
            return true;
        }
 
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}