Five, other module design
There are a lot of other modules that need to be built and done on their own, and here are simply a few examples to look at the design of other modules. All we have to do is change the password module, customer Select module and about this software module. The Change password module is used to change the administrator's password, and the Customer selection dialog module is used to select the customer that has been added, information about the necessary information and the producer of the software module to illustrate the customer management system.
1. Change the password module
A sample diagram of the Change cipher module is:
The complete form code is:
<span style= "FONT-SIZE:18PX;" >using system;using system.collections.generic;using system.componentmodel;using System.Data;using System.drawing;using system.linq;using system.text;using system.threading.tasks;using System.Windows.Forms;using System.data.sqlclient;//introduced namespaces namespace client Management System {public partial class Changedpwd:form {Common cm = new com Mon ();//Load public class common Database db = new database ();//Load public class CHANGEDPWD ()//constructor { InitializeComponent (); private void Btn_close_click (object sender, EventArgs e) {close ();//close} private void Btn_change_click (object sender, EventArgs e) {if (TbOldPwd.Text.Trim (). Length <= 0)//Determine whether to enter the old password {MessageBox.Show ("Please enter the old password"); Tboldpwd.focus ();//Old Password box get focus return; } if (TbNewPwd.Text.Trim (). Length <= 0)//Determine whether to enter a new password {MESSAGEbox.show ("Please enter a new password"); Tbnewpwd.focus ();//New Password box to get focus return; } if (string. Compare (TbNewPwd.Text.Trim (), TbConfirmPwd.Text.Trim ())! = 0)//Determine if the new password is entered two times the same {MessageBox.Show (" Two times input new password inconsistent "); Tbnewpwd.focus ();//get focus return; } int t; String sql = "SELECT COUNT (*) from manager where Username= '" + tbUserName.Text.Trim () + "' and userpwd= '" + tboldpwd.text.t Rim () + "'"; t = db.runsqlint (SQL);//Assign the number of data bars in the corresponding table to T if (t>0)//old password correct {string updatesql = "Updat E Manager set userpwd= ' "+ tbNewPwd.Text.Trim () +" ' Where username= ' "+ tbUserName.Text.Trim () +" ' "; Db.runsql (updatesql);//Change Password MessageBox.Show ("Change Password succeeded! "); } else {MessageBox.Show ("Old Password input error! "); Tboldpwd.focus ();//Get Focus}}}}</span>
To run the entire program to change the password:
(1) Click Change Password to enter the Change password form:
(2) If the input two times the new password is inconsistent, the change password is unsuccessful:
(3) If the old password entered is wrong, the change password is unsuccessful:
(4) If the input is correct, the password change succeeds:
2, about this software module
Just probably know that there is this module on the line, there is not too much to put things on the form, a simple explanation of this module, in the main module select about the software about the software, will pop up about the software form.
Module design of customer management System (IX)