In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use C# to design the Winform zero-pressure gym management system. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
A corner of the project
Project introduction and demonstration
Based on development: Visual Studio 2019
Database: SQL Server2019
Landscaping plug-in: GUNA GUNA official website
Login and registration
Login registration must be an essential function point for a project. This figure demonstrates the realization of administrator registration and user registration, and the small icon of a long press password can display the password.
The following is a demonstration of the account of a registered administrator.
Display password function point implementation: write graphic code in the keyboard press event and keyboard pop-up event of the small icon
Enter the project
After reading the above, it's time to enter the system!
Hey, ━ ('∀') has entered the system.
You can see that our main interface is divided into two areas.
On the left is the menu bar area, and on the right is our functional area
Function point analysis
The menu is divided into six small function points, namely, consumption, member, heritage, commodity, message and exit.
Consumption
Introduce this function point: this is the first interface where the administrator logs in, and you can see the overall revenue of the entire store and the number of customers.
Highlights: user data and revenue are all displayed synchronously with the database
Note: some controls are third-party plug-ins
It can be seen that there is a member on the member menu, and the member has opened a card, and the system defaults to a card of 2 yuan. These data are well displayed in the graphical data of the consumer interface.
Function point implementation method: check the data in the database according to the required conditions, and assign the data to the control as many pieces of data are available.
Members
Introduce this function point: this is to achieve the addition, deletion, modification and search of members, and it is also closely related to the consumption menu.
Click add:
You can see that a window pops up. This is some basic information for adding members.
Click modify:
Assign the member information first to facilitate the modification of the management.
Click to delete:'
The deletion was successful, but here is a small detail. Let's go back to the consumer interface and take a look.
There are still 2 members here, but we no longer have member information in the member interface. Why?
Isn't it supposed to be synchronized with the consumer interface?
We know very well that data is valuable, so we delete it logically.
Specific implementation method of logical deletion: the individual actually adds a judgment condition to the SQL statement, and only when that condition is met can it be displayed in the GridView.
Click to print:
Printing this function point I have learned for a long time before I will apply it to my project, as for me to tell how to achieve it, with my skills still can not talk about it.
There is a specific GridView column name, can also be changed into a pdf format, convenient for us to print database data, as far as possible to optimize the user experience.
Implement print export
The heritage is actually similar to the function point of the commodity, so don't explain it too much here. Just show you the picture to see what the function point is.
Heritage module
Commodity module
The data of the commodity interface is also related to the user login interface, which will be explained later.
Message module
Use using System.Net.Mail
Contains classes for sending e-mail messages to a simple Mail transfer Protocol (SMTP) server for delivery.
You can see that the interface consists of a basic text box, a Gridview and a button.
The function point is that the mailbox can be sent. Let's take a look at the picture below.
Code implementation of function
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.Net;using System.Net.Mail;using System.Net.Mime;using BLL;namespace gym management {public partial class UserMessage: UserControl {public UserMessage () {InitializeComponent ();} huiyuanBLL hyb = new huiyuanBLL () Private void UserMessage_Load (object sender, EventArgs e) {jiazmail (); comboBox3.SelectedIndex = 0; comboBox1.SelectedIndex = 0;} public void jiazmail () {this.guna2DataGridView1.AutoGenerateColumns = false; this.guna2DataGridView1.DataSource = hyb.hydgvshow1 ();} private OpenFileDialog openFileDialog = new OpenFileDialog () Private void guna2Button2_Click (object sender, EventArgs e) {/ / add button if (this.openFileDialog.ShowDialog () = = System.Windows.Forms.DialogResult.OK) {this.fujietxt.Text = this.openFileDialog.FileName / / upload the attachment, open the dialog box, and get the client file}} private void guna2Button1_Click (object sender, EventArgs e) {/ / send button MailMessage msg = new MailMessage (); string connectpath= contenttxt.Text; string mailpath = mailtxt.Text / / sender QQ number string mailnextpath = comboBox3.Text; / / mailbox selected by sender string recipien = recipienttxt.Text; / / recipient QQ number string recipiennextpath = comboBox1.Text; / / mailbox selected by recipient string titlepath = titletxt.Text; / / title of the article msg.From = new MailAddress (mailpath.ToString () + mailnextpath) / / email address (host) msg.Body = connectpath; / / msg.Sender = new MailAddress (""); msg.To.Add (recipien.ToString () + recipiennextpath); / / email address to be accepted msg.Subject = titlepath; msg.IsBodyHtml = true; / / the email content is plain text by default! If you specify html content, you need to use isbodyHtml SmtpClient sc = new SmtpClient (); sc.Host = "smtp.qq.com"; / / this is not necessarily 163. depending on the mailbox model of your host, it can also be smtp.qq.com, smtp.126.com, smtp.yahoo.com, etc. Sc.Port = 25; NetworkCredential nc = new NetworkCredential () Nc.UserName = "123@qq.com"; / / Host mailbox name nc.Password = "hfshdfk"; / / Host mailbox password sc.Credentials = nc; if (this.fujietxt.Text! = "") {Attachment att = new Attachment (this.fujietxt.Text); msg.Attachments.Add (att) } else {} sc.Send (msg); MessageBox.Show ("sent successfully!") ;} user interface
Register a user number first
User login
Here you can see that login requires a user's CAPTCHA (random code), so how did this CAPTCHA come from?
In fact, this problem has already been thought of at the beginning of the design. When we add a user to the administrator interface, the system will generate a random code for itself, which will be used for the user's unique identity.
Come to a list of cases in which the user successfully logged in
You can see that this has successfully entered the user interface.
User interface function points: modify personal information, send messages, buy goods and about software
This interface focuses on personal information and purchases.
Personal information
Function point: click the personal avatar to modify personal information, modify personal information, and prompt to detect that personal information has been modified and re-log in.
Commodity purchase
The commodity data here comes from the data of the more administrator interface, where the user buys, the number of goods of the administrator will be reduced, and the personal points of the user will be reduced.
On how to use C# to design Winform zero-pressure gym management system here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.