diff --git a/BE/ATM.cs b/BE/ATM.cs
new file mode 100644
index 0000000..59a98fb
--- /dev/null
+++ b/BE/ATM.cs
@@ -0,0 +1,190 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BE
+{
+
+ // NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
+ ///
+ [System.SerializableAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
+ [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
+ public partial class ATM
+ {
+
+ private string קוד_בנקField;
+
+ private string שם_בנקField;
+
+ private string קוד_סניףField;
+
+ private string כתובת_הATMField;
+
+ private string ישובField;
+
+ private string עמלהField;
+
+ private string סוג_ATMField;
+
+ private string מיקום_הATM_ביחס_לסניףField;
+
+ private string גישה_לנכיםField;
+
+ private string קואורדינטת_XField;
+
+ private string קואורדינטת_YField;
+
+ ///
+ public string קוד_בנק
+ {
+ get
+ {
+ return this.קוד_בנקField;
+ }
+ set
+ {
+ this.קוד_בנקField = value;
+ }
+ }
+
+ ///
+ public string שם_בנק
+ {
+ get
+ {
+ return this.שם_בנקField;
+ }
+ set
+ {
+ this.שם_בנקField = value;
+ }
+ }
+
+ ///
+ public string קוד_סניף
+ {
+ get
+ {
+ return this.קוד_סניףField;
+ }
+ set
+ {
+ this.קוד_סניףField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("כתובת_ה-ATM")]
+ public string כתובת_הATM
+ {
+ get
+ {
+ return this.כתובת_הATMField;
+ }
+ set
+ {
+ this.כתובת_הATMField = value;
+ }
+ }
+
+ ///
+ public string ישוב
+ {
+ get
+ {
+ return this.ישובField;
+ }
+ set
+ {
+ this.ישובField = value;
+ }
+ }
+
+ ///
+ public string עמלה
+ {
+ get
+ {
+ return this.עמלהField;
+ }
+ set
+ {
+ this.עמלהField = value;
+ }
+ }
+
+ ///
+ public string סוג_ATM
+ {
+ get
+ {
+ return this.סוג_ATMField;
+ }
+ set
+ {
+ this.סוג_ATMField = value;
+ }
+ }
+
+ ///
+ [System.Xml.Serialization.XmlElementAttribute("מיקום_ה-ATM_ביחס_לסניף")]
+ public string מיקום_הATM_ביחס_לסניף
+ {
+ get
+ {
+ return this.מיקום_הATM_ביחס_לסניףField;
+ }
+ set
+ {
+ this.מיקום_הATM_ביחס_לסניףField = value;
+ }
+ }
+
+ ///
+ public string גישה_לנכים
+ {
+ get
+ {
+ return this.גישה_לנכיםField;
+ }
+ set
+ {
+ this.גישה_לנכיםField = value;
+ }
+ }
+
+ ///
+ public string קואורדינטת_X
+ {
+ get
+ {
+ return this.קואורדינטת_XField;
+ }
+ set
+ {
+ this.קואורדינטת_XField = value;
+ }
+ }
+
+ ///
+ public string קואורדינטת_Y
+ {
+ get
+ {
+ return this.קואורדינטת_YField;
+ }
+ set
+ {
+ this.קואורדינטת_YField = value;
+ }
+ }
+ }
+
+
+}
+
+
diff --git a/BE/BE.csproj b/BE/BE.csproj
index 83a736a..1ebe528 100644
--- a/BE/BE.csproj
+++ b/BE/BE.csproj
@@ -41,7 +41,9 @@
+
+
diff --git a/BE/BankDetails.cs b/BE/BankDetails.cs
new file mode 100644
index 0000000..387eaba
--- /dev/null
+++ b/BE/BankDetails.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BE
+{
+ public class BankDetails
+ {
+ public int BankNumber { get; set; }
+ public String BankName { get; set; }
+ public List Branches;
+ }
+
+ public class BankBranch
+ {
+ public int BranchNumber { get; set; }
+ public String BranchCity { get; set; }
+ }
+}
diff --git a/BE/Enum.cs b/BE/Enum.cs
index 177db34..ce7d756 100644
--- a/BE/Enum.cs
+++ b/BE/Enum.cs
@@ -27,10 +27,13 @@ public enum HostingType
Zimmer, Hotel, Camping, RentingRoom
}
- public enum Requirements
+ public enum GestRequirements
{
Necessary, Possible, NotNecessary
}
-
+ public enum UnitRequirements
+ {
+ Available, NotAvailable
+ }
}
\ No newline at end of file
diff --git a/BE/HostingUnit.cs b/BE/HostingUnit.cs
index 95cdae2..b0611d8 100644
--- a/BE/HostingUnit.cs
+++ b/BE/HostingUnit.cs
@@ -15,20 +15,8 @@ public class HostingUnit : requirement
public int HostingUnitKey { get; set; }
public Host Owner { get; set; }
public String HostingUnitName { get; set; }
-
-
- [XmlIgnore]
- //public bool[,] Diary { get; private set; }
public List Diary { get; set; }
-
- //[XmlArray("Diary")]
- //public bool[] DiaryDto
- //{
- // get { return Diary.Flatten(); }
- // set { Diary = value.Expand(12); }
- //}
-
-
+
public HostingUnit()
{
Diary = new List();
diff --git a/BE/Order.cs b/BE/Order.cs
index a862ebc..1a62505 100644
--- a/BE/Order.cs
+++ b/BE/Order.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,6 +19,7 @@ public class Order
public DateTime OrderDate { get; set; }
public DateTime CreateDate { get; set; }
+
public OrderStatus Status { get; set; }
public override string ToString()
diff --git a/BE/requirement.cs b/BE/requirement.cs
index 0d29c33..3ae55d0 100644
--- a/BE/requirement.cs
+++ b/BE/requirement.cs
@@ -10,22 +10,20 @@ namespace BE
[Serializable]
public class requirement
{
-
public Area Area { get; set; }
public String SubArea { get; set; }
public HostingType HostingType { get; set; }
- public int Adults { get; set; }
+ public int Adults { get; set; }
public int Children { get; set; }
- public Requirements Pool { get; set; }
- public Requirements Jacuzzi { get; set; }
- public Requirements Garden { get; set; }
- public Requirements ChildrensAttractions { get; set; }
- //********************
- public Requirements SpredBads { get; set; }
- public Requirements AirCondsner { get; set; }
- public Requirements frisider { get; set; }
- public Requirements SingogNaerBy { get; set; }
- public Requirements NaerPublicTrensportion { get; set; }
+ public GestRequirements Pool { get; set; }
+ public GestRequirements Jacuzzi { get; set; }
+ public GestRequirements Garden { get; set; }
+ public GestRequirements ChildrensAttractions { get; set; }
+ public GestRequirements SpredBads { get; set; }
+ public GestRequirements AirCondsner { get; set; }
+ public GestRequirements frisider { get; set; }
+ public GestRequirements SingogNaerBy { get; set; }
+ public GestRequirements NaerPublicTrensportion { get; set; }
///
/// to-string
diff --git a/BL/FactorySingletonBL.cs b/BL/FactorySingletonBL.cs
index 6cafef1..43a7d71 100644
--- a/BL/FactorySingletonBL.cs
+++ b/BL/FactorySingletonBL.cs
@@ -6,7 +6,7 @@
namespace BL
{
- public class FactorySingletonBL
+ public static class FactorySingletonBL
{
private static MyBl instance = null;
diff --git a/BL/IBL.cs b/BL/IBL.cs
index c6d6f1f..4710612 100644
--- a/BL/IBL.cs
+++ b/BL/IBL.cs
@@ -1,4 +1,4 @@
-using BE;
+using BE;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,6 +11,7 @@ interface IBL
{
bool IsDateCorrect(DateTime start, DateTime end);
bool IsAccountCharged(Host host);
+
bool IsDateAvailable(DateTime start, DateTime end, int unitKey);
void CloseOrder(Order order);
void SendMail(Order order);
@@ -22,6 +23,7 @@ interface IBL
List OrdersUntilDate(int days);
int OrdersPerClient(GuestRequest req);
int OrdersPerUnit(HostingUnit unit);
+
bool AddGuestRequest(GuestRequest req);
void AddHostingUnit(HostingUnit unit);
IEnumerable GuestRequestBy(Func predicate = null);
@@ -29,4 +31,5 @@ interface IBL
double averageOrdersPerHostingUnit();
}
-}
\ No newline at end of file
+}
+
diff --git a/BL/MyBl.cs b/BL/MyBl.cs
index c9f0e8f..781a52b 100644
--- a/BL/MyBl.cs
+++ b/BL/MyBl.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using BE;
-using System.Reflection;
-
using DAL;
using System.Net.Mail;
using System.Net;
@@ -14,24 +12,34 @@ namespace BL
{
public class MyBl : IBL
{
- DalXML myDAL = new DalXML();
-
+
+ DalXML myDAL = FactorySingletonDal.Instance;
+ MailMessage mail;
///
/// Add Guest Request
///
public bool AddGuestRequest(GuestRequest req)
{
-
- if (myDAL.ReturnGuestRequestList((x) => x.GuestRequestKey == req.GuestRequestKey).ToList().Count == 0)
+ if (IsDateCorrect(req.EntryDate, req.ReleaseDate))
{
- myDAL.addGuestRequest(req);
- return true;
+
+ try
+ {
+ myDAL.addGuestRequest(req);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ //throw new Exception("Fail to add this Guest Request! " + ex);
+ return false;
+ }
}
else
{
+ //throw new Exception("can't add this request, Release Date before Entry Date!");
return false;
}
-
+
}
///
@@ -39,14 +47,9 @@ public bool AddGuestRequest(GuestRequest req)
///
public void AddHostingUnit(HostingUnit unit)
{
- if (myDAL.ReturnHostingUnitList((x) => x.HostingUnitKey == unit.HostingUnitKey).ToList().Count == 0)
- {
+
myDAL.addHostingUnit(unit);
- }
- else
- {
- throw new Exception("This Hosting unit exist already!");
- }
+
}
@@ -55,17 +58,38 @@ public void AddHostingUnit(HostingUnit unit)
///
public bool AddOrder(Order neworder)
{
+ try
+ {
+ var req = GetGusetRequest(neworder.GuestRequestKey);
+ var unit = GetHostingUnit(neworder.HostingUnitKey);
- //Order order = instance.ReturenAllOrders((x)=> x.OrderKey == neworder.OrderKey).First();
- //if (order.Status == OrderStatus.CloseByClient || order.Status == OrderStatus.CloseByClientTimeOut)
- //{
- // return false;
- //}
- //else
- //{
- myDAL.addOrder(neworder);
- //}
- return true;
+ if (IsDateAvailable(req.EntryDate, req.ReleaseDate, neworder.HostingUnitKey))
+ {
+ myDAL.addOrder(neworder);
+ for (var i = req.EntryDate; i <= req.ReleaseDate; i = i.AddDays(1))
+ {
+ unit.Diary.Add(i);
+
+ }
+ UpdateUnit(unit);
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+
+
+ }
+ catch (Exception)
+ {
+
+ return false;
+ }
+
+
+
}
///
@@ -95,9 +119,79 @@ public void CloseOrder(Order order)
}
}
+
+ ///
+ /// Add new Host
+ ///
+ public bool AddHost(Host host)
+ {
+
+ try
+ {
+ myDAL.addHost(host);
+ return true;
+ }
+ catch(Exception ex)
+ {
+ throw new Exception("Fail to add the host! "+ex);
+ }
+
+ }
+
+ ///
+ /// Update Host
+ ///
+ ///
+ public void UpdateHost(Host host)
+ {
+ try
+ {
+ myDAL.UpdateHost(host);
+ MessageBox.Show($"Host: {host.FamilyName} updated Seccessfuly!");
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"Error during Update {host.FamilyName} please try again later! " + ex);
+ }
+ }
+
+ ///
+ /// Remove Host and all is units
+ ///
+ ///
public void RemoveHost(Host host)
{
- throw new NotImplementedException();
+ //check if all the unit that blonge to this host can be deleted
+ foreach (var unit in myDAL.ReturnHostingUnitList(x => x.Owner.HostKey == host.HostKey))
+ {
+ if (!CanUnitBeDeleted(unit.HostingUnitKey))
+ {
+ throw new Exception("Can't delete the Host, whan some order still open in some of the units!");
+ }
+ }
+
+ //delete all the unit that blonge to this host
+ foreach (var unit in myDAL.ReturnHostingUnitList(x => x.Owner.HostKey == host.HostKey))
+ {
+ try
+ {
+ UnitRemove(unit.HostingUnitKey);
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("Fail to delete the Host " + ex);
+ }
+ }
+
+ //delete the host
+ try
+ {
+ myDAL.DeleteHost(host);
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("Fail to delete the Host, but delete all is HostingUnit " + ex);
+ }
}
///
@@ -108,7 +202,7 @@ public bool IsDateAvailable(DateTime start, DateTime end, int unitKey)
HostingUnit x = GetHostingUnit(unitKey);
start.AddDays(1);
- for (DateTime i = start; i < end; i.AddDays(1))
+ for (DateTime i = start; i < end; i = i.AddDays(1))
{
if (x.Diary.FindIndex((z) => z == i) != -1)
{
@@ -125,12 +219,7 @@ public bool IsDateAvailable(DateTime start, DateTime end, int unitKey)
///
public bool IsDateCorrect(DateTime start, DateTime end)
{
- return(end > start)? true:false;
- }
-
- public void UpdateHost(Host host)
- {
- throw new NotImplementedException();
+ return (end > start) ? true : false;
}
///
@@ -147,23 +236,7 @@ public int NumOfDays(DateTime date)
public int NumOfDays(DateTime firstDate, DateTime SecondDate)
{
return (int)(SecondDate - firstDate).TotalDays;
- }
-
- ///
- /// Sending Email to client
- ///
- //public void SendMail(Order order)
- //{
- // if (order.Status == OrderStatus.MailSent)
- // {
- // Console.WriteLine(
- // $"You order:\n" +
- // $"Create Date: {order.CreateDate}\n" +
- // $"Order Date: {order.OrderDate}\n" +
- // $"Hosting Unit Key: {order.HostingUnitKey}\n"
- // );
- // }
- //}
+ }
///
/// Return number of orders that sent to client
@@ -204,13 +277,9 @@ public int OrdersPerUnit(HostingUnit unit)
///
public void UnitRemove(int unitKey)
{
- foreach (var item in myDAL.ReturenAllOrders())
- {
- if ((item.HostingUnitKey == unitKey) && (item.Status == OrderStatus.UntreatedYet))
- {
- throw new Exception("Can't delete this unit, whan some order still open!");
- }
- }
+ if(!CanUnitBeDeleted(unitKey))
+ throw new Exception("Can't delete this unit, whan some order still open!");
+
HostingUnit hostingUnit = GetHostingUnit(Convert.ToInt32(unitKey));
try
{
@@ -218,8 +287,25 @@ public void UnitRemove(int unitKey)
}
catch (Exception ex)
{
- throw new Exception("" + ex);
+ throw new Exception("Fail to delete the unit! " + ex);
+ }
+ }
+
+ ///
+ /// Can Unit Be Deleted? jest if no order that conected to this unit, have Status Untreated Yet!
+ ///
+ ///
+ ///
+ private bool CanUnitBeDeleted(int unitKey)
+ {
+ foreach (var order in myDAL.ReturenAllOrders())
+ {
+ if ((order.HostingUnitKey == unitKey) && (order.Status == OrderStatus.MailSent))
+ {
+ return false;
+ }
}
+ return true;
}
///
@@ -230,8 +316,8 @@ public void UpdateUnit(HostingUnit hostingUnit)
{
try
{
- UnitRemove(hostingUnit.HostingUnitKey);
- AddHostingUnit(hostingUnit);
+
+ myDAL.UpdateHostingUnit(hostingUnit);
MessageBox.Show($"Hosting unit: {hostingUnit.HostingUnitName} updated Seccessfuly!");
}
catch (Exception ex)
@@ -240,8 +326,6 @@ public void UpdateUnit(HostingUnit hostingUnit)
}
}
-
-
///
/// Return all units available in given date range
///
@@ -264,26 +348,7 @@ public List UintsAvailable(DateTime start, int numOfDays)
return listOfUnits;
}
- ///
- /// Add new Host
- ///
- public bool AddHost(Host host)
- {
- if (myDAL.returnHostList((x) => x.HostKey == host.HostKey).ToList().Count == 0)
- {
- myDAL.addHost(host);
- return true;
- }
- else
- {
- return false;
- }
-
-
-
-
- }
-
+
///
/// Return Guest Request By any requirment
///
@@ -342,7 +407,7 @@ public List OrdersUntilDate(int days)
///
GuestRequest GetGusetRequest(int key)
{
- return (myDAL.ReturnGuestRequestList(x => x.GuestRequestKey == key)).First();
+ return (myDAL.ReturnGuestRequestList(x => x.GuestRequestKey == key)).FirstOrDefault();
}
///
@@ -352,7 +417,18 @@ GuestRequest GetGusetRequest(int key)
///
public HostingUnit GetHostingUnit(int key)
{
- return (myDAL.ReturnHostingUnitList(x => x.HostingUnitKey == key)).First();
+ try
+ {
+ var unit = (myDAL.ReturnHostingUnitList(x => x.HostingUnitKey == key)).FirstOrDefault();
+ return unit;
+ }
+ catch (Exception)
+ {
+
+ MessageBox.Show("No Hosting Unit No Show");
+ return new HostingUnit();
+ }
+
}
#endregion
@@ -446,7 +522,7 @@ public Dictionary GuestRequestPerArea()
{ Area.South , GuestRequestBy().Count(p => p.Area == Area.South) }
};
}
- public Dictionary GuestRequestPerRquirement(Requirements requirements)
+ public Dictionary GuestRequestPerRquirement(GestRequirements requirements)
{
return new Dictionary
{
@@ -524,7 +600,7 @@ public IEnumerable GetGuestRequestKeysList(IEnumerable lis
return result;
}
*/
-
+
///
@@ -580,48 +656,38 @@ public double averageOrdersPerHostingUnit()
///
/// BootingUp the progrem.
- /// 1) Receive bank data from the web
- /// 2)
+ /// 1)Refresh Database
///
- public void bootingUp()
+
+
+ ///
+ /// run on Order database and if Month pass for Order and the status is mail-send it change to CloseByClientTimeOut
+ ///
+ public void RefreshDatabase()
{
+
try
{
- Thread thread = new Thread(GetBankInfoFromTheWeb);
- thread.Start();
+ TimeSpan timeSpan = new TimeSpan(30, 0, 0, 0, 0);
+ var t = from order in GetOrders(x => (DateTime.Now - x.OrderDate) > timeSpan)
+ where order.Status == OrderStatus.MailSent
+ select order.Status = OrderStatus.CloseByClientTimeOut;
}
catch (Exception ex)
{
- // throw new Exception("Can't get bank info from the web " + ex);
- MessageBox.Show("Can't get bank info from the web\n " + ex);
- }
-
- if(NewDay())
- {
- try
- {
- Thread thread = new Thread(RefreshDatabase);
- thread.Start();
- }
- catch (Exception ex)
- {
- // throw new Exception("Can't get bank info from the web " + ex);
- MessageBox.Show("Fail to refresh the database! \n " + ex);
- }
+ MessageBox.Show("Fail to refresh the database! \n " + ex.Message);
}
-
+
}
- private void RefreshDatabase() { }
- private bool NewDay() { return true; }
-
///
/// Sending Email to client
///
public void SendMail(Order order)
{
MailMessage mail = new MailMessage();
- mail.To.Add(GuestRequestBy(x => x.GuestRequestKey == order.GuestRequestKey).First().MailAddress);
+ //mail.To.Add(GuestRequestBy(x => x.GuestRequestKey == order.GuestRequestKey).First().MailAddress);
+ mail.To.Add((GetGusetRequest(order.GuestRequestKey).MailAddress).ToString());
mail.From = new MailAddress(GetHostingUnit(order.HostingUnitKey).Owner.MailAddress);
mail.Subject = "Resort offeras as you request";
mail.Body = "You'r request:
" +
@@ -635,8 +701,8 @@ public void SendMail(Order order)
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
- smtp.Credentials = new System.Net.NetworkCredential("ipewzner@g.jct.ac.il", "Reptor17");
- // smtp.Credentials = from;
+ smtp.Credentials = new System.Net.NetworkCredential("ipewzner@g.jct.ac.il", "Reptor17");
+ // smtp.Credentials = from;
smtp.EnableSsl = true;
try
@@ -657,16 +723,13 @@ public void SendMail(Order order)
///
public void SendMailWithNewPassword(Host host)
{
- // Manager manager = new Manager();
- // manager.MailAddress = "dotnetproject2020@gmail.com";
var rand = new Random();
int password = rand.Next(10000000, 99999999);
host.PasswordKey = KeyForPassword(password);
- MailMessage mail = new MailMessage();
+ mail = new MailMessage();
mail.To.Add(host.MailAddress);
- // mail.From = new MailAddress("ipewzner@g.jct.ac.il");
- mail.From = new MailAddress(" dotnetproject2020 @gmail.com");
+ mail.From = new MailAddress("dotnetproject2020@gmail.com");
mail.Subject = "New password - do not replay!";
mail.Body = "You'r new password is: " + password +
@@ -678,16 +741,51 @@ public void SendMailWithNewPassword(Host host)
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new System.Net.NetworkCredential("dotnetproject2020@gmail.com", "kuku4ever");
smtp.EnableSsl = true;
-
try
{
- smtp.Send(mail);
+ // smtp.Send(mail);
+ string userState = "test message1";
+ smtp.SendCompleted += Smtp_SendCompleted;
+ smtp.SendAsync(mail, userState);
}
- catch (Exception ex)
+ catch (SmtpFailedRecipientsException ex)
{
- throw new Exception("Email error " + ex);
+ MessageBox.Show(ex.Message+ " Can't send the message for one or more of the recipients");
}
+ catch (SmtpException ex)
+ {
+ MessageBox.Show(ex.Message + " Server conction error");
+ }
+ catch (ArgumentNullException ex)
+ {
+ MessageBox.Show(ex.Message + " Message is empty");
+ }
+ catch (InvalidOperationException ex)
+ {
+ MessageBox.Show(ex.Message + "Some info is missing or incorrect");
+ }
+
+ }
+
+ private void Smtp_SendCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
+ {
+ String token = (string)e.UserState;
+ if (e.Cancelled)
+ {
+ MessageBox.Show(" Send canceled."+ token);
+ }
+ if (e.Error != null)
+ {
+ MessageBox.Show(""+ token+ e.Error.ToString());
+ }
+ else
+ {
+ MessageBox.Show("Message sent.");
+ }
+ mail.Dispose();
+
+ //mailSent = true;
}
///
@@ -750,6 +848,17 @@ public double averageOrdersPerClient()
}
return sum;
}
-
+
+ ///
+ /// Get Banks by predicate
+ ///
+ ///
+ ///
+ public IEnumerable GetBanks(Func predicate = null)
+ {
+ if (predicate == null)
+ return myDAL.ReturnAllLocelBank().AsEnumerable();
+ return myDAL.ReturnAllLocelBank().Where(predicate);
+ }
}
}
\ No newline at end of file
diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index 4fa4a01..dc2a2a1 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -33,6 +33,7 @@
+
diff --git a/DAL/DALImp.cs b/DAL/DALImp.cs
index 6142aeb..5edb43e 100644
--- a/DAL/DALImp.cs
+++ b/DAL/DALImp.cs
@@ -8,7 +8,9 @@
namespace DAL
{
- public class DALImp : IDAL
+
+ public class DALImp
+
{
#region ///// Order /////
diff --git a/DAL/DalXML.cs b/DAL/DalXML.cs
index a343493..8f9ffb4 100644
--- a/DAL/DalXML.cs
+++ b/DAL/DalXML.cs
@@ -1,32 +1,41 @@
-using System;
+using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
-using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
+using System.Xml.Serialization;
using BE;
using DataSource;
+using System.Net;
+using System.Globalization;
namespace DAL
{
- public class DalXML : IDAL
+ public class DalXML
{
- private static int serialGuestRequest;
- private static int serialOrder;
+ private static Int64 serialGuestRequest;
+ private static Int64 serialOrder;
+ private static Int64 serialHost;
// private static double commision; //10 shekels -- zol meod public DalXML()
// private static string serialHostingUnit;
public DalXML()
{
- serialOrder = Int32.Parse(DataSource.DataSourceXML.Orders.Element("lastSerial").Value);
- serialGuestRequest = Int32.Parse(DataSource.DataSourceXML.GuestRequests.Element("lastSerial").Value);
- // TO DO
+
+ GetAndStoreBankInfo();
+
+ serialOrder = Convert.ToInt64(DataSource.DataSourceXML.Orders.Element("lastSerial").Value);
+ serialGuestRequest = Convert.ToInt64(DataSource.DataSourceXML.GuestRequests.Element("lastSerial").Value);
+ serialHost = Convert.ToInt64(DataSource.DataSourceXML.Hosts.Element("lastSerial").Value);
+
}
public bool addGuestRequest(GuestRequest gr)
{
XElement guestRequestElement = XElement.Parse(gr.ToXMLstring());
- DataSource.DataSourceXML.GuestRequests.Element("lastSerial").Value = guestRequestElement.Element("GuestRequestKey").Value;
+ guestRequestElement.Element("GuestRequestKey").Value = (++serialGuestRequest).ToString();
+ DataSource.DataSourceXML.GuestRequests.Element("lastSerial").Value = serialGuestRequest.ToString();
DataSource.DataSourceXML.SaveGuestRequests();
DataSource.DataSourceXML.GuestRequests.Add(guestRequestElement);
DataSource.DataSourceXML.SaveGuestRequests();
@@ -35,10 +44,14 @@ public bool addGuestRequest(GuestRequest gr)
public bool addHost(Host host)
{
- DataSource.DataSourceXML.Hosts.Add(XElement.Parse(host.ToXMLstring()));
- DataSource.DataSourceXML.SaveHosts();
- //DataSource.DataSourceXML.Hosts.Element("lastSerial").Value = host.HostKey.ToXMLstring();
+
+ XElement hostElement = XElement.Parse(host.ToXMLstring());
+ hostElement.Element("HostKey").Value = (++serialHost).ToString();
+ DataSource.DataSourceXML.Hosts.Element("lastSerial").Value = serialHost.ToString();
DataSource.DataSourceXML.SaveHosts();
+ DataSource.DataSourceXML.Hosts.Add(hostElement);
+ DataSource.DataSourceXML.SaveHosts();
+
return true;
}
@@ -61,12 +74,13 @@ public bool addOrder(Order neworder)
// //throw new Exception("order alraedy exist");
// return false;
//}
- serialOrder = Int32.Parse(DataSource.DataSourceXML.Orders.Element("lastSerial").Value);
- neworder.OrderKey = ++serialOrder;
- DataSource.DataSourceXML.Orders.Add(neworder.ToXML());
+ XElement OrderElement = XElement.Parse(neworder.ToXMLstring());
+ OrderElement.Element("OrderKey").Value = (++serialOrder).ToString();
+ DataSource.DataSourceXML.Orders.Element("lastSerial").Value = serialOrder.ToString();
DataSource.DataSourceXML.SaveOrders();
- DataSource.DataSourceXML.Orders.Element("lastSerial").Value = neworder.OrderKey.ToString();
+ DataSource.DataSourceXML.Orders.Add(OrderElement);
DataSource.DataSourceXML.SaveOrders();
+
return true;
}
@@ -78,8 +92,28 @@ public List getAllGuestRequests()
public List getAllHostingUnits()
{
- return (from o in DataSource.DataSourceXML.HostingUnits.Elements("HostingUnit")
+ var x = (from o in DataSource.DataSourceXML.HostingUnits.Elements("HostingUnit")
select o.ToString().ToObject()).ToList();
+
+ var list = DataSourceXML.HostingUnits.Elements("HostingUnit").ToList();
+ foreach (var item in x)
+ {
+ foreach (var k in list)
+ {
+ if (k.Element("HostingUnitKey").Value == item.HostingUnitKey.ToString())
+ {
+ var dates = k.Element("Diary").Elements("DateTime").ToList();
+ foreach (var v in dates)
+ {
+ DateTime date = DateTime.ParseExact(v.Value, "dd/MM/yyyy HH:mm:ss", CultureInfo.CurrentCulture);
+ item.Diary.Add(date);
+ }
+
+ }
+ }
+ }
+ return x;
+
}
public List getAllHosts()
@@ -124,20 +158,68 @@ where Int32.Parse(o.Element("OrderKey").Value) == id
}
- public string getserialGuestRequest()
+ public bool DeleteHost(Host host)
{
- String result = DataSource.DataSourceXML.GuestRequests.Element("lastSerial").Value;
- return result;
- }
+ try
+ {
+ XElement hostElement = (from o in DataSourceXML.Hosts.Elements("Host")
+ where Int32.Parse(o.Element("HostKey").Value) == host.HostKey
+ select o).FirstOrDefault();
+ if (hostElement != null)
+ {
- public bool updateGuestRequest(GuestRequest guestRequest)
- {
- throw new NotImplementedException();
+ hostElement.Remove();
+ DataSourceXML.SaveHosts();
+
+
+ }
+ return true;
+
+ }
+ catch (Exception ex)
+ {
+
+ throw new Exception("Fail to delete the Hosting-Unit " + ex);
+ }
}
- public bool updateHost(Host host)
+ public bool UpdateHost(Host host)
{
- throw new NotImplementedException();
+ try
+ {
+ XElement hostElement = (from o in DataSourceXML.Hosts.Elements("Host")
+ where Int32.Parse(o.Element("HostKey").Value) == host.HostKey
+ select o).FirstOrDefault();
+ if (hostElement != null)
+ {
+ hostElement.Element("PrivateName").Value = host.PrivateName.ToString();
+ hostElement.Element("FamilyName").Value = host.FamilyName;
+ hostElement.Element("PhoneNumber").Value = host.PhoneNumber.ToString();
+ hostElement.Element("MailAddress").Value = host.MailAddress.ToString();
+ hostElement.Element("BankAccount").Element("BankNumber").Value = host.BankAccount.BankNumber.ToString();
+ hostElement.Element("BankAccount").Element("BankName").Value = host.BankAccount.BankName.ToString();
+ hostElement.Element("BankAccount").Element("BranchNumber").Value = host.BankAccount.BranchNumber.ToString();
+ hostElement.Element("BankAccount").Element("BranchCity").Value = host.BankAccount.BranchCity.ToString();
+ hostElement.Element("BankAccount").Element("BankAccountNumber").Value = host.BankAccount.BankAccountNumber.ToString();
+
+
+ DataSourceXML.SaveHosts();
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ catch (Exception ex)
+ {
+
+ Console.WriteLine(ex.Message);
+ return false;
+ }
+
+
}
public bool updateOrder(Order updateorder)
@@ -150,15 +232,22 @@ where Int32.Parse(o.Element("OrderKey").Value) == updateorder.OrderKey
{
return false;
}
+ else
+ {
+
+ findOrder.Element("OrderKey").Value = updateorder.OrderKey.ToString();
+ findOrder.Element("HostingUnitKey").Value = updateorder.HostingUnitKey.ToString();
+ findOrder.Element("GuestRequestKey").Value = updateorder.GuestRequestKey.ToString();
+ //findOrder.Element("OrderDate").Value = updateorder.OrderDate.ToString();
+ //findOrder.Element("CreateDate").Value = updateorder.CreateDate.ToString();
+ findOrder.Element("Status").Value = updateorder.Status.ToString();
+
+ DataSourceXML.SaveOrders();
+ }
return true;
}
- public void UpdateOrder(int OrderKey, OrderStatus status)
- {
- throw new NotImplementedException();
- }
-
#region ///// Order /////
@@ -235,10 +324,23 @@ public bool DeleteHostingUnit(HostingUnit hu)
{
try
{
- return DataSourceList.HostingUnits.Remove(hu);
+ XElement hostingUnits = (from o in DataSourceXML.HostingUnits.Elements("HostingUnit")
+ where Int32.Parse(o.Element("HostingUnitKey").Value) == hu.HostingUnitKey
+ select o).FirstOrDefault();
+ if (hostingUnits != null)
+ {
+
+ hostingUnits.Remove();
+ DataSourceXML.SaveHostingUnits();
+
+
+ }
+ return true;
+
}
catch (Exception ex)
{
+
throw new Exception("Fail to delete the Hosting-Unit " + ex);
}
}
@@ -250,33 +352,48 @@ public bool DeleteHostingUnit(HostingUnit hu)
///
public bool UpdateHostingUnit(HostingUnit hostingUnit)
{
- //Remove old
try
{
- try
- {
- DataSourceList.HostingUnits.Remove(DataSourceList.HostingUnits.Find(x => x.HostingUnitKey == hostingUnit.HostingUnitKey));
- }
- catch (Exception ex)
+ XElement hostingUnits = (from o in DataSourceXML.HostingUnits.Elements("HostingUnit")
+ where Int32.Parse(o.Element("HostingUnitKey").Value) == hostingUnit.HostingUnitKey
+ select o).FirstOrDefault();
+ if (hostingUnits != null)
{
- throw new Exception("can't remove the old Hosting-Unit " + ex);
- }
+ hostingUnits.Element("Area").Value = hostingUnit.Area.ToString();
+ //hostingUnits.Element("SubArea").Value = hostingUnit.SubArea.ToString();
+ hostingUnits.Element("HostingType").Value = hostingUnit.HostingType.ToString();
+ hostingUnits.Element("Adults").Value = hostingUnit.Adults.ToString();
+ hostingUnits.Element("Children").Value = hostingUnit.Children.ToString();
+ hostingUnits.Element("Pool").Value = hostingUnit.Pool.ToString();
+ hostingUnits.Element("Jacuzzi").Value = hostingUnit.Jacuzzi.ToString();
+ hostingUnits.Element("Garden").Value = hostingUnit.Garden.ToString();
+ hostingUnits.Element("ChildrensAttractions").Value = hostingUnit.ChildrensAttractions.ToString();
+ hostingUnits.Element("SpredBads").Value = hostingUnit.SpredBads.ToString();
+ hostingUnits.Element("AirCondsner").Value = hostingUnit.AirCondsner.ToString();
+ hostingUnits.Element("frisider").Value = hostingUnit.frisider.ToString();
+ hostingUnits.Element("SingogNaerBy").Value = hostingUnit.SingogNaerBy.ToString();
+ hostingUnits.Element("NaerPublicTrensportion").Value = hostingUnit.NaerPublicTrensportion.ToString();
+ hostingUnits.Element("Diary").Remove();
+ var diary = new XElement("Diary", hostingUnit.Diary.Select(x => new XElement("DateTime", x.ToString())));
+ hostingUnits.AddFirst(diary);
+
+ DataSourceXML.SaveHostingUnits();
- //insert new
- try
- {
- DataSourceList.HostingUnits.Add(Cloning.Copy(hostingUnit));
return true;
}
- catch (Exception ex)
+ else
{
- throw new Exception("can't add the new Hosting-Unit " + ex);
+ return false;
}
}
catch (Exception ex)
{
- throw new Exception("Fail to update Hosting-Unit becuse it " + ex);
+
+ Console.WriteLine(ex.Message);
+ return false;
}
+
+
}
///
@@ -382,21 +499,121 @@ public void AddGuestRequestToList(GuestRequest gr)
/// Return All Locel Bank
///
///
- public IEnumerable ReturnAllLocelBank()
+ public IEnumerable ReturnAllLocelBank(Func predicate = null)
{
try
{
- return new List { "poelim", "marcntil", "laomi", "disceunt", "pagi" };
+ if (predicate == null)
+ return DataSourceList.banks.AsEnumerable();
+ return DataSourceList.banks.Where(predicate);
}
catch (Exception ex)
{
- throw new Exception("Fail to return the Locel-Bank list " + ex);
- }
- }
+ throw new Exception("Fail to retrieve the Guest-Request from the list " + ex);
+ }}
#endregion
+ ///
+ /// GetBankInfoFromTheWeb
+ ///
+ public void GetAndStoreBankInfo()
+ {
+ //C:\Users\ipewz\Documents\GitHub\Mini_project_Windows_system
+ //const string xmlLocalPath = @"atm.xml";
+ const string xmlLocalPath = @"ATM.xml";
+ WebClient wc = new WebClient();
+ Task.Run(() =>
+ {
+ try
+ {
+ string xmlServerPath = @"http://www.jct.ac.il/~coshri/atm.xml";
+ wc.DownloadFile(xmlServerPath, xmlLocalPath);
+ }
+ catch (Exception)
+ {
+ try
+ {
+ string xmlServerPath =
+ @"http://www.boi.org.il/he/BankingSupervision/BanksAndBranchLocations/Lists/BoiBankBranchesDocs/atm.xml";
+ wc.DownloadFile(xmlServerPath, xmlLocalPath);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.Message);
+
+ }
+ }
+ finally
+ {
+ wc.Dispose();
+ }
+
+ try
+ {
+
+ XmlRootAttribute xRoot = new XmlRootAttribute();
+ xRoot.ElementName = "ATMs";
+ xRoot.IsNullable = true;
+
+ XmlSerializer serializer = new XmlSerializer(typeof(List), xRoot);
+
+ using (FileStream stream = File.OpenRead("ATM.xml"))
+ {
+ List dezerializedList = (List)serializer.Deserialize(stream);
+ stream.Close();
+ foreach (var item in dezerializedList)
+ {
+ int findBank = DataSourceList.banks.FindIndex((x) => x.BankNumber == Convert.ToInt32(item.קוד_בנק));
+ if (findBank == -1)
+ {
+ DataSourceList.banks.Add(new BankDetails {
+ BankName = item.שם_בנק,
+ BankNumber = Convert.ToInt32(item.קוד_בנק),
+ Branches = new List()
+ {
+ new BankBranch
+ {
+ BranchCity = item.ישוב,
+ BranchNumber = Convert.ToInt32(item.קוד_סניף)
+
+ }
+ }
+
+ });
+ }
+ else
+ {
+ int findBranch = DataSourceList.banks[findBank].Branches.FindIndex((x) => x.BranchNumber == Convert.ToInt32(item.קוד_סניף));
+ if (findBranch == -1)
+ {
+ DataSourceList.banks[findBank].Branches.Add(new BankBranch
+ {
+ BranchNumber = Convert.ToInt32( item.קוד_סניף),
+ BranchCity = item.ישוב
+ });
+ }
+ }
+ }
+
+
+ }
+ }
+ catch (Exception ex)
+ {
+ // throw new Exception("Fail to return the Locel-Bank list " + ex);
+ //MessageBox.Show("fail to downlode banks file");
+
+ }
+ });
+
+
+ }
+
+
}
}
+
+
diff --git a/DAL/FactorySingletonDal.cs b/DAL/FactorySingletonDal.cs
index 8fd010d..5dc5863 100644
--- a/DAL/FactorySingletonDal.cs
+++ b/DAL/FactorySingletonDal.cs
@@ -10,11 +10,11 @@ namespace DAL
public static class FactorySingletonDal
{
- private static IDAL instance = null;
+ private static DalXML instance = null;
static FactorySingletonDal() { }
- public static IDAL Instance
+ public static DalXML Instance
{
get
diff --git a/DAL/IDAL.cs b/DAL/IDAL.cs
index 002df19..625c788 100644
--- a/DAL/IDAL.cs
+++ b/DAL/IDAL.cs
@@ -7,16 +7,22 @@ namespace DAL
public interface IDAL
{
bool AddOrderToList(Order order);
+ bool AddHostingUnitToList(HostingUnit hostingUnit);
void UpdateOrder(int OrderKey, OrderStatus status);
- bool AddHostingUnitToList(HostingUnit hostingUnit);
- bool DeleteHostingUnit(HostingUnit hostingUnit);
- bool UpdateHostingUnit(HostingUnit hostingUnit);
+ bool UpdateHostingUnit(HostingUnit hostingUnit);
+
+ bool DeleteHostingUnit(HostingUnit hostingUnit);
+ bool DeleteHost(Host host);
+
IEnumerable ReturnHostingUnitList(Func predicate = null);
IEnumerable ReturnGuestRequestList(Func predicate = null);
- IEnumerable ReturenAllOrders(Func predicate = null);
+ IEnumerable ReturenAllOrders(Func predicate = null);
+ IEnumerable ReturnAllLocelBank(Func predicate = null);
+
IEnumerable ReturnAllLocelBank();
+
}
}
\ No newline at end of file
diff --git a/DataSource/DataSourceList.cs b/DataSource/DataSourceList.cs
index 364e620..5e42201 100644
--- a/DataSource/DataSourceList.cs
+++ b/DataSource/DataSourceList.cs
@@ -31,6 +31,8 @@ static public class DataSourceList
+ public static List banks = new List();
+
public static List Hosts = new List();
public static List HostingUnits = new List();
diff --git a/DataSource/DataSourceXML.cs b/DataSource/DataSourceXML.cs
index 5c88075..3e67272 100644
--- a/DataSource/DataSourceXML.cs
+++ b/DataSource/DataSourceXML.cs
@@ -117,6 +117,7 @@ public static XElement HostingUnits
get
{
hostingUnitRoot = LoadData(hostingUnitPath);
+
return hostingUnitRoot;
}
}
@@ -130,7 +131,7 @@ public static XElement GuestRequests
}
}
- private static XElement LoadData(string path)
+ private static XElement LoadData(string path)
{
XElement root;
try
diff --git a/DataSource/DataXML/GuestRequestXml.xml b/DataSource/DataXML/GuestRequestXml.xml
index d0fec14..b7b4211 100644
--- a/DataSource/DataXML/GuestRequestXml.xml
+++ b/DataSource/DataXML/GuestRequestXml.xml
@@ -1,7 +1,7 @@
- 10000005
-
+ 10000010
+
Jerusalem
old city
Hotel
@@ -97,4 +97,101 @@
0001-01-01T00:00:00
0001-01-01T00:00:00
+
+ South
+ jhkjh
+ Zimmer
+ 0
+ 0
+ Possible
+ NotNecessary
+ Necessary
+ Possible
+ Possible
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000007
+ p
+ p
+ Open
+ ipewzner@g.jct.ac.il
+ 0001-01-01T00:00:00
+ 2020-02-02T00:00:00+02:00
+ 2020-01-01T00:00:00
+
+
+ North
+ dfgdf
+ Zimmer
+ 0
+ 0
+ Necessary
+ Necessary
+ Necessary
+ NotNecessary
+ Necessary
+ Possible
+ Necessary
+ Necessary
+ Possible
+ 10000008
+ dfgdfggdfg
+ d
+ dfg@dd.com
+ Open
+ 0001-01-01T00:00:00
+ 2020-02-04T00:00:00
+ 2020-02-29T00:00:00
+
+
+ North
+ dfgfd
+ Zimmer
+ 0
+ 0
+ Necessary
+ Possible
+ Necessary
+ Possible
+ Possible
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000009
+ dfgdf
+ dfgdf
+ dfg@dd.com
+ Open
+ 0001-01-01T00:00:00
+ 2020-02-14T00:00:00
+ 2020-02-29T00:00:00
+
+
+
+ Jerusalem
+ ert
+ Zimmer
+ 0
+ 0
+ Possible
+ Necessary
+ Possible
+ NotNecessary
+ Necessary
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000010
+ meni
+ wer
+ meni3a@gmail.com
+ Open
+ 0001-01-01T00:00:00
+ 2020-02-26T00:00:00
+ 2020-02-29T00:00:00
+
\ No newline at end of file
diff --git a/DataSource/DataXML/HostXml.xml b/DataSource/DataXML/HostXml.xml
index e2ce053..8e0042d 100644
--- a/DataSource/DataXML/HostXml.xml
+++ b/DataSource/DataXML/HostXml.xml
@@ -1,5 +1,6 @@
+ 10000077
11111111
david
@@ -7,11 +8,11 @@
054-5555555
sale@gmai.com
- 123
- poalim
- 432
+ 13
+ בנק אגוד לישראל בע"מ
+ 75
jefo 121
- jeruselm
+ רעננה
11111111
@@ -23,11 +24,11 @@
054-6666666
hotel@gmai.com
- 123
- poalim
- 432
+ 54
+ בנק ירושלים בע"מ
+ 96
jefo 121
- jeruselm
+ כרמיאל
11111112
@@ -49,9 +50,9 @@
- 0
- manster
- frankinstin
+ 00000000
+ admin
+ admin
666
hall
0
@@ -64,4 +65,49 @@
85
+
+ 10000058
+ poster
+ hoster
+ 3455
+ sdfs@sd.co
+ -10.104273848989083
+
+ 14
+ בנק אוצר החייל בע"מ
+ 322
+ תל אביב -יפו
+ 345345
+
+
+
+ 10000074
+ pewzner
+ iasayau
+ 0548410620
+ ipewzner@gmail.com
+ 0.066778548244450411
+
+ 4
+ בנק יהב לעובדי המדינה בע"מ
+ 125
+ אשקלון
+ 520
+
+
+
+ 10000076
+ harry
+ potter
+ 8
+ fds@cd
+ -2.1442198634214571
+
+ 14
+ בנק אוצר החייל בע"מ
+ 331
+ אילת
+ 520
+
+
\ No newline at end of file
diff --git a/DataSource/DataXML/HostingUnitXml.xml b/DataSource/DataXML/HostingUnitXml.xml
index 0acd880..5162621 100644
--- a/DataSource/DataXML/HostingUnitXml.xml
+++ b/DataSource/DataXML/HostingUnitXml.xml
@@ -1,39 +1,8 @@
+ 10000043
- North
- Zimmer
- 0
- 0
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- 10000000
-
- 11111111
- david
- cohn
- 054-5555555
- sale@gmai.com
-
- 123
- poalim
- 432
- jefo 121
- jeruselm
- 11111111
-
-
-
- hotel clifornia
-
-
+
North
Zimmer
0
@@ -67,6 +36,24 @@
hotel hong-kong
+
+ 14/02/2020 00:00:00
+ 15/02/2020 00:00:00
+ 16/02/2020 00:00:00
+ 17/02/2020 00:00:00
+ 18/02/2020 00:00:00
+ 19/02/2020 00:00:00
+ 20/02/2020 00:00:00
+ 21/02/2020 00:00:00
+ 22/02/2020 00:00:00
+ 23/02/2020 00:00:00
+ 24/02/2020 00:00:00
+ 25/02/2020 00:00:00
+ 26/02/2020 00:00:00
+ 27/02/2020 00:00:00
+ 28/02/2020 00:00:00
+ 29/02/2020 00:00:00
+
North
Zimmer
0
@@ -100,171 +87,7 @@
hotel paris
- Center
- Zimmer
- 0
- 0
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- 10000006
-
- 22222222
- moses
- levi
- 054-6666666
- hotel@gmai.com
-
- 123
- poalim
- 432
- jefo 121
- jeruselm
- 11111112
-
-
-
- hotel tal-aviv
-
-
- Jerusalem
- Zimmer
- 0
- 0
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- 10000010
-
- 22222222
- moses
- levi
- 054-6666666
- hotel@gmai.com
-
- 123
- poalim
- 432
- jefo 121
- jeruselm
- 11111112
-
-
-
- hotel jeruselm
-
-
- North
- Zimmer
- 0
- 0
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- 10000015
-
- 22222222
- moses
- levi
- 054-6666666
- hotel@gmai.com
-
- 123
- poalim
- 432
- jefo 121
- jeruselm
- 11111112
-
-
-
- hotel tavriea
-
-
- North
- Zimmer
- 0
- 0
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- 10000021
-
- 22222222
- moses
- levi
- 054-6666666
- hotel@gmai.com
-
- 123
- poalim
- 432
- jefo 121
- jeruselm
- 11111112
-
-
-
- hotel hifa
-
-
- North
- Zimmer
- 0
- 0
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- Necessary
- 10000028
-
- 33333333
- dan
- danon
- 054-1010101
- zimer@gmai.com
-
- 525
- laomi
- 852
- gargmel 1010
- heifa
- 1152582
-
-
-
- zimer of the north
-
-
+
Jerusalem
Zimmer
0
@@ -298,6 +121,7 @@
zimer of the Jerusalem
+
South
Zimmer
0
@@ -331,27 +155,29 @@
zimer of the South
+
North
- vc
- Zimmer
- 0
- 0
+
+ RentingRoom
+ 5
+ 5
Necessary
Necessary
Necessary
- Possible
- Possible
- Possible
+ Necessary
+ Necessary
+ Necessary
Necessary
- Possible
+ Necessary
Necessary
- 10000040
-
+ 10000028
+
33333333
dan
danon
054-1010101
zimer@gmai.com
+ 0
525
laomi
@@ -361,7 +187,7 @@
1152582
-
-vvvv
+
+ zimer of the north
\ No newline at end of file
diff --git a/DataSource/DataXML/OrderXml.xml b/DataSource/DataXML/OrderXml.xml
index 9a6920c..102ef99 100644
--- a/DataSource/DataXML/OrderXml.xml
+++ b/DataSource/DataXML/OrderXml.xml
@@ -1,28 +1,60 @@
- 10000009
-
- 10000007
+ 10000068
+
+ 10000062
10000003
- 10000001
- 2020-01-27T20:40:58.9922545+02:00
- 2020-01-27T20:40:58.9922545+02:00
+ 10000010
+ 2020-02-16T01:18:56.1279916+02:00
+ 2020-02-16T01:18:56.1279916+02:00
MailSent
-
- 10000008
+
+ 10000063
10000003
- 10000001
- 2020-01-27T20:41:17.1073695+02:00
- 2020-01-27T20:41:17.1073695+02:00
+ 10000010
+ 2020-02-16T01:21:54.9935631+02:00
+ 2020-02-16T01:21:54.9935631+02:00
MailSent
-
- 10000009
- 10000021
- 10000003
- 2020-01-27T21:34:06.2123047+02:00
- 2020-01-27T21:34:06.2123047+02:00
+
+ 10000064
+ 10000003
+ 10000010
+ 2020-02-16T01:37:16.8911016+02:00
+ 2020-02-16T01:37:16.8911016+02:00
+ MailSent
+
+
+ 10000065
+ 10000003
+ 10000010
+ 2020-02-16T01:44:05.461053+02:00
+ 2020-02-16T01:44:05.461053+02:00
+ MailSent
+
+
+ 10000066
+ 10000003
+ 10000010
+ 2020-02-16T01:45:50.4350622+02:00
+ 2020-02-16T01:45:50.4350622+02:00
+ MailSent
+
+
+ 10000067
+ 10000003
+ 10000010
+ 2020-02-16T01:47:34.6188963+02:00
+ 2020-02-16T01:47:34.6188963+02:00
MailSent
+
+ 10000068
+ 10000003
+ 10000009
+ 2020-02-16T01:47:34.6188963+02:00
+ 2020-02-16T01:47:34.6188963+02:00
+ CloseByClientTimeOut
+
\ No newline at end of file
diff --git a/DataSource/DataXML1/GuestRequestXml.xml b/DataSource/DataXML1/GuestRequestXml.xml
index 7b866a5..b7b4211 100644
--- a/DataSource/DataXML1/GuestRequestXml.xml
+++ b/DataSource/DataXML1/GuestRequestXml.xml
@@ -1,42 +1,197 @@
- 1000001
+ 10000010
- 1000000
- ASDA
- ASDAS
- AS@HH.KK
- NotYetApproved
- 0001-01-01T00:00:00
- 2020-01-19T11:52:17.9355397+02:00
- 2020-01-21T11:52:17.9355397+02:00
Jerusalem
- ASD
- Zimmer
+ old city
+ Hotel
2
- 3
+ 1
+ Necessary
+ NotNecessary
+ NotNecessary
+ Necessary
+ NotNecessary
+ Necessary
+ Possible
+ Necessary
+ Possible
+ 10000000
+ zareh
+ parz
+ penhes@gmail.com
+ Open
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+ North
+ tabrios
+ Zimmer
+ 4
+ 0
Necessary
Necessary
Necessary
- Necessary
+ NotNecessary
+ Necessary
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000001
+ kalmen
+ kalmenovitz
+ kalmenovitz@gmail.com
+ Open
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
- 1000001
- dxs
- EFG
- GR@GG.GG
- NotYetApproved
+ Center
+ tal aviv
+ RentingRoom
+ 2
+ 2
+ NotNecessary
+ NotNecessary
+ NotNecessary
+ Necessary
+ NotNecessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ 10000003
+ afreim
+ cohn
+ cohn@gmail.com
+ Open
0001-01-01T00:00:00
- 2020-01-19T11:53:23.7121693+02:00
- 2020-01-21T11:53:23.7121693+02:00
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
Jerusalem
- asd
+ old city
+ Hotel
+ 2
+ 5
+ Possible
+ Possible
+ NotNecessary
+ Necessary
+ NotNecessary
+ Necessary
+ Possible
+ Necessary
+ Possible
+ 10000006
+ aser
+ golomb
+ golomb@gmail.com
+ Open
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+ South
+ jhkjh
Zimmer
- 55
- 54
+ 0
+ 0
+ Possible
+ NotNecessary
+ Necessary
+ Possible
+ Possible
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000007
+ p
+ p
+ Open
+ ipewzner@g.jct.ac.il
+ 0001-01-01T00:00:00
+ 2020-02-02T00:00:00+02:00
+ 2020-01-01T00:00:00
+
+
+ North
+ dfgdf
+ Zimmer
+ 0
+ 0
Necessary
Necessary
Necessary
- Necessary
+ NotNecessary
+ Necessary
+ Possible
+ Necessary
+ Necessary
+ Possible
+ 10000008
+ dfgdfggdfg
+ d
+ dfg@dd.com
+ Open
+ 0001-01-01T00:00:00
+ 2020-02-04T00:00:00
+ 2020-02-29T00:00:00
+
+
+ North
+ dfgfd
+ Zimmer
+ 0
+ 0
+ Necessary
+ Possible
+ Necessary
+ Possible
+ Possible
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000009
+ dfgdf
+ dfgdf
+ dfg@dd.com
+ Open
+ 0001-01-01T00:00:00
+ 2020-02-14T00:00:00
+ 2020-02-29T00:00:00
+
+
+
+ Jerusalem
+ ert
+ Zimmer
+ 0
+ 0
+ Possible
+ Necessary
+ Possible
+ NotNecessary
+ Necessary
+ Necessary
+ Necessary
+ Possible
+ Possible
+ 10000010
+ meni
+ wer
+ meni3a@gmail.com
+ Open
+ 0001-01-01T00:00:00
+ 2020-02-26T00:00:00
+ 2020-02-29T00:00:00
\ No newline at end of file
diff --git a/DataSource/DataXML1/HostXml.xml b/DataSource/DataXML1/HostXml.xml
index 9dfb370..8e0042d 100644
--- a/DataSource/DataXML1/HostXml.xml
+++ b/DataSource/DataXML1/HostXml.xml
@@ -1,30 +1,113 @@
+ 10000077
- 123
- d ca suffit
- qwere
- 3324
- daas@hhh.jjj
- 3123
- Yes
+ 11111111
+ david
+ cohn
+ 054-5555555
+ sale@gmai.com
+
+ 13
+ בנק אגוד לישראל בע"מ
+ 75
+ jefo 121
+ רעננה
+ 11111111
+
+
- 5555
- qwre
- adsa
- 232
- fdsf
- 12321
- Yes
+ 22222222
+ moses
+ levi
+ 054-6666666
+ hotel@gmai.com
+
+ 54
+ בנק ירושלים בע"מ
+ 96
+ jefo 121
+ כרמיאל
+ 11111112
+
+
- 1424
- buffalo
- Falery Chisqkar Destin
- 052
- aaaa@gmail.com
- 15141
- Maybe
+ 33333333
+ dan
+ danon
+ 054-1010101
+ zimer@gmai.com
+
+ 525
+ laomi
+ 852
+ gargmel 1010
+ heifa
+ 1152582
+
+
+
+
+ 00000000
+ admin
+ admin
+ 666
+ hall
+ 0
+
+ 852
+
+ 852
+
+
+ 85
+
+
+
+ 10000058
+ poster
+ hoster
+ 3455
+ sdfs@sd.co
+ -10.104273848989083
+
+ 14
+ בנק אוצר החייל בע"מ
+ 322
+ תל אביב -יפו
+ 345345
+
+
+
+ 10000074
+ pewzner
+ iasayau
+ 0548410620
+ ipewzner@gmail.com
+ 0.066778548244450411
+
+ 4
+ בנק יהב לעובדי המדינה בע"מ
+ 125
+ אשקלון
+ 520
+
+
+
+ 10000076
+ harry
+ potter
+ 8
+ fds@cd
+ -2.1442198634214571
+
+ 14
+ בנק אוצר החייל בע"מ
+ 331
+ אילת
+ 520
+
\ No newline at end of file
diff --git a/DataSource/DataXML1/HostingUnitXml.xml b/DataSource/DataXML1/HostingUnitXml.xml
index d28178a..5162621 100644
--- a/DataSource/DataXML1/HostingUnitXml.xml
+++ b/DataSource/DataXML1/HostingUnitXml.xml
@@ -1,2 +1,193 @@
-
\ No newline at end of file
+
+ 10000043
+
+
+ North
+ Zimmer
+ 0
+ 0
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ 10000001
+
+ 11111111
+ david
+ cohn
+ 054-5555555
+ sale@gmai.com
+
+ 123
+ poalim
+ 432
+ jefo 121
+ jeruselm
+ 11111111
+
+
+
+ hotel hong-kong
+
+
+
+ 14/02/2020 00:00:00
+ 15/02/2020 00:00:00
+ 16/02/2020 00:00:00
+ 17/02/2020 00:00:00
+ 18/02/2020 00:00:00
+ 19/02/2020 00:00:00
+ 20/02/2020 00:00:00
+ 21/02/2020 00:00:00
+ 22/02/2020 00:00:00
+ 23/02/2020 00:00:00
+ 24/02/2020 00:00:00
+ 25/02/2020 00:00:00
+ 26/02/2020 00:00:00
+ 27/02/2020 00:00:00
+ 28/02/2020 00:00:00
+ 29/02/2020 00:00:00
+
+ North
+ Zimmer
+ 0
+ 0
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ 10000003
+
+ 11111111
+ david
+ cohn
+ 054-5555555
+ sale@gmai.com
+
+ 123
+ poalim
+ 432
+ jefo 121
+ jeruselm
+ 11111111
+
+
+
+ hotel paris
+
+
+
+ Jerusalem
+ Zimmer
+ 0
+ 0
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ 10000036
+
+ 33333333
+ dan
+ danon
+ 054-1010101
+ zimer@gmai.com
+
+ 525
+ laomi
+ 852
+ gargmel 1010
+ heifa
+ 1152582
+
+
+
+ zimer of the Jerusalem
+
+
+
+ South
+ Zimmer
+ 0
+ 0
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ 10000045
+
+ 33333333
+ dan
+ danon
+ 054-1010101
+ zimer@gmai.com
+
+ 525
+ laomi
+ 852
+ gargmel 1010
+ heifa
+ 1152582
+
+
+
+ zimer of the South
+
+
+
+ North
+
+ RentingRoom
+ 5
+ 5
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ Necessary
+ 10000028
+
+ 33333333
+ dan
+ danon
+ 054-1010101
+ zimer@gmai.com
+ 0
+
+ 525
+ laomi
+ 852
+ gargmel 1010
+ heifa
+ 1152582
+
+
+
+ zimer of the north
+
+
\ No newline at end of file
diff --git a/DataSource/DataXML1/OrderXml.xml b/DataSource/DataXML1/OrderXml.xml
index 00457dc..102ef99 100644
--- a/DataSource/DataXML1/OrderXml.xml
+++ b/DataSource/DataXML1/OrderXml.xml
@@ -1,28 +1,60 @@
- 25
-
- 23
- 10000010
- 10000025
- 30/12/2019 16:52:25
- 02/01/2020 16:52:25
- NotYetApproved
+ 10000068
+
+ 10000062
+ 10000003
+ 10000010
+ 2020-02-16T01:18:56.1279916+02:00
+ 2020-02-16T01:18:56.1279916+02:00
+ MailSent
-
- 24
- 12123
- 10000005
- 30/12/2019 16:52:25
- 02/01/2020 16:52:25
- NotYetApproved
+
+ 10000063
+ 10000003
+ 10000010
+ 2020-02-16T01:21:54.9935631+02:00
+ 2020-02-16T01:21:54.9935631+02:00
+ MailSent
-
- 25
- 12123
- 10000005
- 30/12/2019 16:52:25
- 02/01/2020 16:52:25
- NotYetApproved
+
+ 10000064
+ 10000003
+ 10000010
+ 2020-02-16T01:37:16.8911016+02:00
+ 2020-02-16T01:37:16.8911016+02:00
+ MailSent
+
+
+ 10000065
+ 10000003
+ 10000010
+ 2020-02-16T01:44:05.461053+02:00
+ 2020-02-16T01:44:05.461053+02:00
+ MailSent
+
+
+ 10000066
+ 10000003
+ 10000010
+ 2020-02-16T01:45:50.4350622+02:00
+ 2020-02-16T01:45:50.4350622+02:00
+ MailSent
+
+
+ 10000067
+ 10000003
+ 10000010
+ 2020-02-16T01:47:34.6188963+02:00
+ 2020-02-16T01:47:34.6188963+02:00
+ MailSent
+
+
+ 10000068
+ 10000003
+ 10000009
+ 2020-02-16T01:47:34.6188963+02:00
+ 2020-02-16T01:47:34.6188963+02:00
+ CloseByClientTimeOut
\ No newline at end of file
diff --git a/Mini_project_Windows_system.sln b/Mini_project_Windows_system.sln
index cc87050..e93b263 100644
--- a/Mini_project_Windows_system.sln
+++ b/Mini_project_Windows_system.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.902
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29728.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BE", "BE\BE.csproj", "{6E73959A-2CC3-4F9A-B557-A9A948B98E7D}"
ProjectSection(ProjectDependencies) = postProject
@@ -29,8 +29,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataSource", "DataSource\Da
{6E73959A-2CC3-4F9A-B557-A9A948B98E7D} = {6E73959A-2CC3-4F9A-B557-A9A948B98E7D}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PL", "PL\PL.csproj", "{7F42FED6-B07C-4A84-A4FF-9724DC2F55CF}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PLWPF", "PLWPF\PLWPF.csproj", "{4A8084A7-77A5-4B18-81A2-36400FD55656}"
EndProject
Global
@@ -59,10 +57,6 @@ Global
{17B32229-1FE2-45B8-877F-BE87BA1D46EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17B32229-1FE2-45B8-877F-BE87BA1D46EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17B32229-1FE2-45B8-877F-BE87BA1D46EB}.Release|Any CPU.Build.0 = Release|Any CPU
- {7F42FED6-B07C-4A84-A4FF-9724DC2F55CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7F42FED6-B07C-4A84-A4FF-9724DC2F55CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7F42FED6-B07C-4A84-A4FF-9724DC2F55CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7F42FED6-B07C-4A84-A4FF-9724DC2F55CF}.Release|Any CPU.Build.0 = Release|Any CPU
{4A8084A7-77A5-4B18-81A2-36400FD55656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A8084A7-77A5-4B18-81A2-36400FD55656}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A8084A7-77A5-4B18-81A2-36400FD55656}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/PLWPF/App.xaml b/PLWPF/App.xaml
index ee20f97..c9ab971 100644
--- a/PLWPF/App.xaml
+++ b/PLWPF/App.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PLWPF"
- StartupUri="MainWindow.xaml">
+ StartupUri="SplashScreenWindow.xaml">
diff --git a/PLWPF/App.xaml.cs b/PLWPF/App.xaml.cs
index 7e8cf5a..9733b32 100644
--- a/PLWPF/App.xaml.cs
+++ b/PLWPF/App.xaml.cs
@@ -1,8 +1,11 @@
-using System;
+using BL;
+using PLWPF.Windows;
+using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
@@ -13,5 +16,6 @@ namespace PLWPF
///
public partial class App : Application
{
+
}
-}
+}
\ No newline at end of file
diff --git a/PLWPF/HostUpdateWindow.xaml b/PLWPF/HostUpdateWindow.xaml
index d9aef88..3081225 100644
--- a/PLWPF/HostUpdateWindow.xaml
+++ b/PLWPF/HostUpdateWindow.xaml
@@ -4,8 +4,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PLWPF"
+ Closed="Window_Closed"
mc:Ignorable="d"
- Title="HostUpdateWindow" Height="500" Width="800">
+ Title="HostUpdateWindow" Height="600" Width="800">
diff --git a/PLWPF/HostUpdateWindow.xaml.cs b/PLWPF/HostUpdateWindow.xaml.cs
index 557046d..d18915d 100644
--- a/PLWPF/HostUpdateWindow.xaml.cs
+++ b/PLWPF/HostUpdateWindow.xaml.cs
@@ -1,17 +1,6 @@
using BE;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
namespace PLWPF
{
@@ -20,11 +9,27 @@ namespace PLWPF
///
public partial class HostUpdateWindow : Window
{
- public HostUpdateWindow(Host host)
+
+ public bool HostDeleted { set; get; }
+ HostUserControl hostUserControl;
+
+ Window mainWindow;
+ public HostUpdateWindow(Host host,Window mainWindow)
{
+
+ this.mainWindow = mainWindow;
+ mainWindow.Hide();
InitializeComponent();
- UpdateHostFrame.Content = new HostUserControl(host,false);
- DeleteHostFrame.Content = new HostUserControl(host,true);
+ UpdateHostFrame.Content = new HostUserControl(host,false,this);
+ hostUserControl = new HostUserControl(host, true, this);
+ DeleteHostFrame.Content = hostUserControl;
+
+ }
+
+ private void Window_Closed(object sender, EventArgs e)
+ {
+ HostDeleted = hostUserControl.HostDeleted ;
+ mainWindow.Visibility = Visibility.Visible;
}
}
}
diff --git a/PLWPF/HostUserControl.xaml b/PLWPF/HostUserControl.xaml
index de55241..0878d57 100644
--- a/PLWPF/HostUserControl.xaml
+++ b/PLWPF/HostUserControl.xaml
@@ -8,40 +8,42 @@
d:DesignHeight="450" d:DesignWidth="513.6">
-
+
+
+
-
-
-
-
-
+
+
-
+
-
+
-
-
-
-
+
-
-
+
+
-
-
+
-
-
+
+
+
+
diff --git a/PLWPF/HostUserControl.xaml.cs b/PLWPF/HostUserControl.xaml.cs
index 0bb3693..e0bf5b3 100644
--- a/PLWPF/HostUserControl.xaml.cs
+++ b/PLWPF/HostUserControl.xaml.cs
@@ -1,19 +1,13 @@
using BE;
using BL;
+using PLWPF.Windows;
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace PLWPF
{
@@ -22,52 +16,83 @@ namespace PLWPF
///
public partial class HostUserControl : UserControl
{
+ public bool HostDeleted { set; get; }
MyBl myBL = new MyBl();
bool newHost, deleteHost;
Host host;
BankAccount bankAccount;
+ Window win;
- public HostUserControl(Host hosts, bool deleteHost)
+ public HostUserControl(Host hosts, bool deleteHost, Window win)
{
+ this.win = win ;
InitializeComponent();
+ DataContext = this;
+ Banks = myBL.GetBanks();
+ //if this not a new host
if (hosts != null)
{
host = hosts;
bankAccount = host.BankAccount;
+ this.deleteHost = deleteHost;
FillTheFeilds();
}
else { newHost = true; }
- this.deleteHost = deleteHost;
-
-
ContinueButton.Content = (deleteHost==true)?"Delete":"Save";
-
-
}
private void FillTheFeilds()
{
- FamilyNameTextBox.Text= host.FamilyName;
+
+ FamilyName.Text= host.FamilyName;
PrivateName.Text= host.PrivateName;
PhoneNumber.Text= host.PhoneNumber ;
MailAddress.Text= host.MailAddress ;
-
- Bank_ComboBox.Text=bankAccount.BankName;
- BranchCity_ComboBox.Text= bankAccount.BranchCity;
- BranchAddress_ComboBox.Text= bankAccount.BranchAddress;
- BankNumber.Text= bankAccount.BankNumber .ToString() ;
- BranchNumber.Text= bankAccount.BranchNumber .ToString() ;
- BankAccountNumber.Text=bankAccount.BankAccountNumber.ToString() ;
+
+
+ BranchCity.Text= bankAccount.BranchCity;
+ //BranchAddress.Text= bankAccount.BranchAddress;
+ BankNumber.Text= bankAccount.BankNumber .ToString();
+ BranchNumber_ComboBox.SelectedItem = bankAccount.BranchNumber.ToString();
+ BankAccountNumber.Text=bankAccount.BankAccountNumber.ToString();
+ }
+
+ void bank_loaded(object sender, RoutedEventArgs e)
+ {
+ if(!newHost)
+ SetBankData();
+
+ }
+
+ void SetBankData()
+ {
+ foreach (var item in Banks)
+ {
+ //if !new user
+ if (item.BankName == bankAccount.BankName)
+ {
+ Bank_ComboBox.SelectedItem = item;
+
+ foreach (var k in item.Branches)
+ {
+ if (k.BranchNumber == bankAccount.BranchNumber)
+ {
+ BranchNumber_ComboBox.SelectedItem = k;
+ }
+ }
+
+ }
+ }
}
-///
-/// check password Match
-///
-///
-///
-private void PasswordChanged(object sender, RoutedEventArgs e)
+ ///
+ /// check password Match
+ ///
+ ///
+ ///
+ private void PasswordChanged(object sender, RoutedEventArgs e)
{
if ((FirstPassword.PasswordHidden.Password) != (SecundPassword.PasswordHidden.Password))
{
@@ -82,76 +107,185 @@ private void PasswordChanged(object sender, RoutedEventArgs e)
private void CancelChanges_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
- if (!newHost) FillTheFeilds();
- else {
- FamilyNameTextBox.Text =null;
+ if (!newHost)
+ {
+ FillTheFeilds();
+ SetBankData();
+ }
+ else
+ {
+ FamilyName.Text = null;
PrivateName.Text = null;
PhoneNumber.Text = null;
MailAddress.Text = null;
Bank_ComboBox.Text = null;
- BranchCity_ComboBox.Text = null;
- BranchAddress_ComboBox.Text =null;
- BankNumber.Text = null;
- BranchNumber.Text = null;
+ BranchCity.Text = null;
+ //BranchAddress_ComboBox.Text =null;
+ BankNumber.Text = null;
+ BranchNumber_ComboBox.Text = null;
BankAccountNumber.Text = null;
}
}
private void Continue_Click(object sender, RoutedEventArgs e)
{
- if (deleteHost)
+ if (!IsValidEmail(MailAddress.Text))
{
- try { myBL.RemoveHost(host); }
- catch (Exception ex) { throw new Exception(""+ex); }
- MessageBox.Show("Host remove seccessfully");
+ MessageBox.Show("Error in mail format please try again");
+ }
+ else if (!IsTextValid(PrivateName.Text))
+ {
+ MessageBox.Show("error in Private Name format");
+ }
+ else if (!IsTextValid(FamilyName.Text))
+ {
+ MessageBox.Show("error in Family Name Name format");
+ }
+ else if (!IsPhoneNumberValid(PhoneNumber.Text))
+ {
+ MessageBox.Show("error in Phone Number format");
+ }
+ else if (!IsBankAccountValid(BankAccountNumber.Text))
+ {
+ MessageBox.Show("error in Bank Account Number format");
+ }
+ else if (!IspasswordValid(FirstPassword.Content.ToString()))
+ {
+ MessageBox.Show("error in password Number format");
}
else
{
- try
+ if (deleteHost)
{
- if (newHost)
- {
- host = new Host();
- bankAccount = new BankAccount();
- host.FamilyName = FamilyNameTextBox.Text;
-
+ try {
+ MessageBoxResult result = MessageBox.Show("Are you sure\n?", "Delete Host", MessageBoxButton.YesNo, MessageBoxImage.Warning);
+ if (result == MessageBoxResult.Yes)
+ {
+ myBL.RemoveHost(host);
+ }
}
-
- host.PrivateName = PrivateName.Text;
- host.PhoneNumber = PhoneNumber.Text;
- host.MailAddress = MailAddress.Text;
- if (FirstPassword.PasswordHidden.Password != null)
+ catch (Exception ex)
{
- host.PasswordKey = myBL.KeyForPassword(Int32.Parse(FirstPassword.PasswordHidden.Password));
+ MessageBox.Show("Unable to delete host");
+ Console.WriteLine("Unable to delete host" + ex.Message);
}
+ MessageBox.Show("Host remove seccessfully");
+ HostDeleted = true;
+ win.DialogResult = true;
+ win.Close();
+ }
+ else
+ {
+ try
+ {
+ if (newHost)
+ {
+ host = new Host();
+ bankAccount = new BankAccount();
+ //host.FamilyName = FamilyNameTextBox.Text;
- bankAccount.BankName = Bank_ComboBox.Text;
- bankAccount.BranchCity = BranchCity_ComboBox.Text;
- bankAccount.BranchAddress = BranchAddress_ComboBox.Text;
- bankAccount.BankNumber = Convert.ToInt32(BankNumber.Text);
- bankAccount.BranchNumber = Convert.ToInt32(BranchNumber.Text);
- bankAccount.BankAccountNumber = Convert.ToInt32(BankAccountNumber.Text);
+ }
+ host.FamilyName = FamilyName.Text;
+ host.PrivateName = PrivateName.Text;
+ host.PhoneNumber = PhoneNumber.Text;
+ host.MailAddress = MailAddress.Text;
+ if (FirstPassword.PasswordHidden.Password != null)
+ {
+ host.PasswordKey = myBL.KeyForPassword(Int32.Parse(FirstPassword.PasswordHidden.Password));
+ }
+
+ bankAccount.BankName = ((BankDetails)Bank_ComboBox.SelectedItem).BankName;
+ bankAccount.BranchCity = BranchCity.Text;
+ //bankAccount.BranchAddress = BranchAddress_ComboBox.Text;
+ bankAccount.BankNumber = Convert.ToInt32(BankNumber.Text);
+ bankAccount.BranchNumber = ((BankBranch)BranchNumber_ComboBox.SelectedItem).BranchNumber;
+ bankAccount.BankAccountNumber = Convert.ToInt32(BankAccountNumber.Text);
- host.BankAccount = bankAccount;
+ host.BankAccount = bankAccount;
- if (newHost)
- {
- if (myBL.AddHost(host))
- MessageBox.Show("Recived Seccessfully");
- else MessageBox.Show("Error! Make sure you dont miss any field!");
+ if (newHost)
+ {
+ if (myBL.AddHost(host))
+ {
+ MessageBox.Show("Recived Seccessfully");
+ win.Close();
+
+ }
+
+ else MessageBox.Show("Error! Make sure you dont miss any field!");
+ }
+ else
+ {
+ try { myBL.UpdateHost(host); }
+ catch (Exception ex)
+ {
+
+ MessageBox.Show("Unable to update host");
+ Console.WriteLine("Unable to update host" + ex.Message);
+ }
+ }
}
- else
+ catch (Exception ex)
{
- try { myBL.UpdateHost(host); }
- catch (Exception ex) { throw new Exception("" + ex); }
+ MessageBox.Show("Fail!");
+ Console.WriteLine(ex.Message);
}
}
- catch (Exception ex)
- {
- MessageBox.Show("Fail! "+ex);
- }
}
+
+
+ }
+
+ public IEnumerable Banks { get; set; }
+ public string selectedBank { get; set; }
+
+ private void Bank_ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (Bank_ComboBox.SelectedIndex != -1)
+ BranchNumber_ComboBox.ItemsSource = (Banks.ElementAt(Bank_ComboBox.SelectedIndex).Branches);
+ BranchNumber_ComboBox.DisplayMemberPath = "BranchNumber";
+ //Branches = new ObservableCollection((Banks.ElementAt(Bank_ComboBox.SelectedIndex).Branches));
+ if(Bank_ComboBox.SelectedIndex!=-1)
+ BankNumber.Text = Banks.ElementAt(Bank_ComboBox.SelectedIndex).BankNumber.ToString();
+ }
+
+ private void BranchNumber_ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if(Bank_ComboBox.SelectedIndex!=-1&&BranchNumber_ComboBox.SelectedIndex != -1)
+ BranchCity.Text = Banks.ElementAt(Bank_ComboBox.SelectedIndex).Branches.ElementAt(BranchNumber_ComboBox.SelectedIndex).BranchCity;
+ }
+
+
+ public static bool IsValidEmail(string emailAddress)
+ {
+ var regex = @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z";
+ bool isValid = Regex.IsMatch(emailAddress, regex, RegexOptions.IgnoreCase);
+ return isValid;
+ }
+
+ public static bool IsTextValid(string text)
+ {
+ var regex = "^[A-Z][a-zA-Z]*$";
+ bool isValid = Regex.IsMatch(text, regex, RegexOptions.IgnoreCase);
+ return isValid;
+ }
+
+ public static bool IsPhoneNumberValid(string text)
+ {
+ var regex = @"\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})";
+ bool isValid = Regex.IsMatch(text, regex, RegexOptions.IgnoreCase);
+ return isValid;
+ }
+ public static bool IsBankAccountValid(string input)
+ {
+ double x;
+ return double.TryParse(input, out x) && x >= 0 && x <= 99999999;
+ }
+ public static bool IspasswordValid(string input)
+ {
+ double x;
+ return double.TryParse(input, out x) && x >= 10000000 && x <= 99999999;
}
}
}
diff --git a/PLWPF/MainWindow.xaml b/PLWPF/MainWindow.xaml
index 3e886f6..b5ebe79 100644
--- a/PLWPF/MainWindow.xaml
+++ b/PLWPF/MainWindow.xaml
@@ -3,16 +3,24 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:PLWPF"
mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
+ Closed="Window_Closed"
+ Title="MainWindow" Height="450" Width="800" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/MainWindow.xaml.cs b/PLWPF/MainWindow.xaml.cs
index 9f79caf..9c7bcea 100644
--- a/PLWPF/MainWindow.xaml.cs
+++ b/PLWPF/MainWindow.xaml.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading;
using System.Windows;
using BE;
using BL;
@@ -11,38 +12,49 @@ namespace PLWPF
///
public partial class MainWindow : Window
{
+
Host host = null;
MyBl myBL = new MyBl();
-
+ ///
+ /// c-tor
+ ///
public MainWindow()
{
- myBL.bootingUp();
-
- InitializeComponent();
- //preCode preCode = new preCode();
- //preCode.initialize();
+ InitializeComponent ();
+
}
+ ///
+ /// AddRequest_Click event call AddRequestWindow
+ ///
+ ///
+ ///
private void AddRequest_Click(object sender, RoutedEventArgs e)
{
- //Task t = new Task(() => { });
Window win = new AddRequestWindow();
- win.Show();
-
+ win.Show();
}
+ ///
+ /// HostingUnit_Click event call HostingUnitWindow
+ ///
+ ///
+ ///
private void HostingUnit_Click(object sender, RoutedEventArgs e)
{
if (host != null)
{
- Window win = new HostingUnitWindow(host);
- win.Show();
- Window win2 = new HostUpdateWindow(host);
- win2.Show();
+ Window win = new HostingUnitWindow(host,this);
+ win.Show();
}
else MessageBox.Show("Select User Or Sign Up");
}
+ ///
+ /// Orders_Click event call OrdersWindow
+ ///
+ ///
+ ///
private void Orders_Click(object sender, RoutedEventArgs e)
{
if (host != null)
@@ -53,14 +65,64 @@ private void Orders_Click(object sender, RoutedEventArgs e)
else MessageBox.Show("Select User Or Sign Up");
}
+ ///
+ /// Stat_Click event call StatisticsWindow
+ ///
+ ///
+ ///
private void Stat_Click(object sender, RoutedEventArgs e)
{
Window win = new StatisticsWindow();
win.Show();
}
+ ///
+ /// ShowInfo_Click event call ShowInfoWindow
+ ///
+ ///
+ ///
+ private void ShowInfo_Click(object sender, RoutedEventArgs e)
+ {
+ Window win = new Windows.ShowInfoWindows.ShowInfoWindow();
+ win.Show();
+ }
- private void Button_Click(object sender, RoutedEventArgs e)
+ ///
+ /// editHost_Click event call HostUpdateWindow
+ ///
+ ///
+ ///
+ private void editHost_Click(object sender, RoutedEventArgs e)
+ {
+ HostUpdateWindow win = new HostUpdateWindow(host,this);
+ win.ShowDialog();
+
+ if (win.DialogResult == true)
+ {
+ if (win.HostDeleted)
+ LogOut();
+ }
+ }
+ ///
+ /// log out and handle visbility acording
+ ///
+ public void LogOut() {
+ host = null;
+ user.Content = "";
+ guestButton.Visibility = Visibility.Visible;
+ orderButton.Visibility = Visibility.Hidden;
+ editUnitButton.Visibility = Visibility.Hidden;
+ editHostButton.Visibility = Visibility.Hidden;
+ //statButton.Visibility = Visibility.Hidden;
+ ShowInfoButton.Visibility = Visibility.Hidden;
+ }
+
+ ///
+ /// Button_Click event call LogInWindow and handle visibility of some window
+ ///
+ ///
+ ///
+ private void LogIn_Click(object sender, RoutedEventArgs e)
{
try
{
@@ -68,8 +130,29 @@ private void Button_Click(object sender, RoutedEventArgs e)
win.ShowDialog();
if (win.DialogResult == true)
{
+
host = win.HostfromLogin;
user.Content = host.PrivateName + " " + host.FamilyName;
+ guestButton.Visibility = Visibility.Hidden;
+ logout.Visibility = Visibility.Visible;
+ if (host.HostKey == 00000000)
+ {
+ orderButton.Visibility = Visibility.Hidden;
+ editUnitButton.Visibility = Visibility.Hidden;
+ editHostButton.Visibility = Visibility.Hidden;
+ ShowInfoButton.Visibility = Visibility.Visible;
+ //statButton.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ ShowInfoButton.Visibility = Visibility.Hidden;
+ //statButton.Visibility = Visibility.Hidden;
+ orderButton.Visibility = Visibility.Visible;
+ editUnitButton.Visibility = Visibility.Visible;
+ editHostButton.Visibility = Visibility.Visible;
+ // statButton.Visibility = Visibility.Hidden;
+
+ }
}
}
catch (Exception)
@@ -80,5 +163,25 @@ private void Button_Click(object sender, RoutedEventArgs e)
}
}
+
+ ///
+ /// LogOut_Click event logOut and change visibility of some windows
+ ///
+ ///
+ ///
+ private void LogOut_Click(object sender, RoutedEventArgs e)
+ {
+ LogOut();
+ }
+
+ ///
+ /// When the main window closed, exit the environment
+ ///
+ ///
+ ///
+ private void Window_Closed(object sender, EventArgs e)
+ {
+ Environment.Exit(Environment.ExitCode);
+ }
}
}
diff --git a/PLWPF/PLWPF.csproj b/PLWPF/PLWPF.csproj
index 1849ebb..cada895 100644
--- a/PLWPF/PLWPF.csproj
+++ b/PLWPF/PLWPF.csproj
@@ -14,6 +14,21 @@
4
true
true
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
AnyCPU
@@ -68,10 +83,33 @@
Password.xaml
-
+
+ SplashScreenWindow.xaml
+
HostingUnitUserControl.xaml
+
+ HostInfoPage.xaml
+
+
+ OrderInfoPage.xaml
+
+
+ RequestInfoPage.xaml
+
+
+ ShowInfoWindow.xaml
+
+
+ UnitInfoPage.xaml
+
+
+ checker.xaml
+
+
+ GraphBarsUserControl.xaml
+
GuestRequestQueryPage.xaml
@@ -117,10 +155,42 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -236,5 +306,22 @@
BL
+
+
+ False
+ Microsoft .NET Framework 4.6.1 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PLWPF/SplashScreenWindow.xaml b/PLWPF/SplashScreenWindow.xaml
new file mode 100644
index 0000000..94bc56d
--- /dev/null
+++ b/PLWPF/SplashScreenWindow.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/SplashScreenWindow.xaml.cs b/PLWPF/SplashScreenWindow.xaml.cs
new file mode 100644
index 0000000..be64855
--- /dev/null
+++ b/PLWPF/SplashScreenWindow.xaml.cs
@@ -0,0 +1,80 @@
+using BL;
+using System;
+using System.Threading;
+using System.Windows;
+
+namespace PLWPF
+{
+ ///
+ /// Interaction logic for SplashScreenWindow.xaml
+ ///
+ public partial class SplashScreenWindow : Window
+ {
+ Thread thread;
+ MainWindow mainwindow = new MainWindow();
+ MyBl myBL = new MyBl();
+
+ ///
+ /// c-tor
+ ///
+ public SplashScreenWindow()
+ {
+ InitializeComponent();
+
+ try
+ {
+ thread = new Thread(doWork) { IsBackground = true };
+ thread.Start();
+ }
+ catch (Exception ex){MessageBox.Show("" + ex.Message);}
+ }
+
+
+ ///
+ /// Refresh the Database and close the window when it finise or when 10 sec pass, the leteset
+ ///
+ public void doWork()
+ {
+ Action closingTheWindow =()=> this.Close();
+ Action RefreshingInfoLabel = () => InfoLabel.Content = "Initialize";
+
+ TimeSpan dalta = new TimeSpan(0, 0, 0, 1);
+ DateTime bagin = DateTime.Now;
+ try { myBL.RefreshDatabase(); }
+ catch (Exception ex) { throw new Exception(""+ex); }
+ finally
+ {
+ Dispatcher.BeginInvoke(RefreshingInfoLabel);
+
+ //Wait for a the minimel time of 10 sec
+ while (DateTime.Now - bagin < dalta) { }
+ Dispatcher.BeginInvoke(closingTheWindow);
+ }
+
+ }
+
+ ///
+ /// Window Closed event thet show the main window and handle the progres bar (it not properly without it)
+ ///
+ ///
+ ///
+ private void Window_Closed(object sender, EventArgs e)
+ {
+ thread.Abort();
+ mainwindow.Show();
+ Progress.IsIndeterminate = false;
+ }
+
+ ///
+ /// handle the progres bar (it not work without it)
+ ///
+ ///
+ ///
+ private void Window_ContentRendered(object sender, EventArgs e)
+ {
+ Progress.Visibility = Visibility.Visible;
+ Progress.IsIndeterminate = true;
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/PLWPF/Windows/AddRequestWindow.xaml b/PLWPF/Windows/AddRequestWindow.xaml
index ec67e35..32d21da 100644
--- a/PLWPF/Windows/AddRequestWindow.xaml
+++ b/PLWPF/Windows/AddRequestWindow.xaml
@@ -12,13 +12,13 @@
-
+
-
+
-
+
-
+
@@ -39,6 +39,7 @@
+
diff --git a/PLWPF/Windows/AddRequestWindow.xaml.cs b/PLWPF/Windows/AddRequestWindow.xaml.cs
index 5445f34..72fac63 100644
--- a/PLWPF/Windows/AddRequestWindow.xaml.cs
+++ b/PLWPF/Windows/AddRequestWindow.xaml.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -23,58 +24,139 @@ public partial class AddRequestWindow : Window
{
MyBl myBL = new MyBl();
+ ///
+ /// c-tor
+ ///
public AddRequestWindow()
{
InitializeComponent();
AreaComboBox.ItemsSource = Enum.GetValues(typeof(BE.Area)).Cast();
- ComboBoxPool.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxJacuzzi.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxAttrac.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxSpredBads.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxAirCondsner.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxGarden.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxSingog.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxTrensp.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
+ ComboBoxPool.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxJacuzzi.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxAttrac.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxSpredBads.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxAirCondsner.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxGarden.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxSingog.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
+ ComboBoxTrensp.ItemsSource = Enum.GetValues(typeof(BE.GestRequirements)).Cast();
}
- private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ ///
+ /// Add the Request
+ ///
+ ///
+ ///
+ private void Button_Click(object sender, RoutedEventArgs e)
{
+ DateTime startDate = EntryDate.SelectedDate ?? DateTime.Now;
+ DateTime endDate = ReleaseDate.SelectedDate ?? DateTime.Now;
- }
+ if(startDate < DateTime.Now)
+ {
+ MessageBox.Show("can't order ealier date than today");
+ }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- try
+ else if (!myBL.IsDateCorrect(startDate, endDate))
+ {
+ MessageBox.Show("can't add this request, Release Date before Entry Date!");
+ }
+
+ else if (!IsValidEmail(mailAddress.Text))
+ {
+ MessageBox.Show("error in mail address format");
+ }
+ else if (!IsTextValid(FirstName.Text))
+ {
+ MessageBox.Show("error in First Name format");
+ }
+ else if (!IsTextValid(LastName.Text))
+ {
+ MessageBox.Show("error in Last Name format");
+ }
+ else if (!IsTextValid(SubArea.Text))
+ {
+ MessageBox.Show("error in Sub Area format");
+ }
+ else try
{
GuestRequest guest = new GuestRequest();
guest.PrivateName = FirstName.Text;
guest.FamilyName = LastName.Text;
-
-
- guest.EntryDate = EntryDate.DisplayDate;
- guest.ReleaseDate = ReleaseDate.DisplayDate;
+ guest.EntryDate = startDate;
+ guest.ReleaseDate = endDate;
guest.SubArea = SubArea.Text;
-
+ guest.MailAddress = mailAddress.Text;
guest.Area = (Area)AreaComboBox.SelectedItem;
- guest.Pool = (Requirements)ComboBoxPool.SelectedItem;
- guest.Jacuzzi = (Requirements)ComboBoxJacuzzi.SelectedItem;
- guest.ChildrensAttractions = (Requirements)ComboBoxAttrac.SelectedItem;
- guest.SpredBads = (Requirements)ComboBoxSpredBads.SelectedItem;
- guest.AirCondsner = (Requirements)ComboBoxAirCondsner.SelectedItem;
- guest.Garden = (Requirements)ComboBoxGarden.SelectedItem;
- guest.SingogNaerBy = (Requirements)ComboBoxSingog.SelectedItem;
- guest.NaerPublicTrensportion = (Requirements)ComboBoxTrensp.SelectedItem;
+ guest.Pool = (GestRequirements)ComboBoxPool.SelectedItem;
+ guest.Jacuzzi = (GestRequirements)ComboBoxJacuzzi.SelectedItem;
+ guest.ChildrensAttractions = (GestRequirements)ComboBoxAttrac.SelectedItem;
+ guest.SpredBads = (GestRequirements)ComboBoxSpredBads.SelectedItem;
+ guest.AirCondsner = (GestRequirements)ComboBoxAirCondsner.SelectedItem;
+ guest.Garden = (GestRequirements)ComboBoxGarden.SelectedItem;
+ guest.SingogNaerBy = (GestRequirements)ComboBoxSingog.SelectedItem;
+ guest.NaerPublicTrensportion = (GestRequirements)ComboBoxTrensp.SelectedItem;
- myBL.AddGuestRequest(guest);
+ bool check = myBL.AddGuestRequest(guest);
+ if(check)
MessageBox.Show("Recived Seccessfully");
+ this.Close();
}
- catch (Exception)
+ catch (Exception ex)
{
- MessageBox.Show("Error! Make sure you dont miss any field!");
+ MessageBox.Show("Error! Make sure you dont miss any field and !");
}
}
+
+ ///
+ /// Cancel change in the form
+ ///
+ ///
+ ///
+ private void CancelChanges_PreviewMouseDown(object sender, RoutedEventArgs e)
+ {
+ FirstName.Text = "";
+ LastName.Text = "";
+ EntryDate.Text = "";
+ ReleaseDate.Text = "";
+ SubArea.Text = "";
+ mailAddress.Text = "";
+ AreaComboBox.SelectedItem = null;
+ ComboBoxPool.SelectedItem = null;
+ ComboBoxJacuzzi.SelectedItem = null;
+ ComboBoxAttrac.SelectedItem = null;
+ ComboBoxSpredBads.SelectedItem = null;
+ ComboBoxAirCondsner.SelectedItem = null;
+ ComboBoxGarden.SelectedItem = null;
+ ComboBoxSingog.SelectedItem = null;
+ ComboBoxTrensp.SelectedItem = null;
+ }
+
+ private void EntryDate_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ ReleaseDate.DisplayDateStart = EntryDate.DisplayDate;
+
+ ReleaseDate.BringIntoView();
+
+ // ReleaseDate.UpdateLayout();
+ }
+
+ public static bool IsValidEmail(string emailAddress)
+ {
+ var regex = @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z";
+ bool isValid = Regex.IsMatch(emailAddress, regex, RegexOptions.IgnoreCase);
+ return isValid;
+ }
+
+ public static bool IsTextValid(string text)
+ {
+ var regex = "^[A-Z][a-zA-Z]*$";
+ bool isValid = Regex.IsMatch(text, regex, RegexOptions.IgnoreCase);
+ return isValid;
+ }
+
+
}
}
\ No newline at end of file
diff --git a/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml b/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml
index 52ea922..2ca70ae 100644
--- a/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml
+++ b/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml
@@ -5,8 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:PLWPF.Windows.HostingUnitWindows"
mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
-
+ d:DesignHeight="650" d:DesignWidth="800">
+
@@ -22,7 +22,8 @@
-
+
+
@@ -46,7 +47,7 @@
-
+
diff --git a/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml.cs b/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml.cs
index 1bb530b..a34163e 100644
--- a/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml.cs
+++ b/PLWPF/Windows/HostingUnitWindows/HostingUnitUserControl.xaml.cs
@@ -17,15 +17,16 @@ public partial class HostingUnitUserControl : UserControl
Host host;
HostingUnit hostingUnit;
bool newUnit, deleteUnit;
-
+ Window win;
///
/// c-tor
///
///
///
///
- public HostingUnitUserControl(Host host, bool newUnit, bool deleteUnit)
+ public HostingUnitUserControl(Host host, bool newUnit, bool deleteUnit ,Window win)
{
+ this.win = win;
this.newUnit = newUnit;
this.deleteUnit = deleteUnit;
InitializeComponent();
@@ -35,7 +36,7 @@ public HostingUnitUserControl(Host host, bool newUnit, bool deleteUnit)
hostName.Text = host.FamilyName;
hostId.Text = host.HostKey.ToString();
- //depend on what page you in
+ //depend on which page you in
button.Content = (deleteUnit == false) ? "Save" : "Delete";
//if you add new unit you need to change the comboBox to TextBox
@@ -53,18 +54,18 @@ public HostingUnitUserControl(Host host, bool newUnit, bool deleteUnit)
HostingUnitKeyComboBox.ItemsSource = myBL.HustingUnitsBy(x => x.Owner.HostKey == host.HostKey);
HostingUnitKeyComboBox.DisplayMemberPath = "HostingUnitName";
}
-
+
//ComboBox Items Source
ComboBoxHostingType.ItemsSource= Enum.GetValues(typeof(BE.HostingType)).Cast();
AreaComboBox.ItemsSource = Enum.GetValues(typeof(BE.Area)).Cast();
- ComboBoxPool.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxJacuzzi.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxAttrac.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxSpredBads.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxAirCondsner.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxGarden.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxSingog.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- ComboBoxTrensp.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
+ ComboBoxPool.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxJacuzzi.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxAttrac.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxSpredBads.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxAirCondsner.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxGarden.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxSingog.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
+ ComboBoxTrensp.ItemsSource = Enum.GetValues(typeof(BE.UnitRequirements)).Cast();
}
@@ -80,25 +81,38 @@ private void HostingUnitKeyComboBox_SelectionChanged(object sender, SelectionCha
}
///
- /// Feel the Textbox & ComboBox with the Unit details
+ /// Fills the Textbox & ComboBox with the Unit details
///
///
private void InitialHostingUnit(HostingUnit unit)
{
- ComboBoxHostingType.SelectedItem = unit.HostingType;
- Adults.Text = unit.Adults.ToString();
- Children.Text = unit.Children.ToString();
- AreaComboBox.SelectedItem = unit.Area;
- SubArea.Text = unit.SubArea;
- ComboBoxPool.SelectedItem = unit.Pool;
- ComboBoxJacuzzi.SelectedItem = unit.Jacuzzi;
- ComboBoxAttrac.SelectedItem = unit.ChildrensAttractions;
- ComboBoxSpredBads.SelectedItem = unit.SpredBads;
- ComboBoxAirCondsner.SelectedItem = unit.AirCondsner;
- ComboBoxGarden.SelectedItem = unit.Garden;
- ComboBoxSingog.SelectedItem = unit.SingogNaerBy;
- ComboBoxTrensp.SelectedItem = unit.NaerPublicTrensportion;
+ try
+ {
+ if (!newUnit && unit!= null)
+ {
+ ComboBoxHostingType.SelectedItem = unit.HostingType;
+ Adults.Text = unit.Adults.ToString();
+ Children.Text = unit.Children.ToString();
+ AreaComboBox.SelectedItem = unit.Area;
+ SubArea.Text = unit.SubArea;
+ ComboBoxPool.SelectedItem = (UnitRequirements)unit.Pool;
+ ComboBoxJacuzzi.SelectedItem = (UnitRequirements)unit.Jacuzzi;
+ ComboBoxAttrac.SelectedItem = (UnitRequirements)unit.ChildrensAttractions;
+ ComboBoxSpredBads.SelectedItem = (UnitRequirements)unit.SpredBads;
+ ComboBoxAirCondsner.SelectedItem = (UnitRequirements)unit.AirCondsner;
+ ComboBoxGarden.SelectedItem = (UnitRequirements)unit.Garden;
+ ComboBoxSingog.SelectedItem = (UnitRequirements)unit.SingogNaerBy;
+ ComboBoxTrensp.SelectedItem = (UnitRequirements)unit.NaerPublicTrensportion;
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine("" + ex);
+ MessageBox.Show("" + ex.Message);
+ }
+
}
+
///
/// button_Click will save the changes, or will delete the unit, depende the page.
@@ -107,56 +121,78 @@ private void InitialHostingUnit(HostingUnit unit)
///
private void button_Click(object sender, RoutedEventArgs e)
{
- if (deleteUnit == true)
+ try
{
- MessageBoxResult result = MessageBox.Show("Are you sure\n?", "Delete unit", MessageBoxButton.YesNo, MessageBoxImage.Warning);
- if (result == MessageBoxResult.Yes)
+ if (deleteUnit)
{
+
try
{
- myBL.UnitRemove(hostingUnit.HostingUnitKey);
+ if (hostingUnit == null) throw new AccessViolationException("No unit to delete!");
+ MessageBoxResult result = MessageBox.Show("Are you sure\n?", "Delete unit", MessageBoxButton.YesNo, MessageBoxImage.Warning);
+ if (result == MessageBoxResult.Yes)
+ {
+ myBL.UnitRemove(hostingUnit.HostingUnitKey);
MessageBox.Show("Unit deleted");
+ win.Close();
+ }
}
+ catch (AccessViolationException ex) { throw new Exception("" + ex.Message); }
catch (Exception ex)
{
- throw new Exception("Fail to delete unit \n " + ex);
+ Console.WriteLine("" + ex);
+ throw new Exception("Fail to delete unit \n ");
}
}
- }
- else
- {
- if (newUnit == true)
- {
- hostingUnit.HostingUnitName = HostingUnitKeyTextBox.Text;
- hostingUnit.Owner = host;
- }
- hostingUnit.HostingType = (HostingType)ComboBoxHostingType.SelectedItem;
- hostingUnit.Children = Int32.Parse(Children.Text);
- hostingUnit.Adults = Int32.Parse(Adults.Text);
- hostingUnit.SubArea = SubArea.Text;
- hostingUnit.Area = (Area)AreaComboBox.SelectedItem;
- hostingUnit.Pool = (Requirements)ComboBoxPool.SelectedItem;
- hostingUnit.Jacuzzi = (Requirements)ComboBoxJacuzzi.SelectedItem;
- hostingUnit.ChildrensAttractions = (Requirements)ComboBoxAttrac.SelectedItem;
- hostingUnit.SpredBads = (Requirements)ComboBoxSpredBads.SelectedItem;
- hostingUnit.AirCondsner = (Requirements)ComboBoxAirCondsner.SelectedItem;
- hostingUnit.Garden = (Requirements)ComboBoxGarden.SelectedItem;
- hostingUnit.SingogNaerBy = (Requirements)ComboBoxSingog.SelectedItem;
- hostingUnit.NaerPublicTrensportion = (Requirements)ComboBoxTrensp.SelectedItem;
- try
+ else
{
- if (newUnit == false)
- myBL.UpdateUnit(hostingUnit);
- else
- myBL.AddHostingUnit(hostingUnit);
- }
- catch (Exception ex)
- {
- MessageBox.Show("" + ex);
- }
+ try
+ {
+ if (!newUnit && hostingUnit == null) throw new AccessViolationException("No unit to Update!");
+ if (newUnit)
+ {
+ hostingUnit.HostingUnitName = HostingUnitKeyTextBox.Text;
+ hostingUnit.Owner = host;
+ }
+ hostingUnit.HostingType = (HostingType)ComboBoxHostingType.SelectedItem;
+ hostingUnit.Children = Int32.Parse(Children.Text);
+ hostingUnit.Adults = Int32.Parse(Adults.Text);
+ hostingUnit.SubArea = SubArea.Text;
+ hostingUnit.Area = (Area)AreaComboBox.SelectedItem;
+ hostingUnit.Pool = (GestRequirements)ComboBoxPool.SelectedItem;
+ hostingUnit.Jacuzzi = (GestRequirements)ComboBoxJacuzzi.SelectedItem;
+ hostingUnit.ChildrensAttractions = (GestRequirements)ComboBoxAttrac.SelectedItem;
+ hostingUnit.SpredBads = (GestRequirements)ComboBoxSpredBads.SelectedItem;
+ hostingUnit.AirCondsner = (GestRequirements)ComboBoxAirCondsner.SelectedItem;
+ hostingUnit.Garden = (GestRequirements)ComboBoxGarden.SelectedItem;
+ hostingUnit.SingogNaerBy = (GestRequirements)ComboBoxSingog.SelectedItem;
+ hostingUnit.NaerPublicTrensportion = (GestRequirements)ComboBoxTrensp.SelectedItem;
+ }
+ catch (AccessViolationException ex){throw new Exception("" + ex.Message);}
+ catch (Exception ex){
+ Console.WriteLine("" + ex);
+ throw new Exception("You'r missing some fields!");
+ }
+ try
+ {
+ if (newUnit) myBL.AddHostingUnit(hostingUnit);
+ else myBL.UpdateUnit(hostingUnit);
+ MessageBox.Show((newUnit ? "Adding" : "Update") + " Unit Secsessfully!");
+ win.Close();
+ }
+ catch (Exception ex){
+ Console.WriteLine("" + ex);
+ throw new Exception((newUnit ? "Add fail! " : "Update fail! "));
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(""+ex.Message);
+ Console.WriteLine("" + ex);
}
}
diff --git a/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml b/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml
index c41fb28..fc75882 100644
--- a/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml
+++ b/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml
@@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PLWPF"
mc:Ignorable="d"
+ Closed="Window_Closed"
Title="HostingUnitWindow" Height="700" Width="804">
diff --git a/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml.cs b/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml.cs
index fd13796..a37ec8c 100644
--- a/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml.cs
+++ b/PLWPF/Windows/HostingUnitWindows/HostingUnitWindow.xaml.cs
@@ -9,12 +9,20 @@ namespace PLWPF
///
public partial class HostingUnitWindow : Window
{
- public HostingUnitWindow(Host host)
+ Window mainWindow;
+ public HostingUnitWindow(Host host,Window mainWindow)
{
+ this.mainWindow = mainWindow;
+ mainWindow.Hide();
InitializeComponent();
- AddNewUnitFrame.Content = new HostingUnitUserControl(host,true, false);
- UpdateUnitFrame.Content = new HostingUnitUserControl(host, false, false);
- DeleteUnitFrame.Content = new HostingUnitUserControl(host, false, true);
+ AddNewUnitFrame.Content = new HostingUnitUserControl(host,true, false,this);
+ UpdateUnitFrame.Content = new HostingUnitUserControl(host, false, false, this);
+ DeleteUnitFrame.Content = new HostingUnitUserControl(host, false, true, this);
+ }
+
+ private void Window_Closed(object sender, System.EventArgs e)
+ {
+ mainWindow.Visibility = Visibility.Visible;
}
}
}
diff --git a/PLWPF/Windows/Image/1.jpg b/PLWPF/Windows/Image/1.jpg
new file mode 100644
index 0000000..41cf1ec
Binary files /dev/null and b/PLWPF/Windows/Image/1.jpg differ
diff --git a/PLWPF/Windows/Image/2.jpg b/PLWPF/Windows/Image/2.jpg
new file mode 100644
index 0000000..1fc9fd0
Binary files /dev/null and b/PLWPF/Windows/Image/2.jpg differ
diff --git a/PLWPF/Windows/Image/3.jpg b/PLWPF/Windows/Image/3.jpg
new file mode 100644
index 0000000..7dec6d7
Binary files /dev/null and b/PLWPF/Windows/Image/3.jpg differ
diff --git a/PLWPF/Windows/LogInWindow.xaml b/PLWPF/Windows/LogInWindow.xaml
index 79ccc55..bf2f932 100644
--- a/PLWPF/Windows/LogInWindow.xaml
+++ b/PLWPF/Windows/LogInWindow.xaml
@@ -10,15 +10,15 @@
-
-
+
+
-
+ PreviewMouseDown="ForgetYourPassword_PreviewMouseDown" Margin="329,208,332,193" Height="20"/>
+
diff --git a/PLWPF/Windows/LogInWindow.xaml.cs b/PLWPF/Windows/LogInWindow.xaml.cs
index eda048a..e8998d9 100644
--- a/PLWPF/Windows/LogInWindow.xaml.cs
+++ b/PLWPF/Windows/LogInWindow.xaml.cs
@@ -63,7 +63,11 @@ private void Register_Click(object sender, RoutedEventArgs e)
///
private void ENTER_Click(object sender, RoutedEventArgs e)
{
- try
+ if (!IspasswordValid(Password.PasswordHidden.Password))
+ {
+ MessageBox.Show("error in password Number format");
+ }
+ else try
{
if (myBL.CheckePassword(host.PasswordKey, Int32.Parse(Password.PasswordHidden.Password)))
{
@@ -75,7 +79,8 @@ private void ENTER_Click(object sender, RoutedEventArgs e)
}
catch(Exception ex)
{
- MessageBox.Show("Problem with the password \n" + ex);
+ MessageBox.Show("Problem with the password \n");
+ Console.WriteLine(ex.Message);
}
}
@@ -101,18 +106,21 @@ private void ForgetYourPassword_PreviewMouseDown(object sender, MouseButtonEvent
try
{
if (worker.IsBusy != true) worker.RunWorkerAsync();
- MessageBox.Show("Email was sent!","Massage", MessageBoxButton.OK, MessageBoxImage.Information);
}
catch (Exception ex)
{
- MessageBox.Show("Fail to send the Email\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ MessageBox.Show(""+ ex.Message);
}
}
}
+ public static bool IspasswordValid(string input)
+ {
+ double x;
+ return double.TryParse(input, out x) && x >= 10000000 && x <= 99999999;
+ }
-
}
}
diff --git a/PLWPF/Windows/NewOrder/HostingUnitPage.xaml.cs b/PLWPF/Windows/NewOrder/HostingUnitPage.xaml.cs
index 0beac97..102f4aa 100644
--- a/PLWPF/Windows/NewOrder/HostingUnitPage.xaml.cs
+++ b/PLWPF/Windows/NewOrder/HostingUnitPage.xaml.cs
@@ -1,18 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
+using System.Windows.Controls;
using BE;
using BL;
@@ -58,19 +44,19 @@ public GuestRequestPage(GuestRequest guestRequest)
//}
adultsTextBox.Text = hostingUnit.Adults.ToString();
- airCondsnerTextBox.Text = hostingUnit.AirCondsner.ToString();
+ airCondsnerTextBox.Text = ((UnitRequirements)hostingUnit.AirCondsner).ToString();
areaTextBox.Text = hostingUnit.Area.ToString();
- childrenTextBox.Text = hostingUnit.Children.ToString();
- childrensAttractionsTextBox.Text = hostingUnit.ChildrensAttractions.ToString();
- frisiderTextBox.Text = hostingUnit.frisider.ToString();
- gardenTextBox.Text = hostingUnit.Garden.ToString();
- hostingTypeTextBox.Text = hostingUnit.HostingType.ToString();
- jacuzziTextBox.Text = hostingUnit.Jacuzzi.ToString();
- naerPublicTrensportionTextBox.Text = hostingUnit.NaerPublicTrensportion.ToString();
- poolTextBox.Text = hostingUnit.Pool.ToString();
- singogNaerByTextBox.Text = hostingUnit.SingogNaerBy.ToString();
- spredBadsTextBox.Text = hostingUnit.SpredBads.ToString();
- //subAreaTextBox.Text = hostingUnit.SubArea.ToString();
+ childrenTextBox.Text = ((UnitRequirements)hostingUnit.Children).ToString();
+ childrensAttractionsTextBox.Text = ((UnitRequirements)hostingUnit.ChildrensAttractions).ToString();
+ frisiderTextBox.Text = ((UnitRequirements)hostingUnit.frisider).ToString();
+ gardenTextBox.Text = ((UnitRequirements)hostingUnit.Garden).ToString();
+ hostingTypeTextBox.Text = ((UnitRequirements)hostingUnit.HostingType).ToString();
+ jacuzziTextBox.Text = ((UnitRequirements)hostingUnit.Jacuzzi).ToString();
+ naerPublicTrensportionTextBox.Text = ((UnitRequirements)hostingUnit.NaerPublicTrensportion).ToString();
+ poolTextBox.Text = ((UnitRequirements)hostingUnit.Pool).ToString();
+ singogNaerByTextBox.Text = ((UnitRequirements)hostingUnit.SingogNaerBy).ToString();
+ spredBadsTextBox.Text = ((UnitRequirements)hostingUnit.SpredBads).ToString();
+ // subAreaTextBox.Text = hostingUnit.SubArea.ToString();
}
}
}
diff --git a/PLWPF/Windows/NewOrder/NewOrderWindow.xaml.cs b/PLWPF/Windows/NewOrder/NewOrderWindow.xaml.cs
index 90f1f90..87f6b8a 100644
--- a/PLWPF/Windows/NewOrder/NewOrderWindow.xaml.cs
+++ b/PLWPF/Windows/NewOrder/NewOrderWindow.xaml.cs
@@ -22,7 +22,7 @@ public partial class NewOrderWindow : Window
public NewOrderWindow(Host host )
{
InitializeComponent();
- BE.Order order = new BE.Order();
+ Order order = new Order();
this.host= host;
hostName.Text = host.FamilyName;
hostId.Text = host.HostKey.ToString();
@@ -70,7 +70,8 @@ private void Worker_SendMailWithNewOffer(object sender, DoWorkEventArgs e)
///
///
private void button_Click(object sender, RoutedEventArgs e)
- {
+ { try
+ {
Order order = new Order()
{
CreateDate = DateTime.Now,
@@ -81,40 +82,44 @@ private void button_Click(object sender, RoutedEventArgs e)
OrderKey = Configuration.serialOrder++
};
- try
- {
- myBL.AddOrder(order);
- worker.DoWork += Worker_SendMailWithNewOffer;
- worker.RunWorkerAsync(order);
- try
- {
- if (worker.IsBusy != true) worker.RunWorkerAsync();
- MessageBox.Show("Email was sent!", "Massage", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- catch (Exception ex)
+
+ var check = myBL.AddOrder(order);
+ if (check)
{
- MessageBox.Show("Fail to send the Email\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
- }
-
-
-
-
-
+ worker.DoWork += Worker_SendMailWithNewOffer;
+ worker.RunWorkerAsync(order);
+ try
+ {
+ if (worker.IsBusy != true) worker.RunWorkerAsync();
+ MessageBox.Show("Email was sent!", "Massage", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Fail to send the Email\n", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
try
- {
- myBL.SendMail(order);
+ {
+ myBL.SendMail(order);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Can't sand mail");
+ Console.WriteLine("Can't sand mail" + ex.Message);
+ }
+ MessageBox.Show("Order Created Seccessfuly!");
+ this.Close();
}
- catch(Exception ex)
+ else
{
- throw new Exception("Can't sand mail ", ex);
+ MessageBox.Show("No Aviable Rooms For This Date!");
}
- MessageBox.Show("Order Created Seccessfuly!");
- this.Close();
+
}
catch (Exception ex)
{
- MessageBox.Show("Error! please try again later "+ex);
+ MessageBox.Show("Error! please try again later");
+ Console.WriteLine(ex.Message);
this.Close();
}
diff --git a/PLWPF/Windows/Register.xaml b/PLWPF/Windows/Register.xaml
index 50662b4..0f3f601 100644
--- a/PLWPF/Windows/Register.xaml
+++ b/PLWPF/Windows/Register.xaml
@@ -1,12 +1,14 @@
-
-
+
+ Title="Register" Height="613.098" Width="565.262">
+
+
diff --git a/PLWPF/Windows/Register.xaml.cs b/PLWPF/Windows/Register.xaml.cs
index 59be5ed..66cf0c9 100644
--- a/PLWPF/Windows/Register.xaml.cs
+++ b/PLWPF/Windows/Register.xaml.cs
@@ -1,31 +1,19 @@
-using BE;
-using BL;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
namespace PLWPF.Windows
{
- ///
- /// Interaction logic for Register.xaml
- ///
+
public partial class Register : Window
{
-
+
public Register()
{
InitializeComponent();
- Host_UserControl.Content = new HostUserControl(null,false);
+ Host_UserControl.Content = new HostUserControl(null,false,this);
+
}
}
-}
\ No newline at end of file
+}
+
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/HostInfoPage.xaml b/PLWPF/Windows/ShowInfoWindows/HostInfoPage.xaml
new file mode 100644
index 0000000..61602f6
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/HostInfoPage.xaml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/HostInfoPage.xaml.cs b/PLWPF/Windows/ShowInfoWindows/HostInfoPage.xaml.cs
new file mode 100644
index 0000000..95769bc
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/HostInfoPage.xaml.cs
@@ -0,0 +1,98 @@
+using System.Windows.Controls;
+using System.Windows;
+using System.Windows.Data;
+using BL;
+using System.ComponentModel;
+
+namespace PLWPF.Windows.ShowInfoWindows
+{
+ ///
+ /// Interaction logic for HostInfoPage.xaml
+ ///
+ public partial class HostInfoPage : Page
+ {
+ public HostInfoPage()
+ {
+
+ InitializeComponent();
+ HostListView.ItemsSource = myBL.GetHosts();
+ view = (CollectionView)CollectionViewSource.GetDefaultView(HostListView.ItemsSource);
+ }
+
+ MyBl myBL = new MyBl();
+ CollectionView view;
+
+ private void HosttListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ }
+
+ //-----------------------------------------------------------------------------------------------
+
+ GridViewColumnHeader _lastHeaderClicked = null;
+
+ private void ListViewColumnHeaderClick(object sender, RoutedEventArgs e)
+ {
+ GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader;
+
+ if (headerClicked == null)
+ return;
+
+ if (headerClicked.Role == GridViewColumnHeaderRole.Padding)
+ return;
+
+ var sortingColumn = (headerClicked.Column.DisplayMemberBinding as Binding)?.Path?.Path;
+ if (sortingColumn == null)
+ return;
+
+ var direction = ApplySort(view, sortingColumn);
+ //var direction = ApplySort(Items, sortingColumn);
+
+
+ if (direction == ListSortDirection.Ascending)
+ {
+
+ headerClicked.Column.HeaderTemplate = Resources["HeaderTemplateArrowUp"] as DataTemplate;
+
+ }
+ else
+ {
+ headerClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateArrowDown"] as DataTemplate;
+ }
+
+ // Remove arrow from previously sorted header
+ if (_lastHeaderClicked != null && _lastHeaderClicked != headerClicked)
+ {
+ _lastHeaderClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateDefault"] as DataTemplate;
+ }
+
+ _lastHeaderClicked = headerClicked;
+ }
+
+ public static ListSortDirection ApplySort(ICollectionView view, string propertyName)
+ {
+ ListSortDirection direction = ListSortDirection.Ascending;
+ if (view.SortDescriptions.Count > 0)
+ {
+ SortDescription currentSort = view.SortDescriptions[0];
+ if (currentSort.PropertyName == propertyName)
+ {
+ if (currentSort.Direction == ListSortDirection.Ascending)
+ direction = ListSortDirection.Descending;
+ else
+ direction = ListSortDirection.Ascending;
+ }
+ view.SortDescriptions.Clear();
+ }
+ if (!string.IsNullOrEmpty(propertyName))
+ {
+ view.SortDescriptions.Add(new SortDescription(propertyName, direction));
+ }
+ return direction;
+ }
+
+ }
+}
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/OrderInfoPage.xaml b/PLWPF/Windows/ShowInfoWindows/OrderInfoPage.xaml
new file mode 100644
index 0000000..d60bb8e
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/OrderInfoPage.xaml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/OrderInfoPage.xaml.cs b/PLWPF/Windows/ShowInfoWindows/OrderInfoPage.xaml.cs
new file mode 100644
index 0000000..9263aaa
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/OrderInfoPage.xaml.cs
@@ -0,0 +1,97 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using BL;
+using System.ComponentModel;
+
+namespace PLWPF.Windows.ShowInfoWindows
+{
+ ///
+ /// Interaction logic for OrderInfoPage.xaml
+ ///
+ public partial class OrderInfoPage : Page
+ {
+ public OrderInfoPage()
+ {
+ InitializeComponent();
+ OrderListView.ItemsSource = myBL.GetOrders();
+ view = (CollectionView)CollectionViewSource.GetDefaultView(OrderListView.ItemsSource);
+ }
+
+ MyBl myBL = new MyBl();
+ CollectionView view;
+
+ private void OrderListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ }
+
+ //-----------------------------------------------------------------------------------------------
+
+ GridViewColumnHeader _lastHeaderClicked = null;
+
+ private void ListViewColumnHeaderClick(object sender, RoutedEventArgs e)
+ {
+ GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader;
+
+ if (headerClicked == null)
+ return;
+
+ if (headerClicked.Role == GridViewColumnHeaderRole.Padding)
+ return;
+
+ var sortingColumn = (headerClicked.Column.DisplayMemberBinding as Binding)?.Path?.Path;
+ if (sortingColumn == null)
+ return;
+
+ var direction = ApplySort(view, sortingColumn);
+ //var direction = ApplySort(Items, sortingColumn);
+
+
+ if (direction == ListSortDirection.Ascending)
+ {
+
+ headerClicked.Column.HeaderTemplate = Resources["HeaderTemplateArrowUp"] as DataTemplate;
+
+ }
+ else
+ {
+ headerClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateArrowDown"] as DataTemplate;
+ }
+
+ // Remove arrow from previously sorted header
+ if (_lastHeaderClicked != null && _lastHeaderClicked != headerClicked)
+ {
+ _lastHeaderClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateDefault"] as DataTemplate;
+ }
+
+ _lastHeaderClicked = headerClicked;
+ }
+
+ public static ListSortDirection ApplySort(ICollectionView view, string propertyName)
+ {
+ ListSortDirection direction = ListSortDirection.Ascending;
+ if (view.SortDescriptions.Count > 0)
+ {
+ SortDescription currentSort = view.SortDescriptions[0];
+ if (currentSort.PropertyName == propertyName)
+ {
+ if (currentSort.Direction == ListSortDirection.Ascending)
+ direction = ListSortDirection.Descending;
+ else
+ direction = ListSortDirection.Ascending;
+ }
+ view.SortDescriptions.Clear();
+ }
+ if (!string.IsNullOrEmpty(propertyName))
+ {
+ view.SortDescriptions.Add(new SortDescription(propertyName, direction));
+ }
+ return direction;
+ }
+
+ }
+}
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/RequestInfoPage.xaml b/PLWPF/Windows/ShowInfoWindows/RequestInfoPage.xaml
new file mode 100644
index 0000000..f6e8825
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/RequestInfoPage.xaml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/RequestInfoPage.xaml.cs b/PLWPF/Windows/ShowInfoWindows/RequestInfoPage.xaml.cs
new file mode 100644
index 0000000..67e5ea1
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/RequestInfoPage.xaml.cs
@@ -0,0 +1,98 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using BL;
+using System.ComponentModel;
+
+namespace PLWPF.Windows.ShowInfoWindows
+{
+ ///
+ /// Interaction logic for RequestInfoPage.xaml
+ ///
+ public partial class RequestInfoPage : Page
+ {
+
+ public RequestInfoPage()
+ {
+ InitializeComponent();
+ GuestRequestListView.ItemsSource = myBL.GuestRequestBy();
+ view = (CollectionView)CollectionViewSource.GetDefaultView(GuestRequestListView.ItemsSource);
+ }
+
+ MyBl myBL = new MyBl();
+ CollectionView view;
+
+ private void GuestRequestListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ }
+
+ //-----------------------------------------------------------------------------------------------
+
+ GridViewColumnHeader _lastHeaderClicked = null;
+
+ private void ListViewColumnHeaderClick(object sender, RoutedEventArgs e)
+ {
+ GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader;
+
+ if (headerClicked == null)
+ return;
+
+ if (headerClicked.Role == GridViewColumnHeaderRole.Padding)
+ return;
+
+ var sortingColumn = (headerClicked.Column.DisplayMemberBinding as Binding)?.Path?.Path;
+ if (sortingColumn == null)
+ return;
+
+ var direction = ApplySort(view, sortingColumn);
+ //var direction = ApplySort(Items, sortingColumn);
+
+
+ if (direction == ListSortDirection.Ascending)
+ {
+
+ headerClicked.Column.HeaderTemplate = Resources["HeaderTemplateArrowUp"] as DataTemplate;
+
+ }
+ else
+ {
+ headerClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateArrowDown"] as DataTemplate;
+ }
+
+ // Remove arrow from previously sorted header
+ if (_lastHeaderClicked != null && _lastHeaderClicked != headerClicked)
+ {
+ _lastHeaderClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateDefault"] as DataTemplate;
+ }
+
+ _lastHeaderClicked = headerClicked;
+ }
+
+ public static ListSortDirection ApplySort(ICollectionView view, string propertyName)
+ {
+ ListSortDirection direction = ListSortDirection.Ascending;
+ if (view.SortDescriptions.Count > 0)
+ {
+ SortDescription currentSort = view.SortDescriptions[0];
+ if (currentSort.PropertyName == propertyName)
+ {
+ if (currentSort.Direction == ListSortDirection.Ascending)
+ direction = ListSortDirection.Descending;
+ else
+ direction = ListSortDirection.Ascending;
+ }
+ view.SortDescriptions.Clear();
+ }
+ if (!string.IsNullOrEmpty(propertyName))
+ {
+ view.SortDescriptions.Add(new SortDescription(propertyName, direction));
+ }
+ return direction;
+ }
+
+ }
+}
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/ShowInfoWindow.xaml b/PLWPF/Windows/ShowInfoWindows/ShowInfoWindow.xaml
new file mode 100644
index 0000000..af9b764
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/ShowInfoWindow.xaml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/ShowInfoWindow.xaml.cs b/PLWPF/Windows/ShowInfoWindows/ShowInfoWindow.xaml.cs
new file mode 100644
index 0000000..08161f5
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/ShowInfoWindow.xaml.cs
@@ -0,0 +1,19 @@
+using System.Windows;
+
+namespace PLWPF.Windows.ShowInfoWindows
+{
+ ///
+ /// Interaction logic for ShowInfoWindow.xaml
+ ///
+ public partial class ShowInfoWindow : Window
+ {
+ public ShowInfoWindow()
+ {
+ InitializeComponent();
+ GuestRequestPage.Content = new RequestInfoPage();
+ HostPage.Content = new HostInfoPage();
+ UnitPage.Content = new UnitInfoPage();
+ OrdersPage.Content = new OrderInfoPage();
+ }
+ }
+}
diff --git a/PLWPF/Windows/ShowInfoWindows/UnitInfoPage.xaml b/PLWPF/Windows/ShowInfoWindows/UnitInfoPage.xaml
new file mode 100644
index 0000000..d027362
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/UnitInfoPage.xaml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/ShowInfoWindows/UnitInfoPage.xaml.cs b/PLWPF/Windows/ShowInfoWindows/UnitInfoPage.xaml.cs
new file mode 100644
index 0000000..e2aea13
--- /dev/null
+++ b/PLWPF/Windows/ShowInfoWindows/UnitInfoPage.xaml.cs
@@ -0,0 +1,98 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using BL;
+using System.ComponentModel;
+
+namespace PLWPF.Windows.ShowInfoWindows
+{
+ ///
+ /// Interaction logic for UnitInfoPage.xaml
+ ///
+ public partial class UnitInfoPage : Page
+ {
+ public UnitInfoPage()
+ {
+
+ InitializeComponent();
+ UnitListView.ItemsSource = myBL.HustingUnitsBy();
+ view = (CollectionView)CollectionViewSource.GetDefaultView(UnitListView.ItemsSource);
+ }
+
+ MyBl myBL = new MyBl();
+ CollectionView view;
+
+ private void UnitListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ }
+
+ //-----------------------------------------------------------------------------------------------
+
+ GridViewColumnHeader _lastHeaderClicked = null;
+
+ private void ListViewColumnHeaderClick(object sender, RoutedEventArgs e)
+ {
+ GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader;
+
+ if (headerClicked == null)
+ return;
+
+ if (headerClicked.Role == GridViewColumnHeaderRole.Padding)
+ return;
+
+ var sortingColumn = (headerClicked.Column.DisplayMemberBinding as Binding)?.Path?.Path;
+ if (sortingColumn == null)
+ return;
+
+ var direction = ApplySort(view, sortingColumn);
+ //var direction = ApplySort(Items, sortingColumn);
+
+
+ if (direction == ListSortDirection.Ascending)
+ {
+
+ headerClicked.Column.HeaderTemplate = Resources["HeaderTemplateArrowUp"] as DataTemplate;
+
+ }
+ else
+ {
+ headerClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateArrowDown"] as DataTemplate;
+ }
+
+ // Remove arrow from previously sorted header
+ if (_lastHeaderClicked != null && _lastHeaderClicked != headerClicked)
+ {
+ _lastHeaderClicked.Column.HeaderTemplate =
+ Resources["HeaderTemplateDefault"] as DataTemplate;
+ }
+
+ _lastHeaderClicked = headerClicked;
+ }
+
+ public static ListSortDirection ApplySort(ICollectionView view, string propertyName)
+ {
+ ListSortDirection direction = ListSortDirection.Ascending;
+ if (view.SortDescriptions.Count > 0)
+ {
+ SortDescription currentSort = view.SortDescriptions[0];
+ if (currentSort.PropertyName == propertyName)
+ {
+ if (currentSort.Direction == ListSortDirection.Ascending)
+ direction = ListSortDirection.Descending;
+ else
+ direction = ListSortDirection.Ascending;
+ }
+ view.SortDescriptions.Clear();
+ }
+ if (!string.IsNullOrEmpty(propertyName))
+ {
+ view.SortDescriptions.Add(new SortDescription(propertyName, direction));
+ }
+ return direction;
+ }
+
+ }
+ }
+
+
diff --git a/PLWPF/Windows/Statistics/GraphBarsUserControl.xaml b/PLWPF/Windows/Statistics/GraphBarsUserControl.xaml
new file mode 100644
index 0000000..4b0d948
--- /dev/null
+++ b/PLWPF/Windows/Statistics/GraphBarsUserControl.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/Statistics/GraphBarsUserControl.xaml.cs b/PLWPF/Windows/Statistics/GraphBarsUserControl.xaml.cs
new file mode 100644
index 0000000..d0d2c3e
--- /dev/null
+++ b/PLWPF/Windows/Statistics/GraphBarsUserControl.xaml.cs
@@ -0,0 +1,27 @@
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PLWPF.Windows.Statistics
+{
+ ///
+ /// Interaction logic for GraphBarsUserControl.xaml
+ ///
+ public partial class GraphBarsUserControl : UserControl
+ {
+ public GraphBarsUserControl(double first, double second, double third=0, double fourth=0, double fifth=0)
+ {
+
+ InitializeComponent();
+ Column0.Width = new GridLength(first);
+ Column1.Width = new GridLength(second);
+ Column2.Width = new GridLength(third);
+ Column3.Width = new GridLength(fourth);
+ Column4.Width = new GridLength(fifth);
+ Labe1.Content = first + "%";
+ Labe2.Content = second + "%";
+ Labe3.Content = third + "%";
+ Labe4.Content = fourth + "%";
+ Labe5.Content = fifth + "%";
+ }
+ }
+}
diff --git a/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml b/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml
index aa5c1ce..561538e 100644
--- a/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml
+++ b/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml
@@ -1,42 +1,13 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml.cs b/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml.cs
index c562ad7..dd91025 100644
--- a/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml.cs
+++ b/PLWPF/Windows/Statistics/GuestRequestQueryPage.xaml.cs
@@ -1,9 +1,10 @@
using BL;
-using System;
using System.Linq;
-using System.Windows;
using System.Windows.Controls;
-using BE;
+using System.ComponentModel;
+using System.Windows.Data;
+using System.Windows;
+
namespace PLWPF.Windows.Statistics
{
///
@@ -12,33 +13,14 @@ namespace PLWPF.Windows.Statistics
public partial class GuestRequestQueryPage : Page
{
MyBl myBL = new MyBl();
-
public GuestRequestQueryPage()
{
InitializeComponent();
- LevelOfDemand_ComboBox.ItemsSource = Enum.GetValues(typeof(BE.Requirements)).Cast();
- PerArea.Content = new ShowPerArea(myBL.GuestRequestPerArea());
- }
-
-
- private void LevelOfDemand_ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
-
- var v = myBL.GuestRequestPerRquirement((Requirements)LevelOfDemand_ComboBox.SelectedItem);
- Pool.Text = v["Pool"].ToString();
- Jacuzzi.Text = v["Jacuzzi"].ToString();
- Garden.Text = v["Garden"].ToString();
- ChildrensAttractions.Text = v["ChildrensAttractions"].ToString();
- SpredBads.Text = v["SpredBads"].ToString();
- AirCondsner.Text = v["AirCondsner"].ToString();
- frisider.Text = v["frisider"].ToString();
- SingogNaerBy.Text = v["SingogNaerBy"].ToString();
- NaerPublicTrensportion.Text = v["NaerPublicTrensportion"].ToString();
-
- }
+ }
+
}
}
-
+
diff --git a/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml b/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml
index cdbbebb..0996e1f 100644
--- a/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml
+++ b/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml
@@ -2,17 +2,18 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:PLWPF.Windows.Statistics"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:statistics="clr-namespace:PLWPF.Windows.Statistics"
mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800"
+ d:DesignHeight="1000" d:DesignWidth="1000"
Title="HostingUnitQueryPage">
-
-
-
-
+
+
+
+
+
diff --git a/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml.cs b/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml.cs
index c2f2709..e39c9c2 100644
--- a/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml.cs
+++ b/PLWPF/Windows/Statistics/HostingUnitQueryPage.xaml.cs
@@ -1,18 +1,6 @@
-using BL;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
+using BE;
+using BL;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace PLWPF.Windows.Statistics
{
@@ -26,8 +14,16 @@ public partial class HostingUnitQueryPage : Page
public HostingUnitQueryPage()
{
InitializeComponent();
- PerArea.Content = new ShowPerArea(myBL.HostingUnitPerArea());
+ PerArea.Content = new ShowPerArea(myBL.HostingUnitPerArea());
+ var v = myBL.HostingUnitPerArea();
+ float sum = v[Area.Jerusalem] + v[Area.Center] + v[Area.North] + v[Area.South];
+ float avr=sum / 100;
+ PerAreaGraphBar.Content=new GraphBarsUserControl(
+ v[Area.Jerusalem] / avr,
+ v[Area.Center] / avr,
+ v[Area.North] / avr,
+ v[Area.South] / avr);
}
//
diff --git a/PLWPF/Windows/Statistics/ShowPerArea.xaml b/PLWPF/Windows/Statistics/ShowPerArea.xaml
index 7c083ff..e610a32 100644
--- a/PLWPF/Windows/Statistics/ShowPerArea.xaml
+++ b/PLWPF/Windows/Statistics/ShowPerArea.xaml
@@ -13,9 +13,8 @@
-
-
-
+
+
diff --git a/PLWPF/Windows/Statistics/StatisticsWindow.xaml b/PLWPF/Windows/Statistics/StatisticsWindow.xaml
index eb06191..926442f 100644
--- a/PLWPF/Windows/Statistics/StatisticsWindow.xaml
+++ b/PLWPF/Windows/Statistics/StatisticsWindow.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PLWPF.Windows"
mc:Ignorable="d"
- Title="StatisticsWindow" Height="450" Width="800">
+ Title="StatisticsWindow" Height="1000" Width="1000">
diff --git a/PLWPF/Windows/Statistics/checker.xaml b/PLWPF/Windows/Statistics/checker.xaml
new file mode 100644
index 0000000..f1b2c80
--- /dev/null
+++ b/PLWPF/Windows/Statistics/checker.xaml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PLWPF/Windows/Statistics/checker.xaml.cs b/PLWPF/Windows/Statistics/checker.xaml.cs
new file mode 100644
index 0000000..4f2db93
--- /dev/null
+++ b/PLWPF/Windows/Statistics/checker.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PLWPF.Windows.Statistics
+{
+ ///
+ /// Interaction logic for checker.xaml
+ ///
+ public partial class checker : UserControl
+ {
+ public checker()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/PLWPF/Windows/UpdateOrderWindow.xaml b/PLWPF/Windows/UpdateOrderWindow.xaml
index 69168ac..b2d88c1 100644
--- a/PLWPF/Windows/UpdateOrderWindow.xaml
+++ b/PLWPF/Windows/UpdateOrderWindow.xaml
@@ -5,11 +5,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PLWPF"
mc:Ignorable="d"
+ Loaded="Window_Loaded"
Title="UpdateOrderWindow" Height="450" Width="468.907">
-
+
diff --git a/PLWPF/Windows/UpdateOrderWindow.xaml.cs b/PLWPF/Windows/UpdateOrderWindow.xaml.cs
index c9bf5cd..f841fa9 100644
--- a/PLWPF/Windows/UpdateOrderWindow.xaml.cs
+++ b/PLWPF/Windows/UpdateOrderWindow.xaml.cs
@@ -3,16 +3,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
namespace PLWPF
{
@@ -33,11 +25,7 @@ public UpdateOrderWindow(Host host)
{
this.host = host;
InitializeComponent();
- comboBox.ItemsSource = myBL.GetOrders(x => myBL.GetHostingUnit(x.HostingUnitKey).Owner.HostKey == host.HostKey);
- comboBox.DisplayMemberPath = "OrderKey";
-
- StatusComboBox.ItemsSource = Enum.GetValues(typeof(BE.OrderStatus)).Cast();
- HostingUnitKeyComboBox.ItemsSource = myBL.GetHostingUnitsKeysList(host.HostKey);
+
}
///
@@ -49,9 +37,15 @@ private void Continue_Click(object sender, RoutedEventArgs e)
{
order.Status = (OrderStatus)StatusComboBox.SelectedItem;
myBL.UpdateOrder(order);
+
this.Close();
}
-
+
+ ///
+ /// OrderKey_TextChanged event find order by order key
+ ///
+ ///
+ ///
private void OrderKey_TextChanged(object sender, TextChangedEventArgs e)
{
order = myBL.GetOrders(x => x.OrderKey == Int32.Parse(OrderKey.Text)).FirstOrDefault();
@@ -71,6 +65,8 @@ private void OrderKey_TextChanged(object sender, TextChangedEventArgs e)
Continue.Visibility = Visibility.Hidden;
}
}
+
+ /*
private void GuestRequestKey_TextChanged(object sender, TextChangedEventArgs e)
{
//order = myBL.GetOrders(x => x.GuestRequestKey == Int32.Parse(GuestRequestKey.Text)).FirstOrDefault();
@@ -90,7 +86,7 @@ private void GuestRequestKey_TextChanged(object sender, TextChangedEventArgs e)
// // Continue.Visibility = Visibility.Hidden;
//}
}
-
+ */
///
/// Status changed
@@ -99,31 +95,38 @@ private void GuestRequestKey_TextChanged(object sender, TextChangedEventArgs e)
///
private void ComboBox_StatusChanged(object sender, SelectionChangedEventArgs e)
{
- try {
+ try
+ {
Enum.TryParse(StatusComboBox.SelectedItem.ToString(), out OrderStatus OrderStatus);
order.Status = OrderStatus;
}
catch
{
- MessageBox.Show("No Order faund!");
- StatusComboBox.Text = null;
- }
- }
-
- private void ComboBox_HostingUnitChanged(object sender, SelectionChangedEventArgs e)
- {
- try
- {
- // StatusComboBox.SelectedItem.ToString();
-
- }
- catch
- {
MessageBox.Show("No Order faund!");
StatusComboBox.Text = null;
}
}
+ /*
+ private void ComboBox_HostingUnitChanged(object sender, SelectionChangedEventArgs e)
+ {
+ try
+ {
+ // StatusComboBox.SelectedItem.ToString();
+
+ }
+ catch
+ {
+ MessageBox.Show("No Order faund!");
+ StatusComboBox.Text = null;
+ }
+ }
+ */
+ ///
+ /// comboBox_SelectionChanged event find order by order key
+ ///
+ ///
+ ///
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
order = myBL.GetOrders(x => x.OrderKey == (comboBox.SelectedItem as Order).OrderKey).FirstOrDefault();
@@ -144,6 +147,33 @@ private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs
// Continue.Visibility = Visibility.Hidden;
}
}
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ var source = myBL.GetOrders(x => myBL.GetHostingUnit(x.HostingUnitKey).Owner.HostKey == host.HostKey);
+ if (source.Any())
+ {
+ comboBox.ItemsSource = source;
+ comboBox.DisplayMemberPath = "OrderKey";
+
+ StatusComboBox.ItemsSource = Enum.GetValues(typeof(BE.OrderStatus)).Cast();
+ HostingUnitKeyComboBox.ItemsSource = myBL.GetHostingUnitsKeysList(host.HostKey);
+ }
+ else
+ {
+ MessageBox.Show("No orders to show");
+ this.Close();
+ }
+ }
+ catch (Exception ex)
+ {
+
+ MessageBox.Show("Server Problem, try again Later!");
+ Console.WriteLine(ex.Message);
+ this.Close();
+ }
+ }
}
}
-//maybe singlton is needed for thos to func not intersect "OrderKey_TextChanged" &"GuestRequestKey_TextChanged"
\ No newline at end of file
diff --git a/PLWPF/preCode.cs b/PLWPF/preCode.cs
deleted file mode 100644
index 340aa28..0000000
--- a/PLWPF/preCode.cs
+++ /dev/null
@@ -1,318 +0,0 @@
-using BE;
-using BL;
-using System;
-using System.Collections.Generic;
-
-namespace PLWPF
-{
-
- public class preCode
- {
- BL.MyBl mybl = new MyBl();
- public void initialize()
- {
-
- #region add_hosts_and_HusingUnit
-
- Host host = new Host();
- host.HostKey = 11111111;
- host.PrivateName = "david";
- host.FamilyName = "cohn";
- host.PhoneNumber = "054-5555555";
- host.MailAddress = "sale@gmai.com";
-
- #region david_BankAccount
-
- host.BankAccount = new BankAccount();
- host.BankAccount.BankAccountNumber = 11111111;
- host.BankAccount.BankName = "poalim";
- host.BankAccount.BankNumber = 123;
- host.BankAccount.BranchAddress = "jefo 121";
- host.BankAccount.BranchCity = "jeruselm";
- host.BankAccount.BranchNumber = 432;
-
- #endregion david_BankAccount
-
- host.CollectionClearance = "";
- mybl.AddHost(host);
-
- #region add_hosting_units_to_david
-
- HostingUnit hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel clifornia";
- hu.Area = BE.Area.North;
- hu.Diary = new List{
- new DateTime(2020, 1, 20)
- };
- mybl.AddHostingUnit(hu);
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel hong-kong";
- hu.Area = BE.Area.North;
- mybl.AddHostingUnit(hu);
-
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel paris";
- hu.Area = BE.Area.North;
- mybl.AddHostingUnit(hu);
-
- #endregion add_hosting_units_to_david
-
-
- host = new Host();
- host.HostKey = 22222222;
- host.PrivateName = "moses";
- host.FamilyName = "levi";
- host.PhoneNumber = "054-6666666";
- host.MailAddress = "hotel@gmai.com";
- #region levi_BankAccount
- host.BankAccount = new BankAccount();
- host.BankAccount.BankAccountNumber = 11111112;
- host.BankAccount.BankName = "poalim";
- host.BankAccount.BankNumber = 123;
- host.BankAccount.BranchAddress = "jefo 121";
- host.BankAccount.BranchCity = "jeruselm";
- host.BankAccount.BranchNumber = 432;
- #endregion levi_BankAccount
- host.CollectionClearance = "";
- mybl.AddHost(host);
- #region add_hosting_units_to_moses
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel tal-aviv";
- hu.Area = BE.Area.Center;
- mybl.AddHostingUnit(hu);
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel jeruselm";
- hu.Area = BE.Area.Jerusalem;
- mybl.AddHostingUnit(hu);
-
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel tavriea";
- hu.Area = BE.Area.North;
- mybl.AddHostingUnit(hu);
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "hotel hifa";
- hu.Area = BE.Area.North;
- mybl.AddHostingUnit(hu);
-
- #endregion add_hosting_units_to_moses
-
- host = new Host();
- host.HostKey = 33333333;
- host.PrivateName = "dan";
- host.FamilyName = "danon";
- host.PhoneNumber = "054-1010101";
- host.MailAddress = "zimer@gmai.com";
-
- #region dan_BankAccount
-
- host.BankAccount = new BankAccount();
- host.BankAccount.BankAccountNumber = 1152582;
- host.BankAccount.BankName = "laomi";
- host.BankAccount.BankNumber = 525;
- host.BankAccount.BranchAddress = "gargmel 1010";
- host.BankAccount.BranchCity = "heifa";
- host.BankAccount.BranchNumber = 852;
-
- #endregion dan_BankAccount
-
- host.CollectionClearance = "";
- mybl.AddHost(host);
- #region add_hosting_units_to_dan
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "zimer of the Jerusalem";
- hu.Area = BE.Area.Jerusalem;
- mybl.AddHostingUnit(hu);
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "zimer of the South";
- hu.Area = BE.Area.South;
- mybl.AddHostingUnit(hu);
-
-
- #endregion add_hosting_units_to_dan
-
- host = new Host();
- host.HostKey = 44444444;
- host.PrivateName = "isaya";
- host.FamilyName = "pewzner";
- host.PhoneNumber = "054-1010101";
- host.MailAddress = "ipewzner@g.jct.ac.il";
-
- host.BankAccount = new BankAccount();
- host.BankAccount.BankAccountNumber = 1152582;
- host.BankAccount.BankName = "laomi";
- host.BankAccount.BankNumber = 525;
- host.BankAccount.BranchAddress = "gargmel 1010";
- host.BankAccount.BranchCity = "heifa";
- host.BankAccount.BranchNumber = 852;
-
- host.CollectionClearance = "";
- mybl.AddHost(host);
-
-
- hu = new HostingUnit();
- hu.Owner = host;
- hu.HostingUnitName = "zimer of the north";
- hu.Area = BE.Area.North;
- mybl.AddHostingUnit(hu);
-
- #endregion add_hosts_and_HusingUnit
-
-
- #region guestRequests
-
- #region parz_request
- GuestRequest gr = new GuestRequest();
- gr.PrivateName = "Meni";
- gr.FamilyName = "Meni";
- gr.MailAddress = "Meni3a@gmail.com";
- gr.Status = BE.ClientStatus.Open;
- gr.RegistrationDate = new DateTime(1 / 1 / 2020);
- gr.EntryDate = new DateTime(25 / 4 / 2020);
- gr.ReleaseDate = new DateTime(1 / 5 / 2020);
- gr.Area = Area.Jerusalem;
- gr.SubArea = "old city";
- gr.HostingType = HostingType.Hotel;
- gr.Adults = 2;
- gr.Children = 1;
- gr.Pool = Requirements.Necessary;
- gr.Jacuzzi = Requirements.NotNecessary;
- gr.Garden = Requirements.NotNecessary;
- gr.ChildrensAttractions = Requirements.Necessary;
- gr.SpredBads = Requirements.NotNecessary;
- gr.AirCondsner = Requirements.Necessary;
- gr.frisider = Requirements.Possible;
- gr.SingogNaerBy = Requirements.Necessary;
- gr.NaerPublicTrensportion = Requirements.Possible;
- mybl.AddGuestRequest(gr);
- #endregion parz_request
-
- #region Pewzner
- gr = new GuestRequest();
- gr.PrivateName = "Iasayau";
- gr.FamilyName = "Pewzner";
- gr.MailAddress = "ipewzner@gmail.com";
- gr.Status = BE.ClientStatus.Open;
- gr.RegistrationDate = new DateTime(1 / 1 / 2020);
- gr.EntryDate = new DateTime(25 / 4 / 2020);
- gr.ReleaseDate = new DateTime(1 / 5 / 2020);
- gr.Area = Area.Jerusalem;
- gr.SubArea = "old city";
- gr.HostingType = HostingType.Hotel;
- gr.Adults = 2;
- gr.Children = 1;
- gr.Pool = Requirements.Necessary;
- gr.Jacuzzi = Requirements.NotNecessary;
- gr.Garden = Requirements.NotNecessary;
- gr.ChildrensAttractions = Requirements.Necessary;
- gr.SpredBads = Requirements.NotNecessary;
- gr.AirCondsner = Requirements.Necessary;
- gr.frisider = Requirements.Possible;
- gr.SingogNaerBy = Requirements.Necessary;
- gr.NaerPublicTrensportion = Requirements.Possible;
- mybl.AddGuestRequest(gr);
- #endregion Pewzner
-
- #region kalmen_request
-
- gr = new GuestRequest();
- gr.PrivateName = "kalmen";
- gr.FamilyName = "kalmenovitz";
- gr.MailAddress = "kalmenovitz@gmail.com";
- gr.Status = BE.ClientStatus.Open;
- gr.RegistrationDate = new DateTime(1 / 3 / 2020);
- gr.EntryDate = new DateTime(5 / 2 / 2020);
- gr.ReleaseDate = new DateTime(15 / 2 / 2020);
- gr.Area = Area.North;
- gr.SubArea = "tabrios";
- gr.HostingType = HostingType.Zimmer;
- gr.Adults = 4;
- gr.Children = 0;
- gr.Pool = Requirements.Necessary;
- gr.Jacuzzi = Requirements.Necessary;
- gr.Garden = Requirements.Necessary;
- gr.ChildrensAttractions = Requirements.NotNecessary;
- gr.SpredBads = Requirements.Necessary;
- gr.AirCondsner = Requirements.Necessary;
- gr.frisider = Requirements.Necessary;
- gr.SingogNaerBy = Requirements.Possible;
- gr.NaerPublicTrensportion = Requirements.Possible;
- mybl.AddGuestRequest(gr);
- #endregion kalmen_request
-
-
-
- #region afreim_request
-
- gr = new GuestRequest();
- gr.PrivateName = "afreim";
- gr.FamilyName = "cohn";
- gr.MailAddress = "cohn@gmail.com";
- gr.Status = BE.ClientStatus.Open;
- gr.RegistrationDate = new DateTime(31 / 11 / 2019);
- gr.EntryDate = new DateTime(29 / 12 / 2019);
- gr.ReleaseDate = new DateTime(3 / 1 / 2020);
- gr.Area = Area.Center;
- gr.SubArea = "tal aviv";
- gr.HostingType = HostingType.RentingRoom;
- gr.Adults = 2;
- gr.Children = 2;
- gr.Pool = Requirements.NotNecessary;
- gr.Jacuzzi = Requirements.NotNecessary;
- gr.Garden = Requirements.NotNecessary;
- gr.ChildrensAttractions = Requirements.Necessary;
- gr.SpredBads = Requirements.NotNecessary;
- gr.AirCondsner = Requirements.Necessary;
- gr.frisider = Requirements.Necessary;
- gr.SingogNaerBy = Requirements.Necessary;
- gr.NaerPublicTrensportion = Requirements.Necessary;
- mybl.AddGuestRequest(gr);
- #endregion afreim_request
-
- #region golomb_request
-
- gr = new GuestRequest();
- gr.PrivateName = "aser";
- gr.FamilyName = "golomb";
- gr.MailAddress = "golomb@gmail.com";
- gr.Status = BE.ClientStatus.Open;
- gr.RegistrationDate = new DateTime(3 / 3/ 2020);
- gr.EntryDate = new DateTime(25 / 9 / 2020);
- gr.ReleaseDate = new DateTime(5 / 10 / 2020);
- gr.Area = Area.Jerusalem;
- gr.SubArea = "old city";
- gr.HostingType = HostingType.Hotel;
- gr.Adults = 2;
- gr.Children = 5;
- gr.Pool = Requirements.Possible;
- gr.Jacuzzi = Requirements.Possible;
- gr.Garden = Requirements.NotNecessary;
- gr.ChildrensAttractions = Requirements.Necessary;
- gr.SpredBads = Requirements.NotNecessary;
- gr.AirCondsner = Requirements.Necessary;
- gr.frisider = Requirements.Possible;
- gr.SingogNaerBy = Requirements.Necessary;
- gr.NaerPublicTrensportion = Requirements.Possible;
- mybl.AddGuestRequest(gr);
- #endregion golomb_request
-
- #endregion guestRequests
- }
- }
-}
\ No newline at end of file
diff --git a/util/Tools.cs b/util/Tools.cs
index 922588a..bfb3ee8 100644
--- a/util/Tools.cs
+++ b/util/Tools.cs
@@ -19,9 +19,7 @@ public static String TostringProperties(this T t)
}
return result;
}
-
-
-
+
//https://stackoverflow.com/questions/553824/serializing-an-array-of-integers-using-xmlserializer