Sie sind auf Seite 1von 11

login

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Login
{
public partial class Form1 : Form
{
int ctr;
public Form1()
{
InitializeComponent();
}

private void cmdlog_Click(object sender, EventArgs e)


{
string LoginName, Password;
LoginName = txtname.Text;
Password = txtpass.Text;
ctr = ctr + 1;
if ((LoginName == "SANTY") && (Password == "PASSWORD@1"))
{
lblMessage.Visible = true;
lblMessage.Text = "Welcome in the Life Line Hospital";
ctr = 0;
Life_Line_Hospital lh = new Life_Line_Hospital();
lh.Show();
this.Hide();
}
else if (ctr < 3)
{

MessageBox.Show("Please Check your Name and Password");


txtname.Focus();
}
else
{
MessageBox.Show("Unauttorized Access.Aborting...");
Close();
}
}

private void SEARCH_Click(object sender, EventArgs e)


{
System.Diagnostics.Process.Start("http://www.LIFE LINE
HOSPIATAL.com");
}

private void BROWSE_Click(object sender, EventArgs e)


{
FolderBrowserDialog folderbrobj = new FolderBrowserDialog();
folderbrobj.ShowDialog();
}

}
}
Doctor Details

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Login
{
public partial class Full_Doctors : Form
{
public Full_Doctors()
{
InitializeComponent();
}

private void Full_Doctors_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the
'pRDataSet2.Doctor_Details' table. You can move, or remove it, as needed.
this.doctor_DetailsTableAdapter.Fill(this.pRDataSet2.Doctor_Details);

private void cmdOK_Click(object sender, EventArgs e)


{
Life_Line_Hospital lh = new Life_Line_Hospital();
lh.Show();
this.Hide();
}

}
}

Patient Details

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Login
{
public partial class Full_patients : Form
{
public Full_patients()
{
InitializeComponent();
}

private void Full_patients_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the
'pRDataSet1.PATIENT_M' table. You can move, or remove it, as needed.
this.pATIENT_MTableAdapter.Fill(this.pRDataSet1.PATIENT_M);

private void cmdOK_Click(object sender, EventArgs e)


{
Life_Line_Hospital lh = new Life_Line_Hospital();
lh.Show();
this.Hide();
}

}
Medical History

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Login
{
public partial class Medical_History : Form
{
DataTable dt;
DataRow dr;
string code;
public Medical_History()
{
InitializeComponent();
}

private void cmdBack_Click(object sender, EventArgs e)


{
Life_Line_Hospital lh = new Life_Line_Hospital();
lh.Show();
this.Hide();
}

private void Medical_History_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the
'pRDataSet3.Medical_H' table. You can move, or remove it, as needed.
this.medical_HTableAdapter.Fill(this.pRDataSet3.Medical_H);
txtid.Enabled = false;
txtnam.Enabled = false;
txtadr.Enabled = false;
txtbgp.Enabled = false;
txtdnam.Enabled = false;
txtTre.Enabled = false;
txtmed.Enabled = false;
txtvd.Enabled = false;
cmdSave.Enabled = false;

private void cmdAdd_Click(object sender, EventArgs e)


{
cmdSave.Enabled = true;
txtid.Enabled = true;
txtnam.Enabled = true;
txtdnam.Enabled = true;
txtadr.Enabled = true;
txtbgp.Enabled = true;
txtdnam.Enabled = true;
txtTre.Enabled = true;
txtmed.Enabled = true;
txtvd.Enabled = true;
txtid.Text = "";
txtnam.Text = "";
txtadr.Text = "";
txtbgp.Text = "";
txtdnam.Text = "";
txtTre.Text = "";
txtmed.Text = "";
txtvd.Text = "";
int ctr, len;
string codeval;
dt = pRDataSet3.Tables["Medical_H"];
if (dt.Rows.Count >= 1)
{
len = dt.Rows.Count - 1;
dr = dt.Rows[len];
code = dr["Patient_ID"].ToString();
}
else
{
len = dt.Rows.Count;
code = "0";

}
codeval = code;
ctr = Convert.ToInt32(codeval);
if ((ctr >= 1) && (ctr < 9))
{
ctr = ctr + 1;
txtid.Text = "M00" + ctr;
}
else if ((ctr >= 9) && (ctr < 99))
{
ctr = ctr + 1;
txtid.Text = "M0" + ctr;
}
else if (ctr >= 99)
{
ctr = ctr + 1;
txtid.Text = "M" + ctr;
}
else
{
txtid.Text = "M001";
}
cmdAdd.Enabled = false;

private void cmdSave_Click(object sender, EventArgs e)


{
dt = pRDataSet3.Tables["Medical_H"];
dr = dt.NewRow();
dr[0] = txtid.Text.Substring(1, 3);
dr[1] = txtnam.Text;
dr[2] = txtadr.Text;
dr[3] = txtbgp.Text;
dr[4] = txtdnam.Text;
dr[5] = txtTre.Text;
dr[6] = txtmed.Text;
dr[7] = txtvd.Text;
dt.Rows.Add(dr);
medical_HTableAdapter.Update(pRDataSet3);
txtid.Text = System.Convert.ToString(dr[0]);
txtid.Enabled = false;
txtnam.Enabled = false;
txtadr.Enabled = false;
txtbgp.Enabled = false;
txtdnam.Enabled = false;
txtTre.Enabled = false;
txtmed.Enabled = false;
txtvd.Enabled = false;
this.medical_HTableAdapter.Fill(this.pRDataSet3.Medical_H);
cmdAdd.Enabled = true;
cmdSave.Enabled = false;
}

private void cmdDel_Click(object sender, EventArgs e)


{
string code;
code = txtid.Text;
dr = pRDataSet3.Tables["Medical_H"].Rows.Find(code);
dr.Delete();
medical_HTableAdapter.Update(pRDataSet3);
}

private void pictureBox1_Click(object sender, EventArgs e)


{

}
}
}

Logout

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Login
{
public partial class LogOut : Form
{
public LogOut()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{

//Form1 lg = new Form1();


//lg.Show();
//this.Hide();
Close();
}

}
}

Das könnte Ihnen auch gefallen