Using FOUNDER.BLL;
Using Founder.common;
Using Founder.model;
Using System;
Using System.Data;
Using System.Windows.Forms;
Namespace Founder.SndBus.CountingSys
{
public partial class FrmLogin:DevComponents.DotNetBar.Office2007Form//form
{
<summary>
Cashier's note-issuing authority
</summary>
Static readonly string sy_authority_id = system.configuration.configurationmanager.appsettings["sy_authority_id"];
<summary>
System name
</summary>
Static readonly string sys_name = system.configuration.configurationmanager.appsettings["SysName"];
<summary>
User Rights ID is empty
</summary>
Const string sy_authority_id_null = "user right ID is empty, please contact system Administrator";
Private string[] Arrloginresult = {"User login succeeded", "user does not exist", "User name or password is incorrect", "user does not have permission"};
HRSTAFFBLL HRSTAFFBLL = new HRSTAFFBLL ();
Public Frmlogin ()
{
InitializeComponent ();
This. MaximizeBox = false;
This. StartPosition = Formstartposition.centerscreen;
This. ActiveControl = This.txtname;
This. Text = "User Login";
if (string. IsNullOrEmpty (sy_authority_id))
{
MessageBox.Show (Sy_authority_id_null, "warning", MessageBoxButtons.OK, messageboxicon.warning);
}
Test value
This.txtName.Text = "100000";
This.txtPwd.Text = "1";
}
private void Btnlogin_click (object sender, EventArgs e)
{
if (String.IsNullOrEmpty (This.txtName.Text.Trim ()) | | String.IsNullOrEmpty (This.txtPwd.Text.Trim ()))
{
using (var ctx = new Oracledbcontext ())
//{
var test = new T_test {NAME = "1", value= "2"};
CTx. T_test. ADD (test);
CTx. SaveChanges ();
//}
Founder.DAL.SndBusDaoFactory SNDFAC = new DAL. Sndbusdaofactory ();
Founder.DAL.CASH_COINCENTERDao Ccdao = Sndfac.getcash_coincenterdao ();
Founder.Model.CASH_COINCENTER cc = new Founder.Model.CASH_COINCENTER ();
Cc.id= "1";
Cc. Coincode= "2";
Cc. busno= "3";
Cc. Fsdate= "4";
Ccdao.save (CC);
MessageBox.Show ("User name or password cannot be empty");
Return
}
SYSUSERBLL USERBLL = new SYSUSERBLL ();
var ires = Userbll.islogin (This.txtName.Text.Trim (), This.txtPwd.Text.Trim (), sy_authority_id);
if (Ires = = 0)
{
Globalvalue.jobnumber = This.txtName.Text.Trim ();
Hrstaff hr = HRSTAFFBLL.GETUSERINFOBYJB (This.txtName.Text.Trim ());
Globalvalue.username = hr. USERNAME;
This. DialogResult = Dialogresult.yes;
}
Else
{
MessageBox.Show (Arrloginresult[ires], "hint", MessageBoxButtons.OK, messageboxicon.warning);
}
}
private void Frmlogin_formclosing (object sender, FormClosingEventArgs e)
{
This. DialogResult = dialogresult.no;
}
private void Txtname_keydown (object sender, KeyEventArgs e)
{
if (E.keycode = = Keys.enter)
{
This.txtPwd.Focus ();
}
}
private void Txtpwd_keydown (object sender, KeyEventArgs e)
{
if (E.keycode = = Keys.enter)
{
This.btnLogin.Focus ();
}
}
private void Button1_Click (object sender, EventArgs e)
{
var sql = "Select username from sys_user where Ison=:ison";
var para = new {ISON = 1};
using (IDataReader rd = dapperhelper.executereader (SQL, para))
{
Try
{
if (Rd. Read ())
{
var name = rd["username"]. ToString ();
Rd. Dispose ();
Rd. Close ();
MessageBox.Show (name);
}
}
catch (Exception)
{
Throw
}
}
}
}
}
Deployment essentials:
This directory is a predefined special directory of the Microsoft operating system, cannot directly manipulate the files inside, can only be handled by command.
Start the Cmd.exe program, enter the following command line in the window, enter one command at a time, and the copy succeeds after the carriage return.
Copy C:\Windows\assembly\gac_msil\Microsoft.ReportViewer.Common\11.0.0.0__89845dcd8080cc91\ Microsoft.ReportViewer.Common.dll D:\ReportViewer
Copy C:\Windows\assembly\gac_msil\Microsoft.ReportViewer.WinForms\11.0.0.0__89845dcd8080cc91\ Microsoft.ReportViewer.WinForms.DLL D:\ReportViewer
Copy C:\Windows\assembly\gac_msil\Microsoft.ReportViewer.ProcessingObjectModel\11.0.0.0__89845dcd8080cc91\ Microsoft.ReportViewer.ProcessingObjectModel.DLL D:\ReportViewer
Copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.Types\11.0.0.0__89845dcd8080cc91\ Microsoft.SqlServer.Types.dll D:\ReportViewer
"Other DLLs replicate in a similar way"
After copying to the D-disk ReportViewer directory, copy it to the project's bin\debug directory and run the program again, everything is OK.
RDLC Self-reporting design, deployment