Example #1
0
        static public long saveOrder(TOrderBiz order)
        {
            TOrderData ob = new TOrderData();

            ob.Configure();

            TOrder od = ob.CreateOrder(order.Name, order.Address, order.Phone, order.AddText, order.OrderTypeID);

            od.UserName = order.UserName;

            foreach (TOrderItemBiz item in order.Items)
            {
                TOrderItem oditem = new TOrderItem();
                oditem.Order    = od;
                oditem.Price    = item.Price;
                oditem.Amount   = item.Amount;
                oditem.SubPrice = item.SubPrice;
                oditem.Text     = item.Text;
                oditem.DishId   = item.DishId;
                oditem.DishName = item.DishName;

                od.Items.Add(oditem);
            }
            ob.UpdateOrder(od);
            return(od.Id);
        }
Example #2
0
        static public long saveOrder(ref string promo, string user_name, string name, string phone, string add, string text, long orderType, DataTable dtOrder)
        {
            TOrderBiz order = new TOrderBiz();

            order.Name        = name;
            order.UserName    = user_name;
            order.Address     = add;
            order.Phone       = phone;
            order.AddText     = text;
            order.OrderTypeID = orderType;
            if (dtOrder != null)
            {
                for (int i = 0; i < dtOrder.Rows.Count; i++)
                {
                    TOrderItemBiz item = new TOrderItemBiz();
                    item.DishId   = (long)dtOrder.Rows[i][0];
                    item.DishName = (string)dtOrder.Rows[i][1];

                    item.Amount   = Convert.ToDecimal(stripDL(dtOrder.Rows[i][2].ToString()));
                    item.SubPrice = Convert.ToDecimal(stripDL(dtOrder.Rows[i][3].ToString()));
                    item.Price    = Convert.ToDecimal(stripDL(dtOrder.Rows[i][4].ToString()));
                    item.Text     = "";
                    order.Items.Add(item);
                }
            }
            promo = order.ChipIn1For5();
            return(saveOrder(order));
        }
Example #3
0
 public void Copy(TOrderItemBiz item)
 {
     DishId   = item.DishId;
     Id       = item.Id;
     DishName = item.DishName;
     Price    = item.Price;
     Amount   = item.Amount;
     SubPrice = item.SubPrice;
     Text     = item.Text;
     Order    = item.Order;
 }
Example #4
0
        public static long saveOrder(TOrderBiz order)
        {
            TOrderData ob = new TOrderData();
            ob.Configure();

            TOrder od = ob.CreateOrder(order.Name, order.Address, order.Phone, order.AddText, order.OrderTypeID);

            od.UserName = order.UserName;

            foreach (TOrderItemBiz item in order.Items)
            {
                TOrderItem oditem = new TOrderItem();
                oditem.Order = od;
                oditem.Price = item.Price;
                oditem.Amount = item.Amount;
                oditem.SubPrice = item.SubPrice;
                oditem.Text = item.Text;
                oditem.DishId = item.DishId;
                oditem.DishName = item.DishName;

                od.Items.Add(oditem);
            }
            ob.UpdateOrder(od);
            return od.Id;
        }
Example #5
0
        public static long saveOrder(ref string promo, string user_name, string name, string phone, string add, string text, long orderType, DataTable dtOrder)
        {
            TOrderBiz order = new TOrderBiz();
            order.Name = name;
            order.UserName = user_name;
            order.Address = add;
            order.Phone = phone;
            order.AddText = text;
            order.OrderTypeID = orderType;
            if (dtOrder != null)
            {
                for (int i = 0; i < dtOrder.Rows.Count; i++)
                {
                    TOrderItemBiz item = new TOrderItemBiz();
                    item.DishId = (long)dtOrder.Rows[i][0];
                    item.DishName = (string)dtOrder.Rows[i][1];

                    item.Amount = Convert.ToDecimal(stripDL(dtOrder.Rows[i][2].ToString()));
                    item.SubPrice = Convert.ToDecimal(stripDL(dtOrder.Rows[i][3].ToString()));
                    item.Price = Convert.ToDecimal(stripDL(dtOrder.Rows[i][4].ToString()));
                    item.Text = "";
                    order.Items.Add(item);
                }

            }
            promo = order.ChipIn1For5();
            return saveOrder(order);
        }