Пример #1
0
        public static int GetLastestPrintNumberPart2(string OrderTypeName, int RoomID, SqlHelper helper, out int OrderNumberID, out int OrderNumberCount, Sys_OrderNumber sysOrderNumber = null, PrintRoomFeeHistory history = null)
        {
            OrderNumberCount = 0;
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = OrderTypeNameDefine.chargefee.ToString();
            }
            if (sysOrderNumber == null)
            {
                sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, RoomID, helper);
            }
            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(0);
            }
            OrderNumberID = sysOrderNumber.ID;
            if (history == null)
            {
                history = GetLastPrintRoomFeeHistory(OrderNumberID, helper);
            }
            OrderNumberCount = sysOrderNumber.OrderNumberCount <= 0 ? 3 : sysOrderNumber.OrderNumberCount;
            int number = 1;

            if (history != null && !string.IsNullOrEmpty(history.PrintNumber))
            {
                number = GetOrderNumberBySysOrder(history.PrintNumber, sysOrderNumber, out OrderNumberCount);
            }
            //return number.ToString("D" + OrderNumberCount);
            return(number);
        }
Пример #2
0
        public static string GetLastestCustomerServiceNumber(string OrderTypeName, int RoomID, out int OrderNumberID)
        {
            ResetCache();
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = Foresight.DataAccess.OrderTypeNameDefine.customerservice.ToString();
            }
            Sys_OrderNumber sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, RoomID);

            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(string.Empty);
            }
            OrderNumberID = sysOrderNumber.ID;
            CustomerService service = CustomerService.GetLastCustomerService(OrderNumberID);
            string          Part1   = string.Empty;

            Part1 += sysOrderNumber.OrderPrefix;
            string time_yyyy = DateTime.Now.ToString("yyyy");
            string time_mm   = DateTime.Now.ToString("MM");
            string time_dd   = DateTime.Now.ToString("dd");

            if (sysOrderNumber.UseYear)
            {
                Part1 += time_yyyy;
            }
            if (sysOrderNumber.UseMonth)
            {
                Part1 += time_mm;
            }
            if (sysOrderNumber.UseDay)
            {
                Part1 += time_dd;
            }
            int OrderNumberCount = sysOrderNumber.OrderNumberCount <= 0 ? 3 : sysOrderNumber.OrderNumberCount;
            int number           = 1;

            if (service != null && !string.IsNullOrEmpty(service.ServiceNumber))
            {
                number = PrintRoomFeeHistory.GetOrderNumberBySysOrder(service.ServiceNumber, sysOrderNumber, out OrderNumberCount);
            }
            return(Part1 + number.ToString("D" + OrderNumberCount));
        }
Пример #3
0
        public static string GetLastestContractNumber(string OrderTypeName, int RoomID, out int OrderNumberID)
        {
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = OrderTypeNameDefine.contractnumber.ToString();
            }
            Sys_OrderNumber sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, RoomID);

            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(string.Empty);
            }
            OrderNumberID = sysOrderNumber.ID;
            Contract contract = Contract.GetLastContract(OrderNumberID);
            string   Part1    = string.Empty;

            Part1 += sysOrderNumber.OrderPrefix;
            string time_yyyy = DateTime.Now.ToString("yyyy");
            string time_mm   = DateTime.Now.ToString("MM");
            string time_dd   = DateTime.Now.ToString("dd");

            if (sysOrderNumber.UseYear)
            {
                Part1 += time_yyyy;
            }
            if (sysOrderNumber.UseMonth)
            {
                Part1 += time_mm;
            }
            if (sysOrderNumber.UseDay)
            {
                Part1 += time_dd;
            }
            int OrderNumberCount = sysOrderNumber.OrderNumberCount <= 0 ? 3 : sysOrderNumber.OrderNumberCount;
            int number           = 1;

            if (contract != null && !string.IsNullOrEmpty(contract.ContractNo))
            {
                number = PrintRoomFeeHistory.GetOrderNumberBySysOrder(contract.ContractNo, sysOrderNumber, out OrderNumberCount);
            }
            return(Part1 + number.ToString("D" + OrderNumberCount));
        }
Пример #4
0
        public static string GetLastestRoomFeeOrderNumber(string OrderTypeName, int RoomID, SqlHelper helper, out int OrderNumberID)
        {
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = Foresight.DataAccess.OrderTypeNameDefine.roomfeeorder.ToString();
            }
            Sys_OrderNumber sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, RoomID, helper);

            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(string.Empty);
            }
            OrderNumberID = sysOrderNumber.ID;
            RoomFeeOrder history = RoomFeeOrder.GetLastRoomFeeOrder(OrderNumberID, helper);
            string       Part1   = string.Empty;

            Part1 += sysOrderNumber.OrderPrefix;
            string time_yyyy = DateTime.Now.ToString("yyyy");
            string time_mm   = DateTime.Now.ToString("MM");
            string time_dd   = DateTime.Now.ToString("dd");

            if (sysOrderNumber.UseYear)
            {
                Part1 += time_yyyy;
            }
            if (sysOrderNumber.UseMonth)
            {
                Part1 += time_mm;
            }
            if (sysOrderNumber.UseDay)
            {
                Part1 += time_dd;
            }
            int OrderNumberCount = sysOrderNumber.OrderNumberCount <= 0 ? 3 : sysOrderNumber.OrderNumberCount;
            int number           = 1;

            if (history != null && !string.IsNullOrEmpty(history.OrderNumber))
            {
                number = PrintRoomFeeHistory.GetOrderNumberBySysOrder(history.OrderNumber, sysOrderNumber, out OrderNumberCount);
            }
            return(Part1 + number.ToString("D" + OrderNumberCount));
        }
Пример #5
0
        public static string GetLastestPrintNumberPart1(string OrderTypeName, int RoomID, SqlHelper helper, out int OrderNumberID, Sys_OrderNumber sysOrderNumber = null, PrintRoomFeeHistory history = null)
        {
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = OrderTypeNameDefine.chargefee.ToString();
            }
            if (sysOrderNumber == null)
            {
                sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, RoomID, helper);
            }
            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(string.Empty);
            }
            OrderNumberID = sysOrderNumber.ID;
            if (history == null)
            {
                history = GetLastPrintRoomFeeHistory(OrderNumberID, helper);
            }
            string Part1 = string.Empty;

            Part1 += sysOrderNumber.OrderPrefix;
            string time_yyyy = DateTime.Now.ToString("yyyy");
            string time_mm   = DateTime.Now.ToString("MM");
            string time_dd   = DateTime.Now.ToString("dd");

            if (sysOrderNumber.UseYear)
            {
                Part1 += time_yyyy;
            }
            if (sysOrderNumber.UseMonth)
            {
                Part1 += time_mm;
            }
            if (sysOrderNumber.UseDay)
            {
                Part1 += time_dd;
            }
            return(Part1);
        }
Пример #6
0
        public static string GetLastestPrintNumber(string OrderTypeName, int RoomID, SqlHelper helper, out int OrderNumberID)
        {
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = Foresight.DataAccess.OrderTypeNameDefine.chargefee.ToString();
            }
            Sys_OrderNumber sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, RoomID, helper);

            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(string.Empty);
            }
            OrderNumberID = sysOrderNumber.ID;
            PrintRoomFeeHistory history = GetLastPrintRoomFeeHistory(OrderNumberID, helper);
            string part1Str             = GetLastestPrintNumberPart1(OrderTypeName, RoomID, helper, out OrderNumberID, sysOrderNumber: sysOrderNumber, history: history);
            int    OrderNumberCount     = 0;
            int    part2Num             = GetLastestPrintNumberPart2(OrderTypeName, RoomID, helper, out OrderNumberID, out OrderNumberCount, sysOrderNumber: sysOrderNumber, history: history);

            return(part1Str + part2Num.ToString("D" + OrderNumberCount));
        }