コード例 #1
0
        public ActionResult PurchaseForm(Order ord)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    //these part of code is for creating the url which redirect to paypal (connect us to paypal)
                    string url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
                    string cmd = "?cmd=";
                    string value = "_products";
                    string business = "&[email protected]";
                    string itm = "&item_name=Buy this product";
                    string currency = "&currency_code=CAD";
                    string amt = "&amount=";

                    string path = url + cmd + value + business + itm + currency + amt;

                    // Inserting the order information into db
                    objOrd.commitInsert(ord);
                    //After inserting, redirect to the paypal
                    return Redirect(path);
                }
                catch
                {
                    //Error handling, return to Error view if something goes wrong
                    return View("Error");
                }
            }
            return View();
        }
コード例 #2
0
 public bool commitInsert(Order ord)
 {
     using (objOrd)
     {
         objOrd.Orders.InsertOnSubmit(ord);
         //commit insert with db
         objOrd.SubmitChanges();
         return true;
     }
 }
コード例 #3
0
 partial void DeleteOrder(Order instance);
コード例 #4
0
 partial void UpdateOrder(Order instance);
コード例 #5
0
 partial void InsertOrder(Order instance);
コード例 #6
0
		private void detach_Orders(Order entity)
		{
			this.SendPropertyChanging();
			entity.Product = null;
		}
コード例 #7
0
		private void attach_Orders(Order entity)
		{
			this.SendPropertyChanging();
			entity.Product = this;
		}