/// <summary> /// 将员工改签店铺 /// </summary> /// <param name="UserID">用户ID</param> /// <param name="ShopID">店铺ID</param> /// <returns></returns> public bool UserChangeShop(Guid UserID, int ShopID) { using (TransactionScope TS = new TransactionScope()) { try { UserInShop new_UIS = new UserInShop(); //当有User在数据库中有值的时候才进行删除操作 bool Mark = true; try { new_UIS = DB_UserInShop.Select(P => P.UserID == UserID).Single(); } catch (Exception) { Mark = false; } if (Mark) { DB_UserInShop.Delete_NoSub(new_UIS); } DB_UserInShop.Insert_NoSub(new UserInShop() { UserID = UserID, ShopID = ShopID }); } catch (Exception) { } TS.Complete(); } return(true); }
/// <summary> /// 删除收款单连带删除订单 /// </summary> /// <param name="OrderID"></param> /// <returns></returns> public bool DeleteCheckout_Trans(int OrderID) { Car_Checkout TempCheckout = DB_Checkout.Select(P => P.Checkout_Order == OrderID).Single(); return(DB_Checkout.Delete_NoSub(TempCheckout)); }