-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewPatient.aspx.cs
86 lines (70 loc) · 2.78 KB
/
NewPatient.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class NewPatient : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
ListItem item = new ListItem();
DBservices dbs = new DBservices();
List<Item> itemList = new List<Item>();
itemList = dbs.getItem();
foreach (Item x in itemList)
{
if (x.Category == "מחטים")
DDneedle.Items.Add(x.Name);
else
if (x.Category == "סליל")
DDcoil.Items.Add(x.Name);
else
if (x.Category == "שקית עירוי")
DDinfusionBag.Items.Add(x.Name);
else
if (x.Category == "תמיסה")
DDsolutions.Items.Add(x.Name);
}
}
catch (Exception ex)
{
ErrHandler.WriteError(ex.Message);
Response.Write("ארעה שגיאה");
}
}
protected void ButtonNewPatient_Click(object sender, EventArgs e)
{
try
{
DBservices dbs = new DBservices();
string Name = TBPatientName.Text;
string ID = TBPatientId.Text;
string Num = TBPatientNum.Text;
string Kupah = (DDPatientKupah.SelectedItem).ToString();
string Zantar = (DDPatientZantar.SelectedItem).ToString();
if (Zantar == "כן")
Zantar = "1";
else
Zantar = "0";
string needle = (DDneedle.SelectedItem).ToString();
string coil = (DDcoil.SelectedItem).ToString();
string infusionBag = (DDinfusionBag.SelectedItem).ToString();
string solutions = (DDsolutions.SelectedItem).ToString();
string USERname = (string)(Session["Name"]);
string USERpass = (string)(Session["Password"]);
string USERid = dbs.getWorkerID(USERname, USERpass);
string USERbranch = dbs.getWorkerBranch(USERid);
dbs.insertNewPatient(ID, Kupah, Num, Name, Zantar, USERbranch, needle, coil, infusionBag, solutions);
Response.Write("<script>alert('המטופל נשמר בהצלחה');</script>");
Response.Redirect("PatientList.aspx");
}
catch (Exception ex)
{
ErrHandler.WriteError(ex.Message);
Response.Write("קיימת בעיה אנא נסה שנית מאוחר יותר");
}
}
}