资源简介
基本的功能:动态菜单,增删改查,窗体间带参数跳转,列表页面跳到update页面,列表跳到add页面,完成add,从新绑定列表页面。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Mycems.Model;
using DAL;
namespace Mycems.DAL
{
public class AdapterService
{
public AdapterService()
{
}
#region 成员方法
///
/// 是否存在该记录
///
public bool Exists(string AdapterNo)
{
SqlParameter[] parameters = {
new SqlParameter(“@AdapterNo“ SqlDbType.Char22)};
parameters[0].Value = AdapterNo;
return new DbaseHelper().Exists(“CheckAdapterNo“ parameters);
}
///
/// 增加一条数据
///
public bool Add(Adapter model)
{
SqlParameter[] parameters = {
new SqlParameter(“@AdapterNo“ SqlDbType.Char22)
new SqlParameter(“@AdapterName“ SqlDbType.NVarChar50)
new SqlParameter(“@AdapterAlias“ SqlDbType.NChar16)
new SqlParameter(“@AdapterType“ SqlDbType.Char20)
new SqlParameter(“@DeviceNo“ SqlDbType.Char20)
new SqlParameter(“@IP“ SqlDbType.Char20)
new SqlParameter(“@Port“ SqlDbType.Int4)};
parameters[0].Value = model.AdapterNo;
parameters[1].Value = model.AdapterName;
parameters[2].Value = model.AdapterAlias;
parameters[3].Value = model.AdapterType;
parameters[4].Value = model.DeviceNo;
parameters[5].Value = model.IP;
parameters[6].Value = model.Port;
if(new DbaseHelper().ExecuteNonQuery(“AddAdapter“ parameters) > 0)
return true;
else
return false;
}
///
/// 更新一条数据
///
public bool Update(Adapter model)
{
SqlParameter[] parameters = {
new SqlParameter(“@AdapterNo“ SqlDbType.Char22)
new SqlParameter(“@AdapterName“ SqlDbType.NVarChar50)
new SqlParameter(“@AdapterAlias“ SqlDbType.NChar16)
new SqlParameter(“@AdapterType“ SqlDbType.Char20)
new SqlParameter(“@DeviceNo“ SqlDbType.Char20)
new SqlParameter(“@IP“ SqlDbType.Char20)
new SqlParameter(“@Port“ SqlDbType.Int4)};
parameters[0].Value = model.AdapterNo;
parameters[1].Value = model.AdapterName;
parameters[2].Value = model.AdapterAlias;
parameters[3].Value = model.AdapterType;
parameters[4].Value = model.DeviceNo;
parameters[5].Value = model.IP;
parameters[6].Value = model.Port;
if(new DbaseHelper().ExecuteNonQuery(“UpdateAdapter“ parameters) > 0)
return true;
else
return false;
}
///
/// 删除一条数据
///
public bool Delete(string AdapterNo)
{
SqlParameter[] parameters = {
new SqlParameter(“@AdapterNos“ SqlDbType.NVarChar150)};
parameters[0].Value = AdapterNo;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3562 2013-01-13 15:28 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunctionPro.sln
..A..H. 75776 2013-04-04 16:09 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunctionPro.suo
文件 3145728 2013-04-04 16:07 Winform程序例子-1-13\WindowsFormsFunctionPro\数据库\CemsMenuTest.mdf
文件 1048576 2013-04-04 16:07 Winform程序例子-1-13\WindowsFormsFunctionPro\数据库\CemsMenuTest_log.ldf
文件 372 2013-01-13 16:42 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Child1.cs
文件 2954 2013-01-13 16:42 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Child1.Designer.cs
文件 5817 2013-01-13 16:42 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Child1.resx
文件 370 2013-01-13 15:35 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Form1.cs
文件 1417 2013-01-13 15:35 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Form1.Designer.cs
文件 5817 2013-01-13 15:35 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Form1.resx
文件 628 2013-01-13 16:43 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\LOGIN.cs
文件 7858 2013-01-13 16:43 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\LOGIN.Designer.cs
文件 5817 2013-01-13 16:43 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\LOGIN.resx
文件 10137 2013-01-13 16:41 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\MDIMenus.cs
文件 3124 2013-01-13 16:19 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\MDIMenus.Designer.cs
文件 6385 2013-01-13 16:19 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\MDIMenus.resx
文件 653 2013-04-04 15:52 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Program.cs
文件 9134 2013-03-16 20:28 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\WindowsFormsFunction.csproj
文件 552 2013-01-15 19:25 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\WindowsFormsFunction.csproj.user
文件 1396 2013-01-13 13:32 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Properties\AssemblyInfo.cs
文件 2890 2013-01-13 13:32 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Properties\Resources.Designer.cs
文件 5612 2013-01-13 13:32 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Properties\Resources.resx
文件 1105 2013-01-13 13:32 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Properties\Settings.Designer.cs
文件 249 2013-01-13 13:32 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\Properties\Settings.settings
文件 4440 2013-01-13 14:36 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6568 2013-04-04 16:06 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 13711 2013-04-04 16:06 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\obj\x86\Debug\ResolveAssemblyReference.cache
文件 180 2013-04-04 16:06 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\obj\x86\Debug\WindowsFormsFunction.Child1.resources
文件 180 2013-04-04 16:06 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\obj\x86\Debug\WindowsFormsFunction.Form1.resources
文件 180 2013-04-04 16:06 Winform程序例子-1-13\WindowsFormsFunctionPro\WindowsFormsFunction\obj\x86\Debug\WindowsFormsFunction.LOGIN.resources
............此处省略106个文件信息
- 上一篇:SQL Server数据库备份与恢复C#代码
- 下一篇:社会保障管理系统
相关资源
- Winform可视化打印模板设计工具含源码
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
评论
共有 条评论