Exemplo n.º 1
0
        public object Get_ThongTinTuyen_TheoId(long idtuyen)
        {
            long            TUYEN = Convert.ToInt64(idtuyen);
            QLVT_LuongTuyen ltt   = qlvt.QLVT_LuongTuyen.Where(u => u.LT_IdLuongTuyen == TUYEN).FirstOrDefault();

            if (ltt != null)
            {
                var ob = new
                {
                    LT_IdLuongTuyen     = ltt.LT_IdLuongTuyen,
                    LT_MaTuyen          = ltt.LT_MaTuyen,
                    LT_DC_IdBen_01      = ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_IdBen_01,
                    LT_DC_IdBen_02      = ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_IdBen_02,
                    LT_DC_TenBen_01     = ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_01,
                    LT_DC_TenBen_02     = ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_02,
                    TuyenDuong          = ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_01 + " - " + ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_02,
                    LT_DC_IdLuongTuyen  = ltt.LT_DC_IdLuongTuyen,
                    LT_HanhTrinhChay    = ltt.LT_HanhTrinhChay,
                    LT_LuuLuongQuyDinh  = ltt.LT_LuuLuongQuyDinh,
                    LT_PL_IdLuongTuyen  = ltt.LT_PL_IdLuongTuyen,
                    TT_IdTrangThaiTuyen = ltt.TT_IdTrangThaiTuyen
                };
                return(ob);
            }
            return(null);
        }
Exemplo n.º 2
0
        public string TenTuyen_TheoId(long idtuyen)
        {
            long            TUYEN = Convert.ToInt64(idtuyen);
            QLVT_LuongTuyen ltt   = qlvt.QLVT_LuongTuyen.Where(u => u.LT_IdLuongTuyen == TUYEN).FirstOrDefault();
            string          st    = ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_01 + " - " + ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_02;

            return(st);
        }
Exemplo n.º 3
0
        public string Get_DanhSachAll_TenTuyen_CuaBen_KhongTatCa(int idBen, long[] array)
        {
            QLVT_LuongTuyen ltt           = new QLVT_LuongTuyen();
            string          string_return = "";
            int             IDBEN         = Convert.ToInt32(idBen);
            var             list          = (from lt in qlvt.QLVT_LuongTuyen
                                             where lt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_IdBen_01 == IDBEN || lt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_IdBen_02 == IDBEN
                                             select new
            {
                LT_IdLuongTuyen = lt.LT_IdLuongTuyen,
            }).ToList();

            if (array != null)
            {
                if (array.Length <= 3)
                {
                    for (int i = 0; i < array.Length; i++)
                    {
                        long idtuyen = array[i];
                        ltt            = qlvt.QLVT_LuongTuyen.Where(u => u.LT_IdLuongTuyen == idtuyen).FirstOrDefault();
                        string_return += ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_01 + " - " + ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_02;
                    }
                    string_return += ".";
                }
                else
                {
                    int i = 3;
                    for (int j = 0; j < i; j++)
                    {
                        ltt            = qlvt.QLVT_LuongTuyen.Where(u => u.LT_IdLuongTuyen == array[j]).FirstOrDefault();
                        string_return += ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_01 + " - " + ltt.QLVT_LuongTuyen_DiemDauCuoi.LT_DC_TenBen_02;
                    }
                    ;
                    string_return += ", ...";
                }
            }
            return(string_return);
        }