"From beginning to end-catering management System"-(v)
1, out of the purpose of this tutorial, on the one hand is to arouse everyone's enthusiasm and enthusiasm for software development, on the other hand, I have some experience and knowledge of software development to share to everyone. This tutorial if you have some help, very honored, if there is inappropriate, but also hope to forgive (do not spray ^_^).
2, this tutorial is only for learning exchange use, strictly prohibited for commercial purposes, in the case of no charge of others, and can mark the source of the tutorial (http://www.cnblogs.com/hfultrastrong/) , you can freely reproduced, Distribute and disseminate this tutorial.
3, if you find that this tutorial has any place to explain the error, you can comment on the blog below, or by email:[email protected] and I get in touch, I will be extremely grateful!
start!
1. Operation effect
2, the introduction of the corresponding namespace
Introduce the corresponding namespaces using System.Data.SqlClient;
3.
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;//to introduce a corresponding namespace using System.data.sqlclient;namespace cyms{public partial class Frm_login:form {public Frm_login () { InitializeComponent (); } #region Load events///<summary>//Load events///</summary>//<param name= "se NDEr "></param>//<param name=" E "></param> private void Frm_login_load (object sender, EventArgs e) {//bind skin Sunisoft.IrisSkin.SkinEngine s = new Sunisoft.IrisSkin.SkinEngine (); S.skinfile = @ "C:\Users\Administrator\Desktop\DeepCyan.ssk"; #endregion #region Login//<summary>//Login///</summary>//< ;p Aram Name= "sender" ></param>//<p Aram Name= "E" ></param> private void Btn_ok_click (object sender, EventArgs e) {//Judging text box is not an empty if (this.txt_Pwd.Text.Trim () = = "" "| | This.txt_UserName.Text.Trim () = = "") {MessageBox.Show ("account or password cannot be empty!) "," prompt "); Return }//parameterized data sqlparameter[] para = new sqlparameter[] {new SqlParameter ("@Us Ername ", This.txt_UserName.Text.Trim ()), New SqlParameter (" @Pwd ", This.txt_Pwd.Text.Trim ())}; Write SQL statement String sql = "Select Powername from tb_user WHERE UserName = @UserName and Pwd = @Pwd"; Execute SQL statement String powername = (string) Command.SQLHelper.ExcuteScalar (SQL, para); Determines whether the obtained permission name is null if it is empty, then represents no this account information if (powername! = null) {//enters the main form frm_m Ain f = new Frm_main (); Pass-through parameter F.name = this.txt_username.tExt F.power = Powername; Hide login Form this. Hide (); F.show (); } else {MessageBox.Show ("No This account information! "," prompt "); }} #endregion #region Enter login///<summary>//Enter login///</summary> <param name= "Sender" ></param>//<param name= "E" ></param> private void TX T_pwd_keydown (object sender, KeyEventArgs e) {if (E.keycode = = Keys.enter) { This.btn_ok_click (sender, E); }} #endregion #region Exit events///<summary>///Exit Events///</summary> <param name= "Sender" ></param>//<param name= "E" ></param> private void BT N_exit_click (object sender, EventArgs e) {if (MessageBox.Show ("Quit? "," hint ") = = System.Windows.Forms.DialogResuLt. OK) {this. Close (); }} #endregion}}
end!
2. Corresponding video address |
start!
Baidu Cloud: Http://pan.baidu.com/s/1ntoWkzR
end!
1, out of the purpose of this tutorial, on the one hand is to arouse everyone's enthusiasm and enthusiasm for software development, on the other hand, I have some experience and knowledge of software development to share to everyone. This tutorial if you have some help, very honored, if there is inappropriate, but also hope to forgive (do not spray ^_^).
2, this tutorial is only for learning exchange use, is strictly prohibited for commercial purposes, in the case of no other charges, and can mark the source of the tutorial (http://www.cnblogs.com/hfultrastrong/), you can freely reproduced, distributed, Propagate this tutorial.
3, if you find that this tutorial has any place to explain the error, you can comment on the blog below, or by email:[email protected] and I get in touch, I will be extremely grateful!
"From beginning to end-catering management System"-(v)