⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmttype.cs

📁 一个酒店管理系统
💻 CS
字号:
using System;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

namespace bggl.cs
{
	/// <summary>
	/// frmTtype 的摘要说明。
	/// </summary>
	public class frmTtype
	{
        conn.conn tianchong=new bggl.conn.conn();
		 DataSet objset=new DataSet();
		public frmTtype()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public bool addtype(string type,string shu)   //添加
		{
			try
			{
				string str=null;
				str="insert into BG_CTtype values('"+type+"','"+shu+"')";
				tianchong.execomm(str);				
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			return true;
		}
		public DataSet seltype()    //查询
		{
			try
			{
				objset=tianchong.selectexe("select * from BG_CTtype","BG_CTtype");
			}
			catch(SqlException ex)
			{
				MessageBox.Show(ex.Message);
			}
			return objset;
		}
		public bool deltype(string type)
		{
			try
			{
				string str=null;
				str="delete from BG_CTtype where CTqy like '"+type+"'";
				tianchong.execomm(str);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			return true;
		}
		public DataSet cttype()
		{
			try
			{
			   string str=null;
				str="select distinct CTzs from BG_CTtype";
				objset=tianchong.selectexe(str,"BG_CTtype");
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			return objset;

		}
		public bool uptype(int id,string ctqy,string ctzs)
		{
			try
			{
			   string str=null;
				str="update BG_CTtype set CTqy='"+ctqy+"',CTzs='"+ctzs+"' where CTid="+id+"";
				tianchong.execomm(str);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			return true;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -