Microsoft .NET Compact Framework Windows Mobile Personal Income Tax Calculation Small Applications [Additional Code]

xiaoxiao2021-03-06  100

Realize the mini program for personal income tax, using the vs.net and .NET framework, you will experience BREW and J2ME that use Microsoft .NET architecture, can be said to be a kind of enjoyment. Using system.drawing; using system.collections; using system.windows.form; using system.data;

namespace SmartDeviceApplication personal income {///

/// Summary description for Form1 /// 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 // InitializationComponent ();

// // Todo: add any constructor code after initializecomponent call ///} ///

/// Clean Up any resources being used. /// protected Override Void Dispose (BOOL Disposing) {base. Dispose (Disposing);} #Region Windows Form Designer generated code /// /// Required method for Designer Support - do not modifi //////// 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 . Form.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 = "Exit"; this.Menuitem1.click = new system.eventhandler (this.Menuitem1_click); ///Menuitem2 // this.Menuitem2.text = "Calculate"; 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";

////////////////Bobox1.items.add ("Beijing"); this.comboBox1.items.Add ("Shanghai"); this.comboBox1.items.Add ("Shenzhen"); this.comboBOX1. Items.Add ("Other Regions"); 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 = "Your income" ; // // label2 // this.label2.Location = new system.drawing.point (16, 72); this.label2.size = new system.drawing.size (96, 22); this.label2.text = "Your area"; //// 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 // THISTEM.DRAWING.POINT (16, 24); this.label3. Size = new system.drawing.size (80, 80); this.label3.text = "label3"; th Is.label3.visible = false; /// mainmenu2 // this.mainMenu2.Menuitems.add (this.MenuItem3); // // Menuitem3 // this.Menuitem3.Text = "OK"; this.Menuitem3.click = new system.eventhandler (this.Menuitem3_click); // // Form1 // this.backcolor = system.drawing.color = 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 = "

Personal income tax calculation ";} #ENDREGION

///

/// the main entry point for the application. ///

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; {V1 = 1000;} if (this.comboBox1.selected "== 1) {v1 = 1000;} if (this.comboBox1.selected" == 2) {v1 = 1600;} float v2 = float.parse (this.TextBox1 .Text.trim ()); if (Float.isnan (V2)) {Alert ("Enter the wage, salaries"); return;} float v3 = V2-v1; float result = 0; if (V3 < = 0) {Result = 0; Alert ("You need to pay personal income tax:" Result.Tostring () "yuan"); return;} if (v3 <= 500) {result = v3 * 0.05f; alert "You need to pay personal income tax:" Result.toString () "yuan"); Return;} if (v3 <= 2000) {result = v3 * 0.1f-25; Alert ("You need to pay personal income tax:" Result.toString () "yuan"); return;} if (v3 <= 5000) {result = v3 * 0.15f-125; Alert ("You need to pay personal income tax:" Result.toString () " Yuan "); Return;} IF (v3 <= 20000) {result = V3 * 0.2F-375; Alert (" You need to pay personal income tax: " Result. Totring () "yuan"); return;} if (v3 <= 40000) {result = V3 * 0.25f-1375; Alert ("You need to pay personal income tax:" Result.toString () "yuan") }}}} (V3 <= 60000) {result = V3 * 0.3F-3375; Alert ("You need to pay personal income tax:" Result.toString () "yuan"); return;} if (v3 < = 80000) {Result = V3 * 0.35F-6375; Alert ("You need to pay personal income tax:" Result.toTRING () "yuan"); return;} if (v3 <=

100000) {Result = V3 * 0.4F-10375; Alert ("You need to pay personal income tax:" Result.Tostring () "yuan"); return;} result = v3 * 0.45f-15375; alert ("you Personal income taxes need to be paid: " Result.toString () " yuan "); return;} catch {Alert (" Enter the wage, the salary is incorrect "); 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;}}}

转载请注明原文地址:https://www.9cbs.com/read-57224.html

New Post(0)