Exemplo n.º 1
0
 public void AddOrder(Order myOrder)
 {
     try
     {
         GuestRequest myGuestRequest = dal.GetGuestRequestByKey(myOrder.GuestRequestKey);
         HostingUnit  myHostingUnit  = dal.GetHostingUnitByKey(myOrder.HostingUnitKey);
         dal.AddOrder(myOrder);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        public string AddOrder(int GuestRequestKey, int HostingUnitKey) // add order
        {
            BE.Order newOrd = new BE.Order();
            newOrd.HostingUnitKey = HostingUnitKey;
            var GRkeyList = from GR in dal.GetGuestRequestsList() where GR.GuestRequestKey == GuestRequestKey select GR.GuestRequestKey;

            if (GRkeyList.Count() == 0)
            {
                throw new ArgumentException("ERROR: this Guest Request Key doesn't exist");
            }
            newOrd.GuestRequestKey = GuestRequestKey;
            newOrd.OrderKey        = 0;
            newOrd.Status          = BE.ORDERSTATUS.NotYetTreated;
            newOrd.CreateDate      = DateTime.Now;
            dal.AddOrder(newOrd);
            return(" Add Order accomplish with success - Send mail to the client");
        }