• 大小: 3.93MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-04
  • 语言: C#
  • 标签:

资源简介

c#酒店管理系统源代码 Sql、 数据库希望大家好好评论啊

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace HospitalityManagementSystem
{
    public partial class AddBeautySpot : Form
    {
        public AddBeautySpot()
        {
            InitializeComponent();
        }

        
        private void insert()
        {
            int res = 0;
            SqlConnection conn = SqlData.CreateConn();
            conn.Open();
           // this.txtHid.Text= “select Hid from Hotel where Hname=‘“ + this.comboBox1.SelectedItem + “‘“;
            string str = “insert into Beautyspot (BSidBSnameVisitingdayHid) values (‘“ + this.txtBSid.Text + “‘‘“ + this.txtBSname.Text + “‘‘“ + this.txtvisitingday.Text + “‘‘“ +this.txtHid.Text + “‘)“;
            SqlCommand cmd1 = new SqlCommand(str conn);
            //cmd1.ExecuteNonQuery();
            res = (int)cmd1.ExecuteNonQuery();
            if (res == 1)
            {
                MessageBox.Show(“添加成功“);
            }

            conn.Close();

        }

        private void AddBeautySpot_Load(object sender EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“myDatabaseDataSet1.Beautyspot”中。您可以根据需要移动或移除它。
            //this.beautyspotTableAdapter.Fill(this.myDatabaseDataSet.Beautyspot);
            hotellist();
            BSlist();
        }

        private void BSlist() 
        {
            SqlConnection conn = SqlData.CreateConn();
            conn.Open();
            string str = “select * from Beautyspot“;
            SqlCommand cmd = new SqlCommand(strconn);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds“Beautyspot“);
            this.dataGridView1.DataSource=ds.Tables[“Beautyspot“];
         
        }
        private void hotellist()
        {
            SqlConnection conn = SqlData.CreateConn();
            conn.Open();
            string str = “select Hname from Hotel“;
            SqlCommand cmd1 = new SqlCommand(str conn);
            SqlDataReader dr1 = cmd1.ExecuteReader();
            while (dr1.Read())
            {
                this.comboBox1.Items.Add(dr1[“Hname“].ToString());
            }

            dr1.Close();
            conn.Close();
        }

        private void textBox2_TextChanged(object sender EventArgs e)
        {

        }


        private void button1_Click_1(object sender EventArgs e)
        {
            insert();
            this.BSlist();
        }

        private void comboBox1_SelectedIndexChanged(object sender EventArgs e)
        {

            SqlConnection conn = SqlData.CreateConn();
            conn.Open();
            string str=“select Hid from Hotel where Hname=‘“ + this.comboBox1.SelectedItem + “‘“;
            this.txtHid.Text = str;
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3197  2009-12-23 12:43  HospitalityManagementSystem\HospitalityManagementSystem\AddBeautySpot.cs

     文件       8906  2009-12-23 12:43  HospitalityManagementSystem\HospitalityManagementSystem\AddBeautySpot.Designer.cs

     文件       5814  2009-12-23 12:43  HospitalityManagementSystem\HospitalityManagementSystem\AddBeautySpot.resx

     文件       6933  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddCustomer.cs

     文件      20026  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddCustomer.Designer.cs

     文件       6438  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddCustomer.resx

     文件        503  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddEmployee.cs

     文件       7424  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddEmployee.Designer.cs

     文件       5814  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddEmployee.resx

     文件        497  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddHotel.cs

     文件       7505  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddHotel.Designer.cs

     文件       5814  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\AddHotel.resx

     文件        495  2009-12-23 13:06  HospitalityManagementSystem\HospitalityManagementSystem\AddTeam.cs

     文件       7505  2009-12-23 13:06  HospitalityManagementSystem\HospitalityManagementSystem\AddTeam.Designer.cs

     文件       5814  2009-12-23 13:06  HospitalityManagementSystem\HospitalityManagementSystem\AddTeam.resx

     文件        471  2009-12-05 15:49  HospitalityManagementSystem\HospitalityManagementSystem\app.config

     文件     526336  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\HospitalityManagementSystem.exe

     文件        471  2009-12-05 15:49  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\HospitalityManagementSystem.exe.config

     文件     140800  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\HospitalityManagementSystem.pdb

     文件      14328  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\HospitalityManagementSystem.vshost.exe

     文件        471  2009-12-05 15:49  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\HospitalityManagementSystem.vshost.exe.config

     文件        490  2007-07-21 01:33  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\HospitalityManagementSystem.vshost.exe.manifest

     文件    2293760  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\MyDatabase.mdf

     文件     573440  2009-12-23 12:45  HospitalityManagementSystem\HospitalityManagementSystem\bin\Debug\MyDatabase_log.ldf

     文件        772  2009-10-11 15:55  HospitalityManagementSystem\HospitalityManagementSystem\Form1.cs

     文件       6798  2009-10-11 15:55  HospitalityManagementSystem\HospitalityManagementSystem\Form1.Designer.cs

     文件     267566  2009-10-11 15:55  HospitalityManagementSystem\HospitalityManagementSystem\Form1.resx

     文件       8837  2009-12-22 19:11  HospitalityManagementSystem\HospitalityManagementSystem\HospitalityManagementSystem.csproj

     文件        486  2009-12-05 17:43  HospitalityManagementSystem\HospitalityManagementSystem\HospitalityManagementSystem.csproj.user

     文件       1425  2009-12-23 12:40  HospitalityManagementSystem\HospitalityManagementSystem\MainForm.cs

............此处省略49个文件信息

评论

共有 条评论