public BL.Order GetOrderByOrderId(int id)
        {
            var result = _context.Orders.Where(o => o.OrderId == id).First();

            BL.Order order = new BL.Order(result.OrderId, result.CustomerId, result.StoreId, result.OrderDate, result.Subtotal);
            return(order);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BL.Order ord = new BL.Order();
            if (!(textBox3.Text.Equals("") || comboBox1.Text.Equals(""))) {
                if (checkSelelctProduct(comboBox1.Text))
                {
                    if (ord.checkavailabilty(allProducts, Convert.ToInt32(textBox3.Text), comboBox1.Text))
                    {
                        addProductSell(comboBox1.Text);
                        totalPrice += float.Parse(textBox4.Text);
                        textBox3.Text = "";
                    }
                    else MessageBox.Show("الكمية المطلوبة اكبر من المتاحة", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                }
                else {

                    MessageBox.Show("تم شراء المنتج بالفعل", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else {
                MessageBox.Show("يجب تدخيل كمية الشراء من الصنف ", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            //label7.Text = sellProduct.Count.ToString();
        }
예제 #3
0
        protected void Save(object obj, EventArgs args)
        {
            var statusID = int.Parse(statusDdl.SelectedValue);
            var deliveryID = int.Parse(deliveryDdl.SelectedValue);

            obl.UpdateOrder(Order.OrderID, statusID, deliveryID);
            _order = null;
        }
예제 #4
0
 private void btn_Print_Click(object sender, EventArgs e)
 {
     BL.Order Ord = new BL.Order();
     this.Cursor = Cursors.WaitCursor;
     Rpt.frm_ReportProduct frm    = new Rpt.frm_ReportProduct();
     Rpt.rpt_Order         Report = new Rpt.rpt_Order();
     Report.SetDataSource(Ord.ReportOrder(txtB_OrderNo.Text.ToString()));
     frm.crystalReportViewer1.ReportSource = Report;
     frm.Text = "Order";
     frm.ShowDialog();
     this.Cursor = Cursors.Default;
 }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (auth.CurrentUser == null)
                Response.Redirect(iStore.Site.SiteUrl + "Users/Login.aspx");

            if (UserOrder == null)
                Response.Redirect("~/Orders/OrdersList.aspx");
            if (!IsPostBack)
            {
                obl.UpdateCounts(UserOrder.OrderID);
                _UserOrder = null;
            }
        }
예제 #6
0
        protected void Pay(object obj, EventArgs args)
        {
            var firstName = HttpUtility.HtmlEncode(FirstNameTxt.Text.Trim());
            var lastName = HttpUtility.HtmlEncode(LastNameTxt.Text.Trim());
            var address1 = HttpUtility.HtmlEncode(address1Txt.Text.Trim());
            var address2 = HttpUtility.HtmlEncode(address2Txt.Text.Trim());
            var city = HttpUtility.HtmlEncode(cityTxt.Text.Trim());
            var email = emailTxt.Text.Trim();
            var province = HttpUtility.HtmlEncode(provinceTxt.Text.Trim());
            var zip = HttpUtility.HtmlEncode(zipTxt.Text.Trim());
            var phone = HttpUtility.HtmlEncode(phoneTxt.Text.Trim());
            var strCountryID = countryDdl.SelectedValue;
            int countryID;
            if (!int.TryParse(strCountryID, out countryID))
                return;

            if (!CheckData(firstName, lastName, address1, address2, city, province, zip, phone, email, countryID))
                return;

            email = string.IsNullOrWhiteSpace(email) ? auth.CurrentUser.Email : HttpUtility.HtmlEncode(email);

            obl.UpdateOrderUserData(UserOrder.OrderID, firstName, lastName, address1, address2, city, province, zip, phone, email, countryID);
            _UserOrder = null;

            IsDataAccepted = true;
        }