public bool Del(Order o) { OrderInterface ti = so.CreateOrder(); ti.Del(o); return(so.SaveChange()); }
public OrderService(IssueInterface issuerepo, OrderInterface orderrepo, SupplierInterface supplierRepo, SupplierQuoteInterface supplierQuoteRepo, SupplierPaymentInterface suppPay) { this.issueRepo = issuerepo; this.orderRepo = orderrepo; this.supplierRepo = supplierRepo; this.supplierQuoteRepo = supplierQuoteRepo; this.supplierPaymentRepo = suppPay; }
public MainWindow() { InitializeComponent(); OrderInterface.Navigate(new MenuCategorySelection()); Order order = new Order(); DataContext = order; OrderControl.NavigationService = OrderInterface.NavigationService; }
public OrdersController(OrderInterface orderRepo, IOrderService orderService) { this.orderService = orderService; this.orderRepo = orderRepo; newOrders = new List <OrderDTO>(); foreach (Order i in orderRepo.GetAll()) { OrderDTO newOrder = new OrderDTO(i); newOrders.Add(newOrder); } totalRecords = newOrders.Count(); }
// GET: Order public ActionResult Index() { if (Session["user"] != null) { int id = ((Session["user"] as customer).customer_id); List <order> order = db.orders.Where(x => x.customer_id == id).OrderBy(x => x.order_date).ToList(); List <order_items> item = db.order_items.ToList(); var model = new OrderInterface { order = order, item = item, }; return(View(model)); } return(RedirectToAction("Login", "Account")); }
public bool InsertOrder(OrderInterface order, List <OrderItems> Items) { using (objMyLq = new alamaatDBDataContext()) { try { alamaat_Order neworder = new alamaat_Order(); neworder.id = Guid.NewGuid(); DateTime date = DateTime.Now; //neworder.order_number = "A" + date.ToShortDateString() + date.ToShortTimeString(); neworder.order_number = order.OrderNumber; neworder.subtotal = order.SubTotal; neworder.discount = order.Discount; neworder.tax = order.Tax; neworder.total = order.Total; neworder.orderstatus = "Pending"; neworder.created = DateTime.Now; neworder.lastmodified = DateTime.Now; neworder.shipment = order.Shipment; neworder.shippingtotal = order.Total; neworder.lastedit = order.Lastedit; neworder.shipfirstname = order.Shipfirstname; neworder.shiplastname = order.Shiplastname; neworder.shipmiddlename = order.Shipmiddlename; neworder.shipcompanyname = order.Shipcompany; neworder.shipaddress = order.ShipAddress; neworder.shippostalcode = order.ShipPostalcode; neworder.shipcity = order.ShipCity; neworder.shipcountry = order.ShipCountry; neworder.shipphone = order.ShipPhone; neworder.shipmobilephone = order.ShipMobilephone; neworder.shipfax = order.Shipfax; neworder.billfirstname = order.Billfirstname; neworder.billlastname = order.Billlastname; neworder.billmiddlename = order.Billmiddlename; neworder.billemail = order.Billemail; neworder.billcompanyname = order.Billcompany; neworder.billaddress = order.BillAddress; neworder.billpostalcode = order.BillPostalcode; neworder.billcity = order.BillCity; neworder.billcountry = order.BillCountry; neworder.billphone = order.BillPhone; neworder.billmobilephone = order.BillMobilephone; neworder.billfax = order.Billfax; objMyLq.alamaat_Orders.InsertOnSubmit(neworder); foreach (var item in Items) { Order_product ordItem = new Order_product(); ordItem.id = item.ID; ordItem.order_id = neworder.id; ordItem.name = item.Name; ordItem.status = "Pending"; ordItem.price = item.Price; ordItem.quantity = item.Quantity; ordItem.discount = item.Discount; ordItem.total = item.Total; ordItem.product_id = item.Productid; objMyLq.Order_products.InsertOnSubmit(ordItem); } objMyLq.SubmitChanges(); return(true); } catch (Exception e) { return(false); } } }
protected void ConfirmPurchase(object sender, EventArgs e) { //string ftotal = Session["FTotal"].ToString(); //lbloutput.Text = "Shopping done thanks Total " + ftotal.ToString(); // OrderInterface order = new OrderInterface(); var user = (alamaat_User)Session["alamaat_User"]; BillInterface bill = (BillInterface)Session["Billing"]; if (user == null) { //lbloutput.Text = "* User login or billing address required."; //e.Cancel = true; if (bill == null) { lbloutput.Text = "* User login or billing address required."; //e.Cancel = true; return; } //return; } if (bill == null) { lbloutput.Text = "* User login or billing address required."; //e.Cancel = true; return; } ShipInterface ship = (ShipInterface)Session["Shipping"]; // if (ship == null) // { // lbloutput.Text = "* User login or billing address required."; //e.Cancel = true; // return; // } decimal subtotal = (decimal)Session["subtotal"]; int shipping = (int)Session["shipTotal"]; decimal total = (decimal)Session["total"]; string shipType = (string)Session["shipType"]; Orders ordercontent = new Orders(); OrderInterface neworder = new OrderInterface(); neworder.SubTotal = Convert.ToDecimal(subtotal); neworder.Total = Convert.ToDecimal(total); DateTime datetime = DateTime.Now; neworder.OrderNumber = "A" + datetime.Year.ToString() + datetime.Month.ToString() + datetime.Day.ToString() + datetime.Hour.ToString() + datetime.Minute.ToString() + datetime.Second.ToString(); neworder.Shipment = shipType; neworder.Shippingtotal = Convert.ToDecimal(shipping); neworder.Billcompany = bill.Billcompany; neworder.Billfirstname = bill.Billfirstname; neworder.Billlastname = bill.Billlastname; neworder.Billmiddlename = bill.Billmiddlename; neworder.Billemail = bill.Billemail; neworder.BillCountry = bill.BillCountry; neworder.BillAddress = bill.BillAddress; neworder.BillCity = bill.BillCity; neworder.BillPostalcode = bill.BillPostalcode; neworder.BillProvince = bill.BillProvince; neworder.BillPhone = bill.BillPhone; neworder.BillMobilephone = bill.BillMobilephone; neworder.Billfax = bill.Billfax; neworder.Shipcompany = ship.Shipcompany; neworder.Shipfirstname = ship.Shipfirstname; neworder.Shiplastname = ship.Shiplastname; neworder.Shipmiddlename = ship.Shiplastname; neworder.ShipAddress = ship.ShipAddress; neworder.ShipCity = ship.ShipCity; neworder.ShipPostalcode = ship.ShipPostalcode; neworder.ShipProvince = ship.ShipProvince; neworder.ShipCountry = ship.ShipCountry; neworder.ShipPhone = ship.ShipPhone; neworder.ShipMobilephone = ship.ShipMobilephone; neworder.Shipfax = ship.Shipfax; List <OrderItems> orderitemList = new List <OrderItems>(); foreach (var item in ShoppingCart.Instance.Items) { OrderItems newitem = new OrderItems(); newitem.ID = Guid.NewGuid(); newitem.Name = item.Description; newitem.Status = "Pending"; newitem.Price = item.UnitPrice; newitem.Quantity = item.Quantity; newitem.Discount = 0; newitem.Total = item.TotalPrice; newitem.Productid = item.ProductId; orderitemList.Add(newitem); } if (ordercontent.InsertOrder(neworder, orderitemList)) { lblorderemail.Text = "Info: Message sent to " + neworder.Billfirstname + " " + neworder.Billlastname + " " + neworder.Billemail; lblordershiptype.Text = neworder.Shipment; lblordernumber.Text = neworder.OrderNumber; lblorderamount.Text = neworder.Total.ToString(); //Session["Billing"] = null; // Session["Shippig"] = null; Session["shipTotal"] = null; Session["shipType"] = null; foreach (var item in orderitemList) { ShoppingCart.Instance.RemoveItem(item.Productid); } gvShoppingCart.DataSource = null; gvShoppingCart.DataBind(); gvShoppingCart2.DataSource = null; gvShoppingCart2.DataBind(); clear(); // ShoppingCart.Instance.Items = null; ShippingWizard.Visible = false; ConfOrder.Visible = true; string Items = string.Empty; foreach (var item in orderitemList) { Items += "<tr><td>" + item.Name + "</td><td>" + item.Quantity + "</td><td>" + item.Price + "</td><td>" + item.Total + "</td></tr>"; } string emailcontent = "<div style='background:#e6e6e6;padding-top:10px;padding-left:10px;padding-bottom:10px'>Hello " + neworder.Billfirstname + " " + neworder.Billlastname + ",<br/><br/>" + "<b>Order Number:</b> " + neworder.OrderNumber + "<br/>" + "<b>Order Total: Rs.</b> " + neworder.Total + "<br/>" + "<b>Order Status:</b> Pending<br/><br/>" + "<table><tr><td style='Width:300px;text-align:center'><b>Bill To</b></td><td style='Width:300px;text-align:center'><b>Ship To</b></td></tr>" + "<tr><td>" + neworder.Billemail + "<br/>" + neworder.Billfirstname + " " + neworder.Billlastname + "<br/>" + neworder.BillAddress + "<br/>" + neworder.BillCity + ", " + neworder.BillProvince + "<br/>" + neworder.BillCountry + "<br/>" + neworder.BillPostalcode + "<br/>" + neworder.BillPhone + "</td>" + "<td>" + neworder.Shipfirstname + " " + neworder.Shiplastname + "<br/>" + neworder.ShipAddress + "<br/>" + neworder.ShipCity + ", " + neworder.ShipProvince + "<br/>" + neworder.ShipCountry + "<br/>" + neworder.ShipPostalcode + "<br/>" + neworder.ShipPhone + "</td></tr></table><br/>" + "<table><tr style='width:100%'><td style='width:250px'><b>Product Name<b/></td><td style='width:150px'><b>Quantity</b></td>" + "<td style='width:150px'><b>Unit Price</b></td><td ><b>Total</b></td></tr>" + "<tr><td colspan='4'> </td></tr>" + Items + "<tr><td colspan='4'> </td></tr>" + "<tr><td style='width:250px'></td><td style='width:150px'></td><td style='width:150px'><b>Sub Total:</b> <td><td>" + neworder.SubTotal + "</td></tr>" + "<tr><td style='width:250px'></td><td style='width:150px'></td><td style='width:150px'><b>Shipping: </b><td><td>" + neworder.Shippingtotal + "</td></tr>" + "<tr><td style='width:250px'></td><td></td><td style='width:150px'><b>Total:</b> <td><td>" + neworder.Total + "</td></tr></table><br/>" + "Thank you for purchasing at Alamaat." + "<br/><b>Alamaat</b></div>"; //MailMessage mail = new MailMessage(); //mail.From = new MailAddress("*****@*****.**", "Administrator"); //mail.To.Add(new MailAddress("*****@*****.**")); //mail.Bcc.Add(new MailAddress("*****@*****.**")); //set the content string subject = "Alamaat Order " + neworder.OrderNumber + "total Rs. " + neworder.Total; // AlternateView view = AlternateView.CreateAlternateViewFromString(emailcontent, null, "text/html"); // mail.AlternateViews.Add(view); //send the message //SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net"); //specify the mail server address //SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); //smtp.Send(mail); SendEmail("*****@*****.**", subject, emailcontent); //MailMessage message = new MailMessage(); //message.Subject = subject; //message.Body = emailcontent; //message.To.Add("*****@*****.**"); //message.From = new MailAddress("*****@*****.**"); //message.IsBodyHtml = true; //var smtp = new System.Net.Mail.SmtpClient(); //{ // smtp.Host = "smtp.gmail.com"; // smtp.Port = 587; // smtp.EnableSsl = true; // smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; // smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "nazarh504"); // smtp.Timeout = 20000; //} //// Passing values to smtp object //smtp.Send(message); } }
public OrderController(OrderInterface order, OrderItemInterface orderItem) { _order = order; _orderItem = orderItem; }