Example #1
0
        public bool CreateOrder(int customerId, string orderName, string deadline, string description)
        {
            string date = DateTime.Now.ToShortDateString();
            int    id   = databaseRepo.CreateOrder(customerId, orderName, date, deadline, description);

            if (id == 0)
            {
                return(false);
            }

            string customerName = CustomerRepo.Instance.GetCustomerName(customerId);
            Order  order        = new Order(id, customerId, customerName, Status.Received, orderName, date, deadline, description);

            orders.Add(order);
            return(true);
        }