分享
 
 
 

Microsoft .NET Compact Framework Windows Mobile个人所得税计算小应用【附源码】

王朝c#·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

实现个人所得税计算的迷你程序,使用VS.NET及.NET框架精简版,您将体验到使用微软.NET架构的开发比之BREW与J2ME,可以说是一种享受。

using System;

using System.Drawing;

using System.Collections;

using System.Windows.Forms;

using System.Data;

namespace SmartDeviceApplication个人所得税

{

/// <summary>

/// Summary description for Form1.

/// </summary>

public class Form1 : System.Windows.Forms.Form

{

private System.Windows.Forms.TextBox textBox1;

private System.Windows.Forms.ComboBox comboBox1;

private System.Windows.Forms.Label label1;

private System.Windows.Forms.Label label2;

private System.Windows.Forms.MenuItem menuItem1;

private System.Windows.Forms.MenuItem menuItem2;

private System.Windows.Forms.Panel panel1;

private System.Windows.Forms.Label label3;

private System.Windows.Forms.MainMenu mainMenu2;

private System.Windows.Forms.MenuItem menuItem3;

private System.Windows.Forms.MainMenu mainMenu1;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

//

// TODO: Add any constructor code after InitializeComponent call

//

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.mainMenu1 = new System.Windows.Forms.MainMenu();

this.menuItem1 = new System.Windows.Forms.MenuItem();

this.menuItem2 = new System.Windows.Forms.MenuItem();

this.textBox1 = new System.Windows.Forms.TextBox();

this.comboBox1 = new System.Windows.Forms.ComboBox();

this.label1 = new System.Windows.Forms.Label();

this.label2 = new System.Windows.Forms.Label();

this.panel1 = new System.Windows.Forms.Panel();

this.label3 = new System.Windows.Forms.Label();

this.mainMenu2 = new System.Windows.Forms.MainMenu();

this.menuItem3 = new System.Windows.Forms.MenuItem();

//

// mainMenu1

//

this.mainMenu1.MenuItems.Add(this.menuItem1);

this.mainMenu1.MenuItems.Add(this.menuItem2);

//

// menuItem1

//

this.menuItem1.Text = "退出";

this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);

//

// menuItem2

//

this.menuItem2.Text = "计算";

this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);

//

// textBox1

//

this.textBox1.Location = new System.Drawing.Point(16, 32);

this.textBox1.Size = new System.Drawing.Size(128, 25);

this.textBox1.Text = "textBox1";

//

// comboBox1

//

this.comboBox1.Items.Add("北京");

this.comboBox1.Items.Add("上海");

this.comboBox1.Items.Add("深圳");

this.comboBox1.Items.Add("其他地区");

this.comboBox1.Location = new System.Drawing.Point(16, 96);

this.comboBox1.Size = new System.Drawing.Size(128, 26);

//

// label1

//

this.label1.Location = new System.Drawing.Point(16, 8);

this.label1.Size = new System.Drawing.Size(104, 22);

this.label1.Text = "您的收入";

//

// label2

//

this.label2.Location = new System.Drawing.Point(16, 72);

this.label2.Size = new System.Drawing.Size(96, 22);

this.label2.Text = "您所在的地区";

//

// panel1

//

this.panel1.Controls.Add(this.label3);

this.panel1.Location = new System.Drawing.Point(24, 40);

this.panel1.Size = new System.Drawing.Size(112, 112);

this.panel1.Visible = false;

//

// label3

//

this.label3.Location = new System.Drawing.Point(16, 24);

this.label3.Size = new System.Drawing.Size(80, 80);

this.label3.Text = "label3";

this.label3.Visible = false;

//

// mainMenu2

//

this.mainMenu2.MenuItems.Add(this.menuItem3);

//

// menuItem3

//

this.menuItem3.Text = "确定";

this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);

//

// Form1

//

this.BackColor = System.Drawing.Color.Gainsboro;

this.ClientSize = new System.Drawing.Size(170, 183);

this.Controls.Add(this.panel1);

this.Controls.Add(this.label2);

this.Controls.Add(this.label1);

this.Controls.Add(this.comboBox1);

this.Controls.Add(this.textBox1);

this.Menu = this.mainMenu1;

this.Text = "个人所得税计算";

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

static void Main()

{

Application.Run(new Form1());

}

private void menuItem1_Click(object sender, System.EventArgs e)

{

Application.Exit();

}

private void menuItem2_Click(object sender, System.EventArgs e)

{

cal();

this.Menu = this.mainMenu2;

}

private void cal()

{

try

{

float v1=800;

if(this.comboBox1.SelectedIndex==0)

{

v1=1000;

}

if(this.comboBox1.SelectedIndex==1)

{

v1=1000;

}

if(this.comboBox1.SelectedIndex==2)

{

v1=1600;

}

float v2=float.Parse(this.textBox1.Text.Trim());

if(float.IsNaN(v2))

{

alert("输入的工资、薪金不正确");

return ;

}

float v3=v2-v1;

float result=0;

if(v3<=0)

{

result=0;

alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=500)

{

result=v3*0.05f;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=2000)

{

result=v3*0.1f-25;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=5000)

{

result=v3*0.15f-125;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=20000)

{

result=v3*0.2f-375;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=40000)

{

result=v3*0.25f-1375;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=60000)

{

result=v3*0.3f-3375;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=80000)

{

result=v3*0.35f-6375;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

if(v3<=100000)

{

result=v3*0.4f-10375;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

result=v3*0.45f-15375;alert("您需要缴纳个人所得税:"+result.ToString()+"元");

return;

}

catch

{

alert("输入的工资、薪金不正确");return;

}

}

private void alert(string str)

{

this.label3.Text=str;

this.panel1.Visible =true;

this.label3.Visible=true;

}

private void menuItem3_Click(object sender, System.EventArgs e)

{

this.panel1.Visible=false;

this.label3.Visible=false;

this.Menu = this.mainMenu1;

}

}

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有