新个税计算方法程序源码
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace TaxCalcer { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private static decimal[] TaxRate = { 0.03m, 0.1m, 0.2m, 0.25m, 0.3m, 0.35m, 0.45m }; private void btn_Calc_Click(object sender, EventArgs e) { var year = new PersonYear(); decimal fang = 0; if (rb_fang1000.Checked) fang = 1000; else if (rb_fang1500.Checked) fang = 1500; var personData = new PersonMonthProfileData() { 月薪 = num_Salar.Value, 社保 = num_Shebao.Value, 公积金 = num_gjj.Value, 子女教育 = num_Edu.Value, 赡养老人 = num_Parents.Value, 大病医疗 = num_Bing.Value, 房住租贷 = fang, 继续教育 = num_AdvEdu.Value, }; year.SetValues(personData); lv_MonthData.BeginUpdate(); lv_MonthData.Items.Clear(); for (int i = 0; i < year.Months.Count; i++) { var m = year.Months[i]; var item = new ListViewItem(new string[] { (m.Month+1).ToString(), m.MonthData.月薪.ToString(), m.MonthData.社保.ToString(), m.MonthData.公积金.ToString(), m.MonthData.六项减免总数().ToString(), m.月应纳税所得额.ToString(), $"{TaxRate[m.TaxIndex]:P1}", m.Tax.ToString(), m.结余().ToString() }); item.Tag = m; lv_MonthData.Items.Add(item); } lv_MonthData.EndUpdate(); vc_1.Value = year.总收入.ToString(); vc_2.Value = year.总社保.ToString(); vc_3.Value = year.总公积金.ToString(); vc_4.Value = year.总交税.ToString(); vc_5.Value = year.总结余.ToString(); } } internal class PersonYear { private readonly List<PersonMonth> _months = new List<PersonMonth>(); public List<PersonMonth> Months => _months; public decimal 总收入 { get; set; } public decimal 总社保 { get; set; } public decimal 总公积金 { get; set; } public decimal 总交税 { get; set; } public decimal 总结余 { get; set; } public PersonYear() { } public void SetValues(PersonMonthProfileData data) { _months.Clear(); decimal 累计收入 = 0; decimal 累计减除费用 = 0; //按照个税起征点5000元/月 decimal 累计五险一金 = 0; decimal 累计六项减免 = 0; decimal 已预缴预扣税额 = 0; for (var i = 0; i < 12; i++) { var month = new PersonMonth() { Month = i, MonthData = data.Clone(), }; //if (i == 1) // month.MonthData.月薪 = 45000; 累计收入 += month.MonthData.月薪; 累计减除费用 += 5000; 累计五险一金 += month.MonthData.五险一金总额(); 累计六项减免 += month.MonthData.六项减免总数(); var 月应纳税所得额 = 累计收入 - 累计减除费用 - 累计五险一金 - 累计六项减免; if (月应纳税所得额 < 0) 月应纳税所得额 = 0; month.月应纳税所得额 = 月应纳税所得额; decimal tax = 0; int idx = 0; if (月应纳税所得额 <= 36000) { tax = 月应纳税所得额 * 0.03m; } else if (月应纳税所得额 > 36000 && 月应纳税所得额 <= 144000) { tax = 月应纳税所得额 * 0.1m - 2520; idx = 1; } else if (月应纳税所得额 > 144000 && 月应纳税所得额 <= 300000) { tax = 月应纳税所得额 * 0.2m - 16920; idx = 2; } else if (月应纳税所得额 > 300000 && 月应纳税所得额 <= 420000) { tax = 月应纳税所得额 * 0.25m - 31920; idx = 3; } else if (月应纳税所得额 > 420000 && 月应纳税所得额 <= 660000) { tax = 月应纳税所得额 * 0.30m - 52920; idx = 4; } else if (月应纳税所得额 > 660000 && 月应纳税所得额 <= 960000) { tax = 月应纳税所得额 * 0.35m - 85920; idx = 5; } else if (月应纳税所得额 > 960000) { tax = 月应纳税所得额 * 0.45m - 181920; idx = 6; } month.Tax = tax - 已预缴预扣税额; month.TaxIndex = idx; 已预缴预扣税额 += month.Tax; _months.Add(month); } 总收入 = 累计收入; 总社保 = _months.Sum(a => a.MonthData.社保); 总公积金 = _months.Sum(a => a.MonthData.公积金); 总交税 = _months.Sum(a => a.Tax); 总结余 = _months.Sum(a => a.结余()); } } internal class PersonMonth { public PersonMonthProfileData MonthData { get; set; } public int Month { get; set; } public decimal Tax { get; set; } public decimal 月应纳税所得额 { get; set; } /// <summary> /// 适用税率方式 /// </summary> public int TaxIndex { get; set; } public decimal 结余() { return MonthData.月薪 - MonthData.五险一金总额() - Tax; } } internal class PersonMonthProfileData { public decimal 月薪 { get; set; } public decimal 社保 { get; set; } public decimal 公积金 { get; set; } public decimal 子女教育 { get; set; } public decimal 赡养老人 { get; set; } public decimal 房住租贷 { get; set; } public decimal 继续教育 { get; set; } public decimal 大病医疗 { get; set; } public decimal 五险一金总额() { return 社保 + 公积金; } public decimal 六项减免总数() { return 子女教育 + 赡养老人 + 房住租贷 + 继续教育 + 大病医疗; } public PersonMonthProfileData Clone() { var rez = new PersonMonthProfileData() { 公积金 = 公积金, 大病医疗 = 大病医疗, 子女教育 = 子女教育, 房住租贷 = 房住租贷, 月薪 = 月薪, 社保 = 社保, 继续教育 = 继续教育, 赡养老人 = 赡养老人 }; return rez; } } }
namespace TaxCalcer { partial class Form1 { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.num_Salar = new System.Windows.Forms.NumericUpDown(); this.num_Shebao = new System.Windows.Forms.NumericUpDown(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.num_gjj = new System.Windows.Forms.NumericUpDown(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.radioButton3 = new System.Windows.Forms.RadioButton(); this.rb_fang1000 = new System.Windows.Forms.RadioButton(); this.rb_fang1500 = new System.Windows.Forms.RadioButton(); this.num_Bing = new System.Windows.Forms.NumericUpDown(); this.label9 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.num_Edu = new System.Windows.Forms.NumericUpDown(); this.num_AdvEdu = new System.Windows.Forms.NumericUpDown(); this.label4 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.num_Parents = new System.Windows.Forms.NumericUpDown(); this.label5 = new System.Windows.Forms.Label(); this.lv_MonthData = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.label8 = new System.Windows.Forms.Label(); this.btn_Calc = new System.Windows.Forms.Button(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.vc_1 = new TaxCalcer.ValueBlock(); this.vc_2 = new TaxCalcer.ValueBlock(); this.vc_3 = new TaxCalcer.ValueBlock(); this.vc_4 = new TaxCalcer.ValueBlock(); this.vc_5 = new TaxCalcer.ValueBlock(); this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); ((System.ComponentModel.ISupportInitialize)(this.num_Salar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.num_Shebao)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.num_gjj)).BeginInit(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.num_Bing)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.num_Edu)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.num_AdvEdu)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.num_Parents)).BeginInit(); this.groupBox4.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Location = new System.Drawing.Point(47, 26); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(44, 23); this.label1.TabIndex = 1; this.label1.Text = "月薪"; // // num_Salar // this.num_Salar.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Salar.Location = new System.Drawing.Point(103, 24); this.num_Salar.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_Salar.Name = "num_Salar"; this.num_Salar.Size = new System.Drawing.Size(151, 33); this.num_Salar.TabIndex = 0; this.num_Salar.Value = new decimal(new int[] { 15000, 0, 0, 0}); // // num_Shebao // this.num_Shebao.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Shebao.Location = new System.Drawing.Point(103, 24); this.num_Shebao.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_Shebao.Name = "num_Shebao"; this.num_Shebao.Size = new System.Drawing.Size(151, 33); this.num_Shebao.TabIndex = 1; this.num_Shebao.Value = new decimal(new int[] { 1000, 0, 0, 0}); // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Location = new System.Drawing.Point(47, 26); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(44, 23); this.label2.TabIndex = 1; this.label2.Text = "社保"; // // label3 // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label3.Location = new System.Drawing.Point(28, 76); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(61, 23); this.label3.TabIndex = 1; this.label3.Text = "公积金"; // // num_gjj // this.num_gjj.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_gjj.Location = new System.Drawing.Point(103, 74); this.num_gjj.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_gjj.Name = "num_gjj"; this.num_gjj.Size = new System.Drawing.Size(151, 33); this.num_gjj.TabIndex = 2; this.num_gjj.Value = new decimal(new int[] { 1000, 0, 0, 0}); // // groupBox1 // this.groupBox1.Controls.Add(this.num_Salar); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(12, 53); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(264, 74); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "一、收入"; // // groupBox2 // this.groupBox2.Controls.Add(this.num_Shebao); this.groupBox2.Controls.Add(this.label2); this.groupBox2.Controls.Add(this.num_gjj); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Location = new System.Drawing.Point(12, 133); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(264, 121); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; this.groupBox2.Text = "二、五险一金(免税)"; // // groupBox3 // this.groupBox3.Controls.Add(this.radioButton3); this.groupBox3.Controls.Add(this.rb_fang1000); this.groupBox3.Controls.Add(this.rb_fang1500); this.groupBox3.Controls.Add(this.num_Bing); this.groupBox3.Controls.Add(this.label9); this.groupBox3.Controls.Add(this.label7); this.groupBox3.Controls.Add(this.num_Edu); this.groupBox3.Controls.Add(this.num_AdvEdu); this.groupBox3.Controls.Add(this.label4); this.groupBox3.Controls.Add(this.label6); this.groupBox3.Controls.Add(this.num_Parents); this.groupBox3.Controls.Add(this.label5); this.groupBox3.Location = new System.Drawing.Point(12, 260); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(264, 287); this.groupBox3.TabIndex = 4; this.groupBox3.TabStop = false; this.groupBox3.Text = "二、专项减免"; // // radioButton3 // this.radioButton3.AutoSize = true; this.radioButton3.Checked = true; this.radioButton3.Font = new System.Drawing.Font("微软雅黑", 10.25F); this.radioButton3.Location = new System.Drawing.Point(103, 117); this.radioButton3.Name = "radioButton3"; this.radioButton3.Size = new System.Drawing.Size(105, 24); this.radioButton3.TabIndex = 8; this.radioButton3.TabStop = true; this.radioButton3.Text = "无(减免0)"; this.radioButton3.UseVisualStyleBackColor = true; // // rb_fang1000 // this.rb_fang1000.AutoSize = true; this.rb_fang1000.Font = new System.Drawing.Font("微软雅黑", 10.25F); this.rb_fang1000.Location = new System.Drawing.Point(103, 174); this.rb_fang1000.Name = "rb_fang1000"; this.rb_fang1000.Size = new System.Drawing.Size(143, 24); this.rb_fang1000.TabIndex = 8; this.rb_fang1000.Text = "买房(减免1000)"; this.rb_fang1000.UseVisualStyleBackColor = true; // // rb_fang1500 // this.rb_fang1500.AutoSize = true; this.rb_fang1500.Font = new System.Drawing.Font("微软雅黑", 10.25F); this.rb_fang1500.Location = new System.Drawing.Point(103, 147); this.rb_fang1500.Name = "rb_fang1500"; this.rb_fang1500.Size = new System.Drawing.Size(143, 24); this.rb_fang1500.TabIndex = 8; this.rb_fang1500.Text = "租房(减免1500)"; this.rb_fang1500.UseVisualStyleBackColor = true; // // num_Bing // this.num_Bing.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Bing.Location = new System.Drawing.Point(103, 249); this.num_Bing.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_Bing.Name = "num_Bing"; this.num_Bing.Size = new System.Drawing.Size(151, 33); this.num_Bing.TabIndex = 7; // // label9 // this.label9.AutoSize = true; this.label9.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label9.Location = new System.Drawing.Point(9, 251); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(78, 23); this.label9.TabIndex = 1; this.label9.Text = "大病医疗"; // // label7 // this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.Location = new System.Drawing.Point(9, 115); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(78, 23); this.label7.TabIndex = 1; this.label7.Text = "房住租贷"; // // num_Edu // this.num_Edu.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Edu.Location = new System.Drawing.Point(103, 28); this.num_Edu.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_Edu.Name = "num_Edu"; this.num_Edu.Size = new System.Drawing.Size(151, 33); this.num_Edu.TabIndex = 3; this.num_Edu.Value = new decimal(new int[] { 1000, 0, 0, 0}); // // num_AdvEdu // this.num_AdvEdu.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_AdvEdu.Location = new System.Drawing.Point(103, 210); this.num_AdvEdu.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_AdvEdu.Name = "num_AdvEdu"; this.num_AdvEdu.Size = new System.Drawing.Size(151, 33); this.num_AdvEdu.TabIndex = 6; // // label4 // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label4.Location = new System.Drawing.Point(9, 30); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(78, 23); this.label4.TabIndex = 1; this.label4.Text = "子女教育"; // // label6 // this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Location = new System.Drawing.Point(9, 212); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(78, 23); this.label6.TabIndex = 1; this.label6.Text = "继续教育"; // // num_Parents // this.num_Parents.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Parents.Location = new System.Drawing.Point(103, 74); this.num_Parents.Maximum = new decimal(new int[] { 9999999, 0, 0, 0}); this.num_Parents.Name = "num_Parents"; this.num_Parents.Size = new System.Drawing.Size(151, 33); this.num_Parents.TabIndex = 4; this.num_Parents.Value = new decimal(new int[] { 2000, 0, 0, 0}); // // label5 // this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("微软雅黑", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label5.Location = new System.Drawing.Point(9, 76); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(78, 23); this.label5.TabIndex = 1; this.label5.Text = "赡养老人"; // // lv_MonthData // this.lv_MonthData.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5, this.columnHeader8, this.columnHeader9, this.columnHeader6, this.columnHeader7}); this.lv_MonthData.Dock = System.Windows.Forms.DockStyle.Fill; this.lv_MonthData.FullRowSelect = true; this.lv_MonthData.Location = new System.Drawing.Point(3, 19); this.lv_MonthData.Name = "lv_MonthData"; this.lv_MonthData.Size = new System.Drawing.Size(660, 417); this.lv_MonthData.TabIndex = 5; this.lv_MonthData.UseCompatibleStateImageBehavior = false; this.lv_MonthData.View = System.Windows.Forms.View.Details; // // columnHeader1 // this.columnHeader1.Text = "月份"; this.columnHeader1.Width = 45; // // columnHeader2 // this.columnHeader2.Text = "月薪"; this.columnHeader2.Width = 80; // // columnHeader3 // this.columnHeader3.Text = "社保"; this.columnHeader3.Width = 70; // // columnHeader4 // this.columnHeader4.Text = "公积金"; this.columnHeader4.Width = 70; // // columnHeader5 // this.columnHeader5.Text = "专项减免"; this.columnHeader5.Width = 80; // // columnHeader8 // this.columnHeader8.Text = "应税额"; // // columnHeader6 // this.columnHeader6.Text = "个税"; this.columnHeader6.Width = 80; // // columnHeader7 // this.columnHeader7.Text = "结余"; this.columnHeader7.Width = 110; // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.lv_MonthData); this.groupBox4.Location = new System.Drawing.Point(282, 55); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(666, 439); this.groupBox4.TabIndex = 6; this.groupBox4.TabStop = false; this.groupBox4.Text = "结果"; // // label8 // this.label8.AutoSize = true; this.label8.Font = new System.Drawing.Font("微软雅黑", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label8.ForeColor = System.Drawing.Color.OrangeRed; this.label8.Location = new System.Drawing.Point(255, 8); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(450, 42); this.label8.TabIndex = 1; this.label8.Text = "2019年新税收政策个税计算器"; // // btn_Calc // this.btn_Calc.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btn_Calc.ForeColor = System.Drawing.Color.OrangeRed; this.btn_Calc.Location = new System.Drawing.Point(12, 553); this.btn_Calc.Name = "btn_Calc"; this.btn_Calc.Size = new System.Drawing.Size(264, 47); this.btn_Calc.TabIndex = 8; this.btn_Calc.Text = "Let\'s Go,给我算!"; this.btn_Calc.UseVisualStyleBackColor = true; this.btn_Calc.Click += new System.EventHandler(this.btn_Calc_Click); // // tableLayoutPanel1 // this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Inset; this.tableLayoutPanel1.ColumnCount = 5; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 59.91903F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40.08097F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 140F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 141F)); this.tableLayoutPanel1.Controls.Add(this.vc_1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.vc_2, 1, 0); this.tableLayoutPanel1.Controls.Add(this.vc_3, 2, 0); this.tableLayoutPanel1.Controls.Add(this.vc_4, 3, 0); this.tableLayoutPanel1.Controls.Add(this.vc_5, 4, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(282, 495); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(666, 105); this.tableLayoutPanel1.TabIndex = 8; // // vc_1 // this.vc_1.Dock = System.Windows.Forms.DockStyle.Fill; this.vc_1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.vc_1.Location = new System.Drawing.Point(5, 6); this.vc_1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.vc_1.Name = "vc_1"; this.vc_1.Size = new System.Drawing.Size(144, 93); this.vc_1.TabIndex = 0; this.vc_1.Title = "总收入=月薪x12"; this.vc_1.Value = "0"; // // vc_2 // this.vc_2.Dock = System.Windows.Forms.DockStyle.Fill; this.vc_2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.vc_2.Location = new System.Drawing.Point(157, 6); this.vc_2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.vc_2.Name = "vc_2"; this.vc_2.Size = new System.Drawing.Size(95, 93); this.vc_2.TabIndex = 1; this.vc_2.Title = "社保累计"; this.vc_2.Value = "0"; // // vc_3 // this.vc_3.Dock = System.Windows.Forms.DockStyle.Fill; this.vc_3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.vc_3.Location = new System.Drawing.Point(260, 6); this.vc_3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.vc_3.Name = "vc_3"; this.vc_3.Size = new System.Drawing.Size(115, 93); this.vc_3.TabIndex = 2; this.vc_3.Title = "公积金累计"; this.vc_3.Value = "0"; // // vc_4 // this.vc_4.Dock = System.Windows.Forms.DockStyle.Fill; this.vc_4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.vc_4.Location = new System.Drawing.Point(383, 6); this.vc_4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.vc_4.Name = "vc_4"; this.vc_4.Size = new System.Drawing.Size(134, 93); this.vc_4.TabIndex = 3; this.vc_4.Title = "个税累计"; this.vc_4.Value = "0"; // // vc_5 // this.vc_5.Dock = System.Windows.Forms.DockStyle.Fill; this.vc_5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.vc_5.Location = new System.Drawing.Point(525, 6); this.vc_5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.vc_5.Name = "vc_5"; this.vc_5.Size = new System.Drawing.Size(136, 93); this.vc_5.TabIndex = 4; this.vc_5.Title = "总结余"; this.vc_5.Value = "0"; // // columnHeader9 // this.columnHeader9.Text = "税点"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(960, 608); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.btn_Calc); this.Controls.Add(this.groupBox4); this.Controls.Add(this.label8); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "Form1"; this.Text = "2019年新税收政策个税计算器 - Powered by Auctus 深圳力同科技"; ((System.ComponentModel.ISupportInitialize)(this.num_Salar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.num_Shebao)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.num_gjj)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.num_Bing)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.num_Edu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.num_AdvEdu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.num_Parents)).EndInit(); this.groupBox4.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; private System.Windows.Forms.NumericUpDown num_Salar; private System.Windows.Forms.NumericUpDown num_Shebao; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.NumericUpDown num_gjj; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.NumericUpDown num_Bing; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label7; private System.Windows.Forms.NumericUpDown num_Edu; private System.Windows.Forms.NumericUpDown num_AdvEdu; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label6; private System.Windows.Forms.NumericUpDown num_Parents; private System.Windows.Forms.Label label5; private System.Windows.Forms.ListView lv_MonthData; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.ColumnHeader columnHeader2; private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.ColumnHeader columnHeader4; private System.Windows.Forms.ColumnHeader columnHeader5; private System.Windows.Forms.ColumnHeader columnHeader6; private System.Windows.Forms.ColumnHeader columnHeader7; private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.Label label8; private System.Windows.Forms.Button btn_Calc; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private ValueBlock vc_1; private ValueBlock vc_2; private ValueBlock vc_3; private ValueBlock vc_4; private System.Windows.Forms.ColumnHeader columnHeader8; private ValueBlock vc_5; private System.Windows.Forms.RadioButton radioButton3; private System.Windows.Forms.RadioButton rb_fang1000; private System.Windows.Forms.RadioButton rb_fang1500; private System.Windows.Forms.ColumnHeader columnHeader9; } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace TaxCalcer { public partial class ValueBlock : UserControl { public ValueBlock() { InitializeComponent(); } public string Title { get => lbl_Title.Text; set => lbl_Title.Text = value; } public string Value { get => lbl_Value.Text; set => lbl_Value.Text = value; } } }
namespace TaxCalcer { partial class ValueBlock { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region 组件设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.lbl_Title = new System.Windows.Forms.Label(); this.lbl_Value = new System.Windows.Forms.Label(); this.SuspendLayout(); // // lbl_Title // this.lbl_Title.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.lbl_Title.Dock = System.Windows.Forms.DockStyle.Top; this.lbl_Title.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); this.lbl_Title.Location = new System.Drawing.Point(0, 0); this.lbl_Title.Name = "lbl_Title"; this.lbl_Title.Size = new System.Drawing.Size(153, 40); this.lbl_Title.TabIndex = 0; this.lbl_Title.Text = "Title"; this.lbl_Title.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbl_Value // this.lbl_Value.BackColor = System.Drawing.Color.White; this.lbl_Value.Dock = System.Windows.Forms.DockStyle.Fill; this.lbl_Value.Font = new System.Drawing.Font("微软雅黑", 18F); this.lbl_Value.Location = new System.Drawing.Point(0, 40); this.lbl_Value.Name = "lbl_Value"; this.lbl_Value.Size = new System.Drawing.Size(153, 46); this.lbl_Value.TabIndex = 1; this.lbl_Value.Text = "0"; this.lbl_Value.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // ValueBlock // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.lbl_Value); this.Controls.Add(this.lbl_Title); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "ValueBlock"; this.Size = new System.Drawing.Size(153, 86); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Label lbl_Title; private System.Windows.Forms.Label lbl_Value; } }