示例#1
0
        public void ThemVeDat(int idKhach)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string strSql = "sp_ThemVeMoi";
                p.ExecuteNonQuery(CommandType.StoredProcedure, strSql,
                                  new SqlParameter {
                    ParameterName = "@IDKH", Value = idKhach
                });
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#2
0
        public void ThayTheTam(int IDVe)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string strSql = "sp_ThemTempVe";
                p.ExecuteNonQuery(CommandType.StoredProcedure, strSql,
                                  new SqlParameter {
                    ParameterName = "@IdVe", Value = IDVe
                });
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#3
0
        public void XoaVe(int IdChuyen)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string strSql = "sp_XoaVe";
                p.ExecuteNonQuery(CommandType.StoredProcedure, strSql,
                                  new SqlParameter {
                    ParameterName = "@IDChuyen", Value = IdChuyen
                });
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#4
0
        public void InsertGhe(DTO.Ghe ghe)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string strSql = "InsertGhe";
                p.ExecuteNonQuery(CommandType.StoredProcedure, strSql,
                                  new SqlParameter {
                    ParameterName = "@IDGhe", Value = ghe.ID
                },
                                  new SqlParameter {
                    ParameterName = "@Dong", Value = ghe.Dong
                },
                                  new SqlParameter {
                    ParameterName = "@Cot", Value = ghe.Cot
                },
                                  new SqlParameter {
                    ParameterName = "@Tang", Value = ghe.Tang
                },
                                  new SqlParameter {
                    ParameterName = "@SoGhe", Value = ghe.SoGhe
                },
                                  new SqlParameter {
                    ParameterName = "@IdXe", Value = ghe.IdXe
                }
                                  );
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#5
0
        public void Delete(string UserID)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string strSql = "DeleteUsers";
                p.ExecuteNonQuery(CommandType.StoredProcedure, strSql,
                                  new SqlParameter {
                    ParameterName = "@UserID", Value = UserID
                }
                                  );
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#6
0
        public DataTable FillDGV(int IdLoai)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_FillXe";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@IdLoai", Value = IdLoai
                });
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#7
0
        public void Delete_Tram(int ID_Tram)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string strSql = "sp_XoaTram";
                p.ExecuteNonQuery(CommandType.StoredProcedure, strSql,
                                  new SqlParameter {
                    ParameterName = "@ID", Value = ID_Tram
                }
                                  );
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#8
0
        public DataTable TimKiemTaiXe(string hoTen)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_TimKiemTaiXe";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@TenTaiXe", Value = hoTen
                });
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#9
0
        public void XoaTaiXe(int id)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_XoaTaiXe";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@ID", Value = id
                }
                                            );
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#10
0
        public DataTable FillNgayKhoiHanh(int IDTuyen)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_FillNgayKhoiHanh";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@IdTuyen", Value = IDTuyen
                });
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#11
0
        public DataTable FillListViewQuyen(string userid)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "FillCbbQuyen";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@UserID", Value = userid
                }
                                            );
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#12
0
        public DataTable FillDgvVeDatKH(int MaKH)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_FindVeByKhachHang";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@IdKH", Value = MaKH
                }
                                            );
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#13
0
        public DataTable FillDgvVeDatLai(int MaChuyen)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_FillDGvVeDat";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@MaChuyen", Value = MaChuyen
                }
                                            );
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }
示例#14
0
        public DataTable Fill_ReportChuyenTrongVe(int Thang)
        {
            Provider p = new Provider();

            try
            {
                p.Connect();
                string    strSql = "sp_FillReportChuyenTrongVe";
                DataTable dt     = p.Select(CommandType.StoredProcedure, strSql,
                                            new SqlParameter {
                    ParameterName = "@Thang", Value = Thang
                }
                                            );
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                p.Disconnect();
            }
        }