可查询的数据转换

时间:2018-07-27 07:36:57

标签: json ajax model-view-controller pagination iqueryable

公共IQueryable ServerPagination(字符串操作)         {             可查询的数据= Enumerable.Empty()。AsQueryable();

        if (Action == "GetAllOnlineBookingService")
        {               
            data = (from m in BO.GetAll()
                    join mhc in TS.GetAll()
                    on m.Service_ID equals mhc.Service_ID
                    join msc in MSC.GetAll()
                    on mhc.Service_Cat_ID equals msc.Service_Cat_ID
                    select new BookingOrderViewModel
                    {                         
                        Booking_Order_ID = m.Booking_Order_ID,
                        Service_ID = m.Service_ID,
                        S_Name = m.S_Name,
                        Main_Deity = m.Main_Deity,
                        From_Date = m.From_Date,
                        To_Date = m.To_Date,
                        From_Time = m.From_Time,
                        To_Time = m.To_Time,
                        Contact_Name = m.Contact_Name,
                        NRIC_No = m.NRIC_No,
                        Mobile = m.Mobile,
                        Company = m.Company,
                        Office_No = m.Office_No,
                        Email_ID = m.Email_ID,
                        Blk_Hse = m.Blk_Hse,
                        Unit_No = m.Unit_No,
                        Street_Name = m.Street_Name,
                        Country = m.Country,
                        Postal_Code = m.Postal_Code,
                        Booking_Status = m.Booking_Status,
                        Payment_Status = m.Payment_Status,
                        Total_Cost = m.Total_Cost,
                        Assign_Priest = m.Assign_Priest,
                        Created_Date = m.Created_Date,
                        Created_By = m.Created_By,
                        Modified_Date = m.Modified_Date,
                        Modified_By = m.Modified_By,
                        Order_No = m.Order_No,
                        Nakshatra_Name1 = m.Nakshatra_Name1,
                        Nakshatra_Name2 = m.Nakshatra_Name2,
                        Nakshatra2 = m.Nakshatra2,
                        Nakshatra1 = m.Nakshatra1,
                        Booking_Ref_No = m.Booking_Ref_No,
                        Priest_recieving = m.Priest_Recieving,
                        Is_App = Convert.ToInt32(m.Is_App),
                    }).AsQueryable();

        }

        return data;
    }

我想在通过ViewModel从数据库检索时将字符串转换为DateTime格式,因为这些数据将转到JSON方法,然后JSON数据将通过AJAX进行查看。如何转换数据?

0 个答案:

没有答案