예제 #1
0
        private void CustomerOrderSearchForm_Load(object sender, EventArgs e)
        {
            _orderId = "";
            _customerOrderDataSet = OrderGateway.ListCustomerOrders();

            RefreshCustomerOrderList();
        }
예제 #2
0
        private void ChooseOrdersForm_Load(object sender, EventArgs e)
        {
            _orderId      = "";
            _orderDataSet = OrderGateway.list();

            RefreshOrderList();
        }
예제 #3
0
 public void Save()
 {
     if (_isNewOrder)
     {
         _orderId    = OrderGateway.Create(_customerId, _buildingType, _framePrice, _planningRejected, _planningGranted, _contractSigned, _estimatedFab, _assemblyDate, _foundationReady, _planningInvoice, _orderInvoice, _delayInvoice);
         _isNewOrder = false;
     }
     else
     {
         OrderGateway.Save(this);
     }
 }
예제 #4
0
파일: Order.cs 프로젝트: gls81/CM0721
        public void Save()
        {
            // Ensure all datatable values have been set.
            // These were stored in local variables for performance, now we're going to save
            // they need to be inserted into the table.

            _ds.Tables[0].Rows[0]["CustomerId"]   = _customerId;
            _ds.Tables[0].Rows[0]["BuildingType"] = _buildingType;
            _ds.Tables[0].Rows[0]["FramePrice"]   = _framePrice;
            _ds.Tables[0].Rows[0]["Status"]       = _status;


            if (_isNewOrder)
            {
                _ds.Tables[0].Rows[0]["Created"] = DateTime.Now;
            }

            OrderGateway.Save(_ds);

            _isNewOrder = false; // No longer a new order!
        }
예제 #5
0
파일: Order.cs 프로젝트: gls81/CM0721
        private void Initialise()
        {
            // Use order Gateway for all SQL I/O

            _ds = OrderGateway.Find(_orderId);

            if (_ds.Tables[0].Rows.Count > 0)
            {
                _isNewOrder = false;

                _customerId   = _ds.Tables[0].Rows[0]["CustomerId"].ToString();
                _buildingType = _ds.Tables[0].Rows[0]["BuildingType"].ToString();
                _framePrice   = (Decimal)_ds.Tables[0].Rows[0]["FramePrice"];
                _status       = (OrderStatus)Int32.Parse(_ds.Tables[0].Rows[0]["Status"].ToString());
            }
            else
            {
                _isNewOrder = true;
                _ds.Tables[0].Rows.Add(_ds.Tables[0].NewRow());
                _ds.Tables[0].Rows[0]["Created"] = DateTime.Now;
                _ds.Tables[0].Rows[0]["Status"]  = OrderStatus.Unsubmitted;
            }
        }
예제 #6
0
        private void Initialise()
        {
            DataSet ds = OrderGateway.Find(_orderId);

            if (ds.Tables[0].Rows.Count > 0)
            {
                _customerId   = ds.Tables[0].Rows[0]["CustomerId"].ToString();
                _buildingType = ds.Tables[0].Rows[0]["BuildingType"].ToString();
                _framePrice   = (Decimal)ds.Tables[0].Rows[0]["FramePrice"];
                _created      = (DateTime)ds.Tables[0].Rows[0]["Created"];
                _status       = (OrderStatus)Enum.Parse(typeof(OrderStatus), ds.Tables[0].Rows[0]["Status"].ToString());

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["PlanningRejection"].ToString()))
                {
                    _planningRejected = null;
                }
                else
                {
                    _planningRejected = (Nullable <DateTime>)ds.Tables[0].Rows[0]["PlanningRejection"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["PlanningGranted"].ToString()))
                {
                    _planningGranted = null;
                }
                else
                {
                    _planningGranted = (Nullable <DateTime>)ds.Tables[0].Rows[0]["PlanningGranted"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ContractSigned"].ToString()))
                {
                    _contractSigned = null;
                }
                else
                {
                    _contractSigned = (Nullable <DateTime>)ds.Tables[0].Rows[0]["ContractSigned"];
                }
                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["EstimateFabDate"].ToString()))
                {
                    _estimatedFab = null;
                }
                else
                {
                    _estimatedFab = (DateTime)ds.Tables[0].Rows[0]["EstimateFabDate"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["AssemblyDate"].ToString()))
                {
                    _assemblyDate = null;
                }
                else
                {
                    _assemblyDate = (Nullable <DateTime>)ds.Tables[0].Rows[0]["AssemblyDate"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["FoundationDate"].ToString()))
                {
                    _foundationReady = null;
                }
                else
                {
                    _foundationReady = (Nullable <DateTime>)ds.Tables[0].Rows[0]["FoundationDate"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["PlanningInvoice"].ToString()))
                {
                    _planningInvoice = null;
                }
                else
                {
                    _planningInvoice = (Nullable <DateTime>)ds.Tables[0].Rows[0]["PlanningInvoice"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["OrderInvoice"].ToString()))
                {
                    _orderInvoice = null;
                }
                else
                {
                    _orderInvoice = (Nullable <DateTime>)ds.Tables[0].Rows[0]["OrderInvoice"];
                }

                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["DelayInvoice"].ToString()))
                {
                    _delayInvoice = null;
                }
                else
                {
                    _delayInvoice = (Nullable <DateTime>)ds.Tables[0].Rows[0]["DelayInvoice"];
                }
            }
        }
예제 #7
0
 public void populateLastOrder()
 {
     _screen.LastOrderId = OrderGateway.getLastOrderInProduction();
 }