Beispiel #1
0
        /// <summary>
        /// 删除发货单方法
        /// </summary>
        /// <param name="storeId"></param>
        /// <returns></returns>
        public static Boolean DelGoodsOrder(string storeOrderID)
        {
            Boolean        temp       = true;
            string         connString = DBHelper.connString;
            SqlTransaction tr         = null;
            SqlConnection  conn       = new SqlConnection(connString);

            conn.Open();
            tr = conn.BeginTransaction();
            try
            {
                BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("StoreOrder", "storeOrderID");
                cl_h_info.AddRecordtran(tr, storeOrderID);
                cl_h_info.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.Order, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.Company);


                StockDAL.DelGoodsOrder(tr, OrderDetailDAL.GetOrderDetail(storeOrderID), StoreOrderDAL.GetStoreIdByOrderId(storeOrderID)); //还原店库存
                OrderDetailDAL.DelOrderDetailItem(tr, storeOrderID);                                                                      //明细表删除失败回滚
                StoreOrderDAL.DelStoreOrder(storeOrderID, tr);                                                                            //订单表删除失败回滚

                tr.Commit();
            }
            catch
            {
                temp = false;
                tr.Rollback();
            }
            finally
            {
                // tr.Connection.Close();
                tr.Dispose();
                conn.Close();
            }
            return(temp);
        }