saba664
سه شنبه 30 آبان 1396, 08:59 صبح
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace finaldoctor2
{
public partial class Flogin : Form
{
public Flogin()
{
InitializeComponent();
}
LoginLogoutHandller LO = new LoginLogoutHandller();
ManegerHandller MH = new ManegerHandller();
ClerkHandller CH = new ClerkHandller ();
LoginLogout L;
private void login_Load(object sender, EventArgs e)
{
txtname.Enabled = false;
txtpass.Enabled = false;
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
txtname.Enabled = true;
txtpass.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
//Fmainf m = new Fmainf();
// this.Hide();
// m.Show();
if (txtpass.Text != "" && txtname.Text != "")
{
if (radioButton1.Checked)
{
if (LO.loginManager(txtname.Text, txtpass.Text))
{
Initializer.Managerid = MH.Getid(txtname.Text, txtpass.Text);
Initializer.Clerkid = 0;
L = new LoginLogout(Initializer.shelltime() + " , " + DateTime.Now.ToShortTimeString(), "نامعلوم", Initializer.Clerkid , Initializer.Managerid );
LO.RecordTraffic(L);
//MessageBox.Show(id.ToString());
Fmainf f = new finaldoctor2.Fmainf();
this.Hide();
f.ShowDialog();
}
else
MessageBox.Show("نام کاربری یا رمز عبور در سیستم تعریف نشده است", "توجه ", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
else if (radioButton2.Checked)
{
if (LO.loginClerk (txtname.Text, txtpass.Text))
{
Initializer.Clerkid = CH.Getid(txtname.Text, txtpass.Text);
Initializer.Managerid = 0;
L = new LoginLogout(Initializer.shelltime() + " , " + DateTime.Now.ToShortTimeString(), "نامعلوم", Initializer.Clerkid , Initializer.Managerid );
LO.RecordTraffic(L);
//int id = CH.GetId(txtUserName.Text, txtPass.Text);
//MessageBox.Show(id.ToString());
Fclerk f = new finaldoctor2.Fclerk();
this.Hide();
f.ShowDialog();
}
else
MessageBox.Show("نام کاربری یا رمز عبور در سیستم تعریف نشده است", "توجه ", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
else
MessageBox.Show("لطفا یکی از آیتم های مدیر یا صندوق دار را انتخاب کنید", "توجه ", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
else
MessageBox.Show("رمز عبور یا نام کاربری را وارد کنید ");
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
txtname.Enabled = true;
txtpass.Enabled = true;
}
private void button2_Click(object sender, EventArgs e)
{
txtname.Text = "";
txtpass.Text = "";
}
private void button3_Click(object sender, EventArgs e)
{
DialogResult dialog = MessageBox.Show("آیا مطمئن هستید؟", "خروج", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
if (dialog == DialogResult.Yes)
{
Application.Exit();
}
}
}
}
این کد منه
و کلاس هام هم به ترتیب
کلاس یوزر
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace finaldoctor2
{
public class User
{
protected string name;
public string Name
{
get { return name; }
set { name = value; }
}
protected string family;
public string Family
{
get { return family; }
set { family = value; }
}
protected string mobile;
public string Mobile
{
get { return mobile; }
set { mobile = value; }
}
protected string telwork;
public string Telwork
{
get { return telwork; }
set { telwork = value; }
}
protected string address;
public string Address
{
get { return address; }
set { address = value; }
}
protected string dateinsert;
public string Dateinsert
{
get { return dateinsert ; }
set { dateinsert = value; }
}
protected string nezam;
public string Nezam
{
get { return nezam; }
set { nezam = value; }
}
protected string code;
public string Code
{
get { return code ; }
set { code = value; }
}
protected string father;
public string Father
{
get { return father ; }
set { father = value; }
}
protected Boolean jenseyat;
public Boolean Jenseyat
{
get { return jenseyat ; }
set { jenseyat = value; }
}
protected string country;
public string Country
{
get { return country ; }
set { country = value; }
}
protected string shahrestan;
public string Shahrestan
{
get { return shahrestan ; }
set { shahrestan = value; }
}
protected string reshteh;
public string Reshteh
{
get { return reshteh; }
set { reshteh = value; }
}
protected Boolean madarak;
public Boolean Madarak
{
get { return madarak ; }
set { madarak = value; }
}
protected string vemployment;
public string Vemployment
{
get { return vemployment; }
set { vemployment = value; }
}
protected string khed1;
public string Khed1
{
get { return khed1 ; }
set { khed1 = value; }
}
protected string khed2;
public string Khed2
{
get { return khed2 ; }
set {khed2 = value; }
}
protected string khed3;
public string Khed3
{
get { return khed3 ; }
set { khed3 = value; }
}
protected string khed4;
public string Khed4
{
get { return khed4 ; }
set { khed4 = value; }
}
protected Boolean heat;
public Boolean Heat
{
get { return heat ; }
set { heat = value; }
}
protected Boolean matab;
public Boolean Matab
{
get { return matab ; }
set { matab = value; }
}
protected Boolean parvaneh;
public Boolean Parvaneh
{
get { return parvaneh ; }
set { parvaneh = value; }
}
protected Boolean vazeat;
public Boolean Vazeat
{
get { return vazeat ; }
set { vazeat = value; }
}
protected string mmt;
public string Mmt
{
get { return mmt ; }
set { mmt = value; }
}
protected byte photo;
public byte Photo
{
get { return photo ; }
set { photo = value; }
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace finaldoctor2
{
public partial class Flogin : Form
{
public Flogin()
{
InitializeComponent();
}
LoginLogoutHandller LO = new LoginLogoutHandller();
ManegerHandller MH = new ManegerHandller();
ClerkHandller CH = new ClerkHandller ();
LoginLogout L;
private void login_Load(object sender, EventArgs e)
{
txtname.Enabled = false;
txtpass.Enabled = false;
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
txtname.Enabled = true;
txtpass.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
//Fmainf m = new Fmainf();
// this.Hide();
// m.Show();
if (txtpass.Text != "" && txtname.Text != "")
{
if (radioButton1.Checked)
{
if (LO.loginManager(txtname.Text, txtpass.Text))
{
Initializer.Managerid = MH.Getid(txtname.Text, txtpass.Text);
Initializer.Clerkid = 0;
L = new LoginLogout(Initializer.shelltime() + " , " + DateTime.Now.ToShortTimeString(), "نامعلوم", Initializer.Clerkid , Initializer.Managerid );
LO.RecordTraffic(L);
//MessageBox.Show(id.ToString());
Fmainf f = new finaldoctor2.Fmainf();
this.Hide();
f.ShowDialog();
}
else
MessageBox.Show("نام کاربری یا رمز عبور در سیستم تعریف نشده است", "توجه ", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
else if (radioButton2.Checked)
{
if (LO.loginClerk (txtname.Text, txtpass.Text))
{
Initializer.Clerkid = CH.Getid(txtname.Text, txtpass.Text);
Initializer.Managerid = 0;
L = new LoginLogout(Initializer.shelltime() + " , " + DateTime.Now.ToShortTimeString(), "نامعلوم", Initializer.Clerkid , Initializer.Managerid );
LO.RecordTraffic(L);
//int id = CH.GetId(txtUserName.Text, txtPass.Text);
//MessageBox.Show(id.ToString());
Fclerk f = new finaldoctor2.Fclerk();
this.Hide();
f.ShowDialog();
}
else
MessageBox.Show("نام کاربری یا رمز عبور در سیستم تعریف نشده است", "توجه ", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
else
MessageBox.Show("لطفا یکی از آیتم های مدیر یا صندوق دار را انتخاب کنید", "توجه ", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
else
MessageBox.Show("رمز عبور یا نام کاربری را وارد کنید ");
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
txtname.Enabled = true;
txtpass.Enabled = true;
}
private void button2_Click(object sender, EventArgs e)
{
txtname.Text = "";
txtpass.Text = "";
}
private void button3_Click(object sender, EventArgs e)
{
DialogResult dialog = MessageBox.Show("آیا مطمئن هستید؟", "خروج", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
if (dialog == DialogResult.Yes)
{
Application.Exit();
}
}
}
}
این کد منه
و کلاس هام هم به ترتیب
کلاس یوزر
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace finaldoctor2
{
public class User
{
protected string name;
public string Name
{
get { return name; }
set { name = value; }
}
protected string family;
public string Family
{
get { return family; }
set { family = value; }
}
protected string mobile;
public string Mobile
{
get { return mobile; }
set { mobile = value; }
}
protected string telwork;
public string Telwork
{
get { return telwork; }
set { telwork = value; }
}
protected string address;
public string Address
{
get { return address; }
set { address = value; }
}
protected string dateinsert;
public string Dateinsert
{
get { return dateinsert ; }
set { dateinsert = value; }
}
protected string nezam;
public string Nezam
{
get { return nezam; }
set { nezam = value; }
}
protected string code;
public string Code
{
get { return code ; }
set { code = value; }
}
protected string father;
public string Father
{
get { return father ; }
set { father = value; }
}
protected Boolean jenseyat;
public Boolean Jenseyat
{
get { return jenseyat ; }
set { jenseyat = value; }
}
protected string country;
public string Country
{
get { return country ; }
set { country = value; }
}
protected string shahrestan;
public string Shahrestan
{
get { return shahrestan ; }
set { shahrestan = value; }
}
protected string reshteh;
public string Reshteh
{
get { return reshteh; }
set { reshteh = value; }
}
protected Boolean madarak;
public Boolean Madarak
{
get { return madarak ; }
set { madarak = value; }
}
protected string vemployment;
public string Vemployment
{
get { return vemployment; }
set { vemployment = value; }
}
protected string khed1;
public string Khed1
{
get { return khed1 ; }
set { khed1 = value; }
}
protected string khed2;
public string Khed2
{
get { return khed2 ; }
set {khed2 = value; }
}
protected string khed3;
public string Khed3
{
get { return khed3 ; }
set { khed3 = value; }
}
protected string khed4;
public string Khed4
{
get { return khed4 ; }
set { khed4 = value; }
}
protected Boolean heat;
public Boolean Heat
{
get { return heat ; }
set { heat = value; }
}
protected Boolean matab;
public Boolean Matab
{
get { return matab ; }
set { matab = value; }
}
protected Boolean parvaneh;
public Boolean Parvaneh
{
get { return parvaneh ; }
set { parvaneh = value; }
}
protected Boolean vazeat;
public Boolean Vazeat
{
get { return vazeat ; }
set { vazeat = value; }
}
protected string mmt;
public string Mmt
{
get { return mmt ; }
set { mmt = value; }
}
protected byte photo;
public byte Photo
{
get { return photo ; }
set { photo = value; }
}
}
}