public int DeleteOrderAndOrderItem(System.Int64 OID, bool DeleteOItem) { HG_Orders Order = new HG_Orders().GetOne(OID); if (Order != null) { Order.Deleted = true; Order.Save(); } if (DeleteOItem) { List <HG_OrderItem> list = new HG_OrderItem().GetAll(OID); foreach (var obj in list) { obj.Deleted = true; obj.Save(); } } return(0); }
public static void RemoveDiscntCharge(Int64 SeatingId, int Otp, Int64 OID) { List <OrdDiscntChrge> discntCharges = DiscntCharge.ListDiscntChrge.FindAll(x => x.SeatingId == SeatingId && x.SeatingOtp == Otp); string DisntChargeIDs = ""; for (int i = 0; i < discntCharges.Count; i++) { discntCharges[i].Save(); if (i == 0) { DisntChargeIDs += discntCharges[i].ID.ToString(); } else { DisntChargeIDs += "," + discntCharges[i].ID.ToString(); } } if (DisntChargeIDs != "") { HG_Orders hG_Orders = new HG_Orders().GetOne(OID); if (hG_Orders.OID > 0) { if (hG_Orders.DisntChargeIDs != "" && hG_Orders.DisntChargeIDs != "0") { hG_Orders.DisntChargeIDs = hG_Orders.DisntChargeIDs + "," + DisntChargeIDs; } else { hG_Orders.DisntChargeIDs = DisntChargeIDs; } hG_Orders.Save(); } } if (discntCharges.Count > 0) { DiscntCharge.ListDiscntChrge.RemoveAll(x => x.SeatingId == SeatingId && x.SeatingOtp == Otp); } }