public bool Insert_UpdateSanBayDuongDai(string soHieuXe, DateTime ThoiDiemDi, string maLaiXe, string ViTriDiemBao, string ViTriDiemDen, long CoDi, LoaiChoKhach loaiChoKhach, KieuLaiXeBao kieuLaiXeBao, string GhiChu, LoaiChieuChoKhach ChieuChoKhach, long CoVe)
        {
            try
            {
                int            rowAffected = 0;
                SqlParameter[] parameters  = new SqlParameter[] {
                    new SqlParameter("@SoHieuXe", SqlDbType.VarChar, 4),
                    new SqlParameter("@ThoiDiemBao", SqlDbType.DateTime),
                    new SqlParameter("@MaLaiXe", SqlDbType.NVarChar, 50),
                    new SqlParameter("@ViTriDiemBao", SqlDbType.NVarChar, 50),
                    new SqlParameter("@ViTriDiemDen", SqlDbType.NVarChar, 50),
                    new SqlParameter("@LoaiChoKhach", SqlDbType.Char, 1),
                    new SqlParameter("@TrangThaiLaiXeBao", SqlDbType.VarChar, 2),
                    new SqlParameter("@GhiChu", SqlDbType.NVarChar, 250),
                    new SqlParameter("@Chieu", SqlDbType.TinyInt),
                    new SqlParameter("@CoDi", SqlDbType.BigInt),
                    new SqlParameter("@CoVe", SqlDbType.BigInt)
                };

                parameters[0].Value  = soHieuXe;
                parameters[1].Value  = ThoiDiemDi;
                parameters[2].Value  = maLaiXe;
                parameters[3].Value  = ViTriDiemBao;
                parameters[4].Value  = ViTriDiemDen;
                parameters[5].Value  = ((int)(LoaiChoKhach)loaiChoKhach).ToString();
                parameters[6].Value  = ((int)(KieuLaiXeBao)kieuLaiXeBao).ToString();;
                parameters[7].Value  = GhiChu;
                parameters[8].Value  = ((int)(LoaiChieuChoKhach)ChieuChoKhach);
                parameters[9].Value  = CoDi;
                parameters[10].Value = CoVe;

                rowAffected = this.RunProcedure("sp_T_KIEMSOAT_LIENLAC_Insert_UpdateSanBayDuongDai", parameters, rowAffected);
                return(rowAffected > 0);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
        //@SoHieuXe char(3),
        //@ThoiDiemBao datetime,
        //@MaLaiXe char(6),
        //@ViTriDiemBao nvarchar(50),
        //@ViTriDiemDen nvarchar(50),
        //@LoaiChoKhach char(1),
        //@TrangThaiLaiXeBao char(1),
        //@IsHoatDong char(1)

        /// <summary>
        ///
        /// </summary>
        /// <param name="SoHieuXe"></param>
        /// <param name="ThoiDiemBao"></param>
        /// <param name="MaLaiXe"></param>
        /// <param name="ViTriDiemBao"></param>
        /// <param name="ViTriDiemDen"></param>
        /// <param name="LoaiChoKhach"></param>
        /// <param name="TrangThaiLaiXeBao"></param>
        /// <param name="GhiChu"></param>
        /// <param name="IsHoatDong"></param>
        /// <param name="chieu"></param>
        /// <param name="checkedGPS"></param>
        /// <returns></returns>
        public bool Insert_Update(string SoHieuXe, DateTime ThoiDiemBao, string MaLaiXe, string ViTriDiemBao, string ViTriDiemDen, LoaiChoKhach LoaiChoKhach,
                                  KieuLaiXeBao TrangThaiLaiXeBao, string GhiChu, bool IsHoatDong, LoaiChieuChoKhach chieu, bool checkedGPS, long coDi, int SoPhutNghi)
        {
            try
            {
                int            rowAffected = 0;
                SqlParameter[] parameters  = new SqlParameter[] {
                    new SqlParameter("@SoHieuXe", SqlDbType.VarChar, 4),
                    new SqlParameter("@ThoiDiemBao", SqlDbType.DateTime),
                    new SqlParameter("@MaLaiXe", SqlDbType.NVarChar, 50),
                    new SqlParameter("@ViTriDiemBao", SqlDbType.NVarChar, 50),
                    new SqlParameter("@ViTriDiemDen", SqlDbType.NVarChar, 50),
                    new SqlParameter("@LoaiChoKhach", SqlDbType.Char, 1),
                    new SqlParameter("@TrangThaiLaiXeBao", SqlDbType.VarChar, 2),
                    new SqlParameter("@GhiChu", SqlDbType.NVarChar, 550),
                    new SqlParameter("@IsHoatDong", SqlDbType.Char, 1),
                    new SqlParameter("@Chieu", SqlDbType.TinyInt),
                    new SqlParameter("@CheckedGPS", SqlDbType.Bit),
                    new SqlParameter("@CoDi", SqlDbType.BigInt),
                    new SqlParameter("@SoPhutNghi", SqlDbType.Int)
                };

                parameters[0].Value  = SoHieuXe;
                parameters[1].Value  = ThoiDiemBao;
                parameters[2].Value  = MaLaiXe;
                parameters[3].Value  = ViTriDiemBao;
                parameters[4].Value  = ViTriDiemDen;
                parameters[5].Value  = ((int)(LoaiChoKhach)LoaiChoKhach).ToString();
                parameters[6].Value  = ((int)(KieuLaiXeBao )TrangThaiLaiXeBao).ToString();;
                parameters[7].Value  = GhiChu;
                parameters[8].Value  = (IsHoatDong == true ? "1" : "0");
                parameters[9].Value  = ((int)(LoaiChieuChoKhach)chieu);
                parameters[10].Value = checkedGPS;
                parameters[11].Value = coDi;
                parameters[12].Value = SoPhutNghi;

                rowAffected = this.RunProcedure("sp_T_KIEMSOAT_LIENLAC_Insert_Update2", parameters, rowAffected);
                return(rowAffected > 0);
            }
            catch (Exception e)
            {
                return(false);
            }
        }