예제 #1
0
        public override ADL_Order MapOrdertoDLOrder(Order order)
        {
            var result = new DL_Order();

            result.CustomerId          = order.CustomerId;
            result.DateOrderPlaced     = order.DateOrderPlaced;
            result.DateOrderDispatched = order.DateOrderDispatched;
            result.SourceId            = order.SourceId;
            result.Cancelled           = order.Cancelled;

            return(result);
        }
예제 #2
0
        public string CreateOrder(List <ProductModel> products)
        {
            try
            {
                DL_Order dlOrder = new DL_Order();

                string id = Guid.NewGuid().ToString();

                foreach (var product in products)
                {
                    dlOrder.AddOrder(product, id);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return("false");
            }

            return("true");
        }
예제 #3
0
파일: Order.aspx.cs 프로젝트: xiabui/OTO-LC
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DL_Order   dlOrder    = new DL_Order();
            OrderModel orderModel = new OrderModel();

            orderModel.FirstName    = txtFirstName.Text;
            orderModel.LastName     = txtLastName.Text;
            orderModel.CredentialID = txtCredentialID.Text;
            orderModel.DateValid    = DateTime.Parse(dateValid.Text);
            orderModel.DateOfBirth  = DateTime.Parse(txtDateOfBirth.Text);
            orderModel.Province     = txtProvince.Text;
            orderModel.City         = txtCity.Text;
            orderModel.Ward         = txtWard.Text;
            orderModel.Address      = txtAddress.Text;
            orderModel.StoreID      = int.Parse(ddlStore.SelectedValue);
            orderModel.StoreID2     = int.Parse(ddlSubStore.SelectedValue);
            orderModel.ProductID    = int.Parse(Request.QueryString["id"]);

            dlOrder.InsertData(orderModel);
            Response.Redirect("ThankYou.aspx");
        }