frmttype.cs

来自「一个酒店管理系统」· CS 代码 · 共 92 行

CS
92
字号
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 + =
减小字号Ctrl + -
显示快捷键?