public string ClientID(int Room, int BedID) { MultiChecks Fix = new MultiChecks(); Search Get = new Search(); string ClientID = "", Temp = "תעודת זהות: "; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Map] WHERE [RoomID]='" + Room + "' AND [BedID]='" + BedID + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { ClientID = mySqlDataReader["ClientID"].ToString(); } mySqlDataReader.Close(); mySqlConnection.Close(); ClientID = Fix.Space(ClientID); Temp += ClientID; ClientID = Temp; return(ClientID); }
public string GetUserInfo(string Username) { string SQL = Set.SQLConnection(); User Get = new User(); MultiChecks Fetch = new MultiChecks(); string newstr = ""; SqlConnection mySqlConnection = new SqlConnection(SQL); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Login] WHERE [Username]='" + Username + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { newstr = mySqlDataReader["Title"].ToString(); } mySqlDataReader.Close(); mySqlConnection.Close(); newstr = Fetch.Space(newstr); newstr += " " + Get.FullName(Username); return(newstr); }
public string BedNumber(int Bed) { MultiChecks Fix = new MultiChecks(); string BedLabel = "מיטה מס' "; BedLabel += Bed.ToString(); return(BedLabel); }
public string Department(int Room, int BedID) { MultiChecks Fix = new MultiChecks(); string Department = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Map] WHERE [RoomID]='" + Room + "' AND [BedID]='" + BedID + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { Department = mySqlDataReader["Unit"].ToString(); } mySqlDataReader.Close(); mySqlConnection.Close(); Department = Fix.Space(Department); return(Department); }
public string Last(string a) { MultiChecks Fix = new MultiChecks(); string strs = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Clients] WHERE [ID]='" + a + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { strs += mySqlDataReader["Last"].ToString(); } mySqlDataReader.Close(); mySqlConnection.Close(); strs = Fix.Space(strs); return(strs); }
public string DeleteCheck(int MessageID) { string Delete = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Messages] WHERE [MessageID]='" + MessageID + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { Delete = mySqlDataReader["Deleted"].ToString(); } MultiChecks Check = new MultiChecks(); Delete = Check.Space(Delete); mySqlDataReader.Close(); mySqlConnection.Close(); return(Delete); }
public string Respond(int MessageID) { string SentForm = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Messages] WHERE [MessageID]='" + MessageID + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { SentForm = mySqlDataReader["SentFrom"].ToString(); } MultiChecks Check = new MultiChecks(); SentForm = Check.Space(SentForm); mySqlDataReader.Close(); mySqlConnection.Close(); return(SentForm); }
public string Department(string a) { string str = "", department = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Login] WHERE [Username]='" + a + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { department = mySqlDataReader["Department"].ToString(); } MultiChecks Remove = new MultiChecks(); str += Remove.Space(department); mySqlDataReader.Close(); mySqlConnection.Close(); return(str); }
public string FullName(string a) { string str = "", name = "", last = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Login] WHERE [Username]='" + a + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { last = mySqlDataReader["Last"].ToString(); name = mySqlDataReader["Name"].ToString(); } MultiChecks Remove = new MultiChecks(); str += Remove.Space(last) + " "; str += Remove.Space(name); mySqlDataReader.Close(); mySqlConnection.Close(); return(str); }
public int ViewMessage(int MessageID) { MultiChecks Get = new MultiChecks(); string SentDate = "", SentTime = "", SentFrom = "", Message = "", Title = "", FullName = ""; SqlConnection mySqlConnection = new SqlConnection(SQL()); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = "SELECT * FROM [Messages] WHERE [MessageID]='" + MessageID + "';"; mySqlConnection.Open(); SqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader(); while (mySqlDataReader.Read()) { SentFrom = mySqlDataReader["SentFrom"].ToString(); SentDate = mySqlDataReader["SentDate"].ToString(); SentTime = mySqlDataReader["SentTime"].ToString(); Message = mySqlDataReader["Message"].ToString(); Title = mySqlDataReader["TitleMessage"].ToString(); } FullName = Get.FullName(SentFrom); mySqlDataReader.Close(); mySqlConnection.Close(); SentFrom = Get.Space(SentFrom); if (SentFrom == "") { return(0); } FileStream f = new FileStream("Message.html", FileMode.Create); StreamWriter s = new StreamWriter(f); s.WriteLine("<html>"); s.WriteLine("<head>"); s.WriteLine("<meta charset =\"utf-8\">"); s.WriteLine("<title>" + MessageID + "</title>"); s.WriteLine("<style>"); s.WriteLine("table {"); s.WriteLine("font-size: 24px;"); s.WriteLine("background-color: white;"); s.WriteLine("}"); s.WriteLine("</style>"); s.WriteLine("</head>"); s.WriteLine("<body dir=\"rtl\" height=\"100%\">"); s.WriteLine("<table border=\"1\" width=\"100%\" valign=\"top\">"); s.WriteLine("<center>"); s.WriteLine("<font>"); s.WriteLine("<tr>"); s.WriteLine("<td colspan=\"5\" bgcolor=\"#9bcbff\"><br></td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td align=\"right\" colspan=\"5\"><h1>" + Title + "</h1></td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td width=\"30%\" align=\"right\"><table width=\"100%\" border=\"1\">"); s.WriteLine("<tr>"); s.WriteLine("<td colspan=\"2\" bgcolor=\"#9bcbff\">נשלח מאת:</td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td width=\"1%\" align=\"right\"><b><img src=\"../../Resources/" + SentFrom + ".png\" width=\"100px\" height=\"100px\"></td>"); s.WriteLine("<td align=\"center\">" + FullName + "</td>"); s.WriteLine("</tr>"); s.WriteLine("</table></td>"); s.WriteLine("<td colspan=\"3\" align=\"left\" valign=\"top\">"); s.WriteLine("<table border=\"0\" valign=\"top\" width=\"100%\">"); s.WriteLine("<tr valign=\"top\">"); s.WriteLine("<td valign=\"top\" colspan=\"4\" bgcolor=\"#9bcbff\"><br></td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td align=\"left\">התקבל בתאריך:</td>"); s.WriteLine("<td align=\"left\">" + SentDate + "</td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td align=\"left\" width=\"77%\">התקבל בשעה:</td>"); s.WriteLine("<td align=\"left\" width=\"1%\">" + SentTime + "</td>"); s.WriteLine("</tr>"); s.WriteLine("</table>"); s.WriteLine("</td>"); s.WriteLine("</tr>"); s.WriteLine("</table>"); s.WriteLine("<table border=\"1\" width=\"100%\" height=\"100%\" valign=\"top\">"); s.WriteLine("<tr>"); s.WriteLine("<td height=\"5%\" colspan=\"5\" bgcolor=\"#9bcbff\"><b>תוכן ההודעה</td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td colspan=\"5\" valign=\"top\"><br>" + Message + "</td>"); s.WriteLine("</tr>"); s.WriteLine("<tr>"); s.WriteLine("<td height=\"5%\" colspan=\"5\" bgcolor=\"#9bcbff\"><br></td>"); s.WriteLine("</tr>"); s.WriteLine("</font>"); s.WriteLine("</table>"); s.WriteLine("</body>"); s.WriteLine("</html>"); s.Close(); f.Close(); return(1); }