/// <summary>
        /// 重启计划
        /// </summary>
        /// <param name="keyValue"></param>
        /// <returns></returns>
        public bool DoAgin(string keyValue)
        {
            try
            {
                using (var tran = Trade_SQLDB.GetInstance().GetTransaction())
                {
                    //查询产品对应的订单明细
                    var orderdetailList = tbl_SalePlanDetai.Fetch(string.Format("select * from tbl_SalePlanDetai where SalePlanId='{0}'", keyValue));
                    foreach (var orderdetail in orderdetailList)
                    {
                        orderdetail.Status = (int)Trade.Model.Enums.ArrivalStatus.未到货;
                        orderdetail.Update();
                    }
                    //更改对应计划明细状态
                    Trade_SQLDB.GetInstance().Execute(string.Format("update tbl_SalePlan set PlanStatus='{0}' where SalePlanId='{1}'", (int)Trade.Model.Enums.PlanStatus.已生效, keyValue));

                    // Commit
                    tran.Complete();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 处理到货业务
        /// 更改对应相关产品的订单状态为到货
        /// </summary>
        /// <param name="keys"></param>
        public bool DoDispose(string[] keys)
        {
            try
            {
                using (var tran = Trade_SQLDB.GetInstance().GetTransaction())
                {
                    foreach (var key in keys)
                    {
                        var plandetail = GetEntity(key);
                        if (plandetail != null)
                        {
                            //查询产品对应的订单明细
                            var orderdetailList = tbl_OrderDetail.Fetch(string.Format("select * from tbl_OrderDetail where ProductId='{0}' and Status='{1}'", plandetail.ProductId, (int)Trade.Model.Enums.OrderDetailStatus.未到货));
                            foreach (var orderdetail in orderdetailList)
                            {
                                // Trade_SQLDB.GetInstance().Execute(string.Format("update tbl_OrderDetail set Status='{0}' where OrderdetailId='{1}'", (int)Trade.Model.Enums.OrderDetailStatus.已到货, orderdetail.OrderdetailId));
                                tbl_OrderDetail.Update("set Status=@0 where OrderdetailId=@1", (int)Trade.Model.Enums.OrderDetailStatus.已到货, orderdetail.OrderdetailId);
                            }

                            //更改对应计划明细状态
                            //Trade_SQLDB.GetInstance().Execute(string.Format("update tbl_SalePlanDetai set Status='{0}' where SalePlanDetaiId='{1}'", (int)Trade.Model.Enums.ArrivalStatus.已到货, plandetail.SalePlanDetaiId));
                            tbl_SalePlanDetai.Update("set Status=@0 where SalePlanDetaiId=@1", (int)Trade.Model.Enums.ArrivalStatus.已到货, plandetail.SalePlanDetaiId);
                        }
                    }

                    // Commit
                    tran.Complete();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }