private void checkdeletechargesummary(HttpContext context)
        {
            string     ChargeIDs    = context.Request.Params["ChargeIDs"];
            List <int> ChargeIDList = new List <int>();

            if (!string.IsNullOrEmpty(ChargeIDs))
            {
                ChargeIDList = JsonConvert.DeserializeObject <List <int> >(ChargeIDs);
            }
            int roomfee_total = RoomFee.GetRoomFeeListCountByChargeIDList(ChargeIDList);

            if (roomfee_total > 0)
            {
                WebUtil.WriteJson(context, new { status = false, error = "有未收费的单据,操作取消" });
                return;
            }
            var history_count = RoomFeeHistory.GetRoomFeeHistoryListCountByChargeIDList(ChargeIDList: ChargeIDList);

            if (history_count > 0)
            {
                WebUtil.WriteJson(context, new { status = false, error = "有已收费的单据,操作取消" });
                return;
            }
            WebUtil.WriteJson(context, new { status = true });
        }
        private void SaveRoomHistoryFee(ImportFee importFee, int SummaryID, SqlHelper helper, string AddMan)
        {
            PrintRoomFeeHistory printRoomFeeHistory = new PrintRoomFeeHistory();

            printRoomFeeHistory.Cost           = importFee.TotalPrice;
            printRoomFeeHistory.CostCapital    = Tools.CmycurD(printRoomFeeHistory.Cost);
            printRoomFeeHistory.RealCost       = printRoomFeeHistory.Cost;
            printRoomFeeHistory.PreChargeMoney = 0;
            printRoomFeeHistory.DiscountMoney  = 0;
            printRoomFeeHistory.RealMoneyCost1 = printRoomFeeHistory.Cost;
            printRoomFeeHistory.RealMoneyCost2 = 0;
            printRoomFeeHistory.AddMan         = AddMan;
            printRoomFeeHistory.AddTime        = DateTime.Now;
            int    OrderNumberID = 0;
            string PrintNumber   = Foresight.DataAccess.PrintRoomFeeHistory.GetLastestPrintNumber(importFee.RoomID, helper, out OrderNumberID);

            printRoomFeeHistory.PrintNumber     = PrintNumber;
            printRoomFeeHistory.OrderNumberID   = OrderNumberID;
            printRoomFeeHistory.ChargeBackMoney = 0;
            printRoomFeeHistory.ChargeTime      = DateTime.Now;
            printRoomFeeHistory.ChageType1      = 0;
            printRoomFeeHistory.IsCancel        = false;
            printRoomFeeHistory.Save(helper);
            RoomFeeHistory roomFee = new RoomFeeHistory();

            roomFee.ID                = importFee.ID;
            roomFee.RoomID            = importFee.RoomID;
            roomFee.UseCount          = importFee.TotalPoint;
            roomFee.StartTime         = importFee.StartTime;
            roomFee.EndTime           = importFee.EndTime;
            roomFee.Cost              = importFee.TotalPrice;
            roomFee.AddTime           = DateTime.Now;
            roomFee.AddUserName       = User.GetCurrentUserName();
            roomFee.IsCharged         = true;
            roomFee.ChargeID          = SummaryID;
            roomFee.IsStart           = true;
            roomFee.UnitPrice         = importFee.UnitPrice;
            roomFee.ImportFeeID       = importFee.ID;
            roomFee.ChargeFeeID       = 0;
            roomFee.ChargeFee         = 0;
            roomFee.RealCost          = roomFee.Cost;
            roomFee.Discount          = 0;
            roomFee.TotalRealCost     = roomFee.RealCost;
            roomFee.TotalDiscountCost = 0;
            roomFee.RestCost          = 0;
            roomFee.PrintID           = printRoomFeeHistory.ID;
            roomFee.ChargeTime        = DateTime.Now;
            roomFee.ChargeState       = 1;
            roomFee.IsImportFee       = true;
            roomFee.Save(helper);
        }