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));
        }
Beispiel #2
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;
 }
Beispiel #3
0
 static public void insertOrderItem(int sessionid, TOrderItemBiz item)
 {
     if (ItemListDict.ContainsKey(sessionid))
     {
         List <TOrderItemBiz> list = ItemListDict[sessionid];
         if (list == null)
         {
             list = new List <TOrderItemBiz>();
             ItemListDict[sessionid] = list;
         }
         if (list != null)
         {
             list.Add(item);
         }
     }
 }
Beispiel #4
0
 public static void insertOrderItem(int sessionid, TOrderItemBiz item)
 {
     if (ItemListDict.ContainsKey(sessionid))
     {
         List<TOrderItemBiz> list = ItemListDict[sessionid];
         if (list == null)
         {
             list = new List<TOrderItemBiz>();
             ItemListDict[sessionid] = list;
         }
         if (list != null)
         {
             list.Add(item);
         }
     }
 }
Beispiel #5
0
 public static void updateDataItem(TOrderItemBiz item)
 {
     int sessionid = 10;
     if (ItemListDict.ContainsKey(sessionid))
     {
         List<TOrderItemBiz> list = ItemListDict[sessionid];
         if (list != null)
         {
             foreach (TOrderItemBiz oneitem in list)
             {
                 if (item.DishId == oneitem.DishId)
                 {
                     oneitem.Copy(item);
                 }
             }
         }
     }
 }
Beispiel #6
0
        static public void updateDataItem(TOrderItemBiz item)
        {
            int sessionid = 10;

            if (ItemListDict.ContainsKey(sessionid))
            {
                List <TOrderItemBiz> list = ItemListDict[sessionid];
                if (list != null)
                {
                    foreach (TOrderItemBiz oneitem in list)
                    {
                        if (item.DishId == oneitem.DishId)
                        {
                            oneitem.Copy(item);
                        }
                    }
                }
            }
        }
Beispiel #7
0
        public string ChipIn1For5()
        {
            string result = "";
            int    count  = Items.Count;

            for (int i = 0; i < count; i++)
            {
                int chipIn = ((int)Items[i].Amount) / 5;
                if (chipIn > 0)
                {
                    TOrderItemBiz chipInItem = new TOrderItemBiz();
                    chipInItem.Copy(Items[i]);
                    chipInItem.Amount   = chipIn;
                    chipInItem.Price    = 0;
                    chipInItem.SubPrice = 0;
                    Items.Add(chipInItem);
                    result = result + chipInItem.Amount.ToString() + " free " + chipInItem.DishName + ";";
                }
            }
            return(result);
        }
        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);
        }
Beispiel #9
0
 public static void deleteOrderItem(TOrderItemBiz item)
 {
     ;
 }
Beispiel #10
0
        public string ChipIn1For5()
        {
            string result = "";
            int count = Items.Count;

            for (int i = 0; i < count; i++)
            {
                int chipIn = ((int)Items[i].Amount) / 5;
                if (chipIn > 0)
                {
                    TOrderItemBiz chipInItem = new TOrderItemBiz();
                    chipInItem.Copy(Items[i]);
                    chipInItem.Amount = chipIn;
                    chipInItem.Price = 0;
                    chipInItem.SubPrice = 0;
                    Items.Add(chipInItem);
                    result = result + chipInItem.Amount.ToString() + " free " + chipInItem.DishName + ";";
                }
            }
            return result;
        }
Beispiel #11
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;
 }
Beispiel #12
0
 static public void deleteOrderItem(TOrderItemBiz item)
 {
     ;
 }