/// <summary>
 /// 可以下线返回true,不可以返回false
 /// </summary>
 /// <returns></returns>
 public bool IsOffLine()
 {
     //saletemp01中的记录大于0
     if (DataGetSaleTemp01.InitDataDataGetSaleTmp01().GetSaleTmp01(Info.sale_id).Tables[0].Rows.Count > 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
 private DataSet dstaSet; //映射SALETMP01
 /// <summary>
 /// 根据销售单号查询数据(排除组合餐中的子产品)
 /// </summary>
 /// <param name="sale_id">销售单序号</param>
 public DataSet  GetOrderInfo(string sale_id)
 {
     return(this.dstaSet = DataGetSaleTemp01.InitDataDataGetSaleTmp01().GetSaleTmp01Single(sale_id));
 }
 /// <summary>
 /// 备餐是调用(如果是组合餐包括子产品)
 /// </summary>
 /// <param name="sale_id">销售单序号</param>
 public DataSet GetBeiCan(string sale_id)
 {
     return(this.dstaSet = DataGetSaleTemp01.InitDataDataGetSaleTmp01().GetSaleTmp01(sale_id));
 }
        /// <summary>
        /// 插入单餐(插入表SALETMP01)
        /// </summary>
        /// <param name="prod_Id">商品id号</param>
        /// <param name="number">商品的数量</param>
        /// <param name="discount">折扣</param>
        /// <returns>成功插入返回true</returns>
        public bool InsertSaleTmp1(string prod_Id, int number, decimal discount)
        {
            int       count     = 0;//商品的原数量
            SALETMP00 saleTmp00 = new SALETMP00();

            saleTmp00.TOT_QUAN1 = Convert.ToDecimal(number);
            if (discount != 0)
            {
                saleTmp00.TOT_SALES1 = Info.sale_price * discount * Convert.ToDecimal(0.01);
            }
            else
            {
                saleTmp00.TOT_SALES1 = Info.sale_price;
            }
            InsertSaleTmp00.InitInsertSaleTmp00().DataUpdateSaleTmp00(saleTmp00.TOT_QUAN1, saleTmp00.TOT_SALES1);
            //首先检查是否有已点过的相同产品,则把那个产品数量加 1并返回
            try
            {
                DataSet dataSet = DataGetSaleTemp01.InitDataDataGetSaleTmp01().GetSales(Info.sale_id);

                for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
                {
                    if (prod_Id == dataSet.Tables[0].Rows[i]["prod_id"].ToString() && dataSet.Tables[0].Rows[i]["COMB_TYPE"].ToString() != "2")
                    {
                        count = int.Parse(dataSet.Tables[0].Rows[i]["qty"].ToString());
                        UpdateSales updateSales = new UpdateSales();
                        updateSales.setSalesQty(prod_Id, 2, count + number);
                        return(true);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            SaleTmp01 saleTmp01 = new SaleTmp01();

            saleTmp01.Shop_id    = Info.shop_id;
            saleTmp01.Sale_id    = Info.sale_id;
            saleTmp01.Sale_sno   = Info.sale_sno;
            saleTmp01.Prod_id    = prod_Id;
            saleTmp01.Sale_price = Info.sale_price;

            saleTmp01.Qty = number;
            if (discount != 0)
            {
                try
                {
                    saleTmp01.Item_disc = (Info.sale_price * discount * Convert.ToDecimal(0.01) - Info.sale_price) * number;
                }

                catch { saleTmp01.Item_disc = 0; }
            }
            else
            {
                saleTmp01.Item_disc = 0;
            }
            saleTmp01.Prom_id    = "0";
            saleTmp01.Prom_sno   = 0;
            saleTmp01.Price_type = "0";

            // saleTmp01.Free_emp = Info.emp_id;
            saleTmp01.Comb_sale_sno = 0;
            saleTmp01.Comb_sno      = 0;
            saleTmp01.Comb_type     = "0 ";

            saleTmp01.Item_tax    = 0;
            saleTmp01.Outincome   = false;
            saleTmp01.Meal_ticket = 0;
            saleTmp01.By_token    = false;
            saleTmp01.Relate_prod = prod_Id;

            saleTmp01.Sale_orginal_price = Info.sale_price;
            saleTmp01.Item_disc_tot      = 0;
            saleTmp01.Act_price          = saleTmp01.Sale_price;
            saleTmp01.Isprom             = false;
            saleTmp01.Group_prod         = prod_Id;
            saleTmp01.Transfer_status    = "0";
            saleTmp01.Status_id          = "2";
            try
            {
                return(DataInsertSaleTmp01.InitDataInsertSale01().InsertSale01(saleTmp01));
            }
            catch (Exception ex)
            {
                throw ex;
                //return false;
            }
        }