⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sfcx.cs

📁 实习时候做的一个c#的财务管理系统
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace cwgl
{
    public partial class sfcx : cwgl.cx
    {
        public sfcx()
        {
            InitializeComponent();
        }

        SqlConnection con = new SqlConnection(global::cwgl.Properties.Settings.Default.cwglCon);

        private void button1_Click(object sender, EventArgs e)
        {   
            string lx = groupBox1.Text.ToString().Trim();
            string xmmc = this.textBox1.Text;
            string cx = comboBox1.Text.ToString().Trim();
            if (lx == "收费项目查询")
            {
            if(cx == "土地报批费用结算表"){
                try
                {
                    con.Open();
                    string sql = "SELECT xmm AS 项目名称, sfxm AS 收费项目, bz AS 标准,jfs AS 报批通知缴费数, ytj AS 应退金额, yfj AS 应返金额,yjf AS 应缴纳费用, sjf AS 实际缴纳费用, db AS 实缴与应缴对比 FROM dbo.jsb where xmm ='" + xmmc + "' and qb ='0'";
                    SqlCommand com = new SqlCommand(sql, con);
                    SqlDataAdapter sda = new SqlDataAdapter(com);
                    DataTable dt = new DataTable();
                    sda.Fill(dt);
                    this.dataGridView1.DataSource = dt;
                    con.Close();
                }
                catch (SqlException e1)
                {
                    MessageBox.Show("所填项目不存在!", "错误");
                }
                finally
                {
                    con.Close();
                }
            }else if(cx == "土地出让费用结算表"){
                try
                {
                    con.Open();
                    string sql = "SELECT xmm AS 项目名称, sfxm AS 收费项目, bz AS 标准,jfs AS 报批通知缴费数, ytj AS 应退金额, yfj AS 应返金额,yjf AS 应缴纳费用, sjf AS 实际缴纳费用, db AS 实缴与应缴对比 FROM dbo.jsb where xmm ='" + xmmc + "' and qb ='1'";
                    SqlCommand com = new SqlCommand(sql, con);
                    SqlDataAdapter sda = new SqlDataAdapter(com);
                    DataTable dt = new DataTable();
                    sda.Fill(dt);
                    this.dataGridView1.DataSource = dt;
                    con.Close();
                }
                catch (SqlException e1)
                {
                    MessageBox.Show("所填项目不存在!", "错误");
                }
                finally
                {
                    con.Close();
                }
            }
            }
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }


    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -