GO
/****** 对象: StoredProcedure [dbo].[pro_GenerateTrigger] 脚本日期: 08/13/2012 10:10:16 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_GenerateTrigger]') AND type in (N'P', N'PC'))
GO
/****** 对象: StoredProcedure [dbo].[pro_GenerateTrigger] 脚本日期: 08/13/2012 10:10:16 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_GenerateTrigger]') AND type in (N'P', N'PC'))
.Net 代码:
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
RenderJS();
}
private void RenderJS()
{
if (!Page.ClientScript.IsClientScriptBlockRegistered(SCRIPT_ID))//如果还没有注册语句,则注册
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),SCRIPT_ID,SCRIPT_CONTENT);
}
}
private const string SCRIPT_ID = "5B7A061B93D546A7A2601D56A8738DB9";//自定义标识Guid
private const string SCRIPT_CONTENT = "<script type="text/javascript">
var CB4949501DA_checkDouble = function (data) {
var key = event.keyCode;
if ((key < 48 || key > 57) && key != 46 && key != 45) {
return false;
}
else {
if (key == 46) {
if (data.indexOf(".") != -1 || data.length == 0)
return false;
}
else if (key == 45) {
if (data.indexOf("-") != -1 || data.length != 0) {
return false;
}
}
}
return true;
}
var CB4949501DA_checkInt = function (data) {
var key = event.keyCode;
if ((key < 48 || key > 57) && key != 45) {
return false;
}
else {
if (key == 45) {
if (data.indexOf("-") != -1 || data.length != 0) {
return false;
}
}
else {
var input = String.fromCharCode(key)
var intData = parseInt(data + input);
if (intData > 2147483647 || intData < -2147483648) {
return false;
}
}
return true;
}
return true;
}
var <span style="color:#ff0000;">CB4949501DA_checkLong </span>= function (data) {
var key = event.keyCode;
if ((key < 48 || key > 57) && key != 45) {
return false;
}
else {
if (key == 45) {
if (data.indexOf("-") != -1 || data.length != 0) {
return false;
}
}
else {
var input = String.fromCharCode(key)
var longstrData = data + input
if (longstrData.length > 19) {
return false;
}
}
}
return true;
}
</script>
";using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
namespace Tools.Common
{
/// <summary>
/// 页面验证类
/// </summary>
public class DataValidate
{
private static Regex RegPhone = new Regex(@"^(1d{10})|(d{3,4}[-]d{6,8})$");
/// <summary>
/// 纯数字,无正负号
/// </summary>
private static Regex RegNumber = new Regex("^[0-9]+$");
/// <summary>
/// 纯数字,可能有正负号
/// </summary>
private static Regex RegNumberSign = new Regex("^[+-]?[0-9]+$");
/// <summary>
/// 可能有有小数点的数字
/// </summary>
private static Regex RegDecimal = new Regex(@"^(d+[.]d+)|(d+)$");
/// <summary>
/// 可能有小数点,也有可能有正负号的数字
/// </summary>
private static Regex RegDecimalSign = new Regex(@"^[+-]?((d+[.]d+)|(d+))$"); //等价于^[+-]?d+[.]?d+$
/// <summary>
/// Email地址
/// </summary>
private static Regex RegEmail = new Regex("^[\w-]+@[\w-]+\.(com|net|org|edu|mil|tv|biz|info|com.cn)$");
/// <summary>
/// 是否有中文
/// </summary>
private static Regex RegCHZN = new Regex("[u4e00-u9fa5]");GO
/****** 对象: StoredProcedure [dbo].[pro_GenerateCheckInput_webControl] 脚本日期: 08/13/2012 10:10:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 对象: UserDefinedFunction [dbo].[fun_get_LowerFirst] 脚本日期: 08/04/2012 13:03:56 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fun_get_comment]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
表数据:


.Net winform:
#region 显示多列DataTable到combobox
/// <summary>
/// 显示多列DataTable到combobox
/// </summary>
/// <param name="dataTable">含有超过两列的DataTable</param>
/// <param name="comboBox">combobox控件名</param>
/// <param name="TextColumn">显示的text对应的列</param>
/// <param name="ValueColumn">value值对应的列</param>
/// <param name="isNeedShowEmpty">是否显示‘请选择’</param>
/// <param name="isNeedShowAll">是否显示‘全部’</param>
public static void ToDataTableCombobox(DataTable dataTable, ComboBox comboBox, string TextColumn, string ValueColumn, bool isNeedShowEmpty, bool isNeedShowAll)
{
if (dataTable == null || comboBox == null || dataTable.Columns.Count == 0)
{
return;
}
DataTable dtnew = new DataTable();
dtnew.Columns.Add("text");
dtnew.Columns.Add("value");如果更改Datagridview启用编辑为不选中
protected static void test()
{
//获取程序集
Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();//Assembly.LoadFrom("test.dll");
//获取模块
Module[] modules = assembly.GetModules();
foreach (Module module in modules)
{
Console.WriteLine("module name:" + module.Name);
}
//获取类
Type type = assembly.GetType("Reflect_test.PurchaseOrderHeadManageModel", true, true); //命名空间名称 + 类名
//创建类的实例
object obj = Activator.CreateInstance(type, true);using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Runtime.Remoting.Channels.Http;
using System.Runtime.Remoting.Channels;
using System.Xml;
using System.Runtime.Remoting;
using System.Collections;
namespace Tools
{
/// <summary>
/// Remote自定义操作类,更方便使用
/// </summary>
public class RemoteHelper
{
/// <summary>
/// 服务端注册的端口信息
/// </summary>
public static IDictionary ServerHttpProp = new Hashtable();
/// <summary>
/// 客户端连接服务端的端口
/// </summary>
public static int ClientToServerPort = 8888;
/// <summary>
/// 服务端的http地址
/// </summary>
private string url = "";
#region 单个实例 Instance
private static readonly RemoteHelper instance = new RemoteHelper();
/// <summary>
/// 单个实例 Instance
/// </summary>
public static RemoteHelper Instance
{
get
{
return instance;
}
}
#endregionPowered By Z-BlogPHP 1.7.5
Copyright 2024-2029 pukuimin Rights Reserved.
粤ICP备17100155号-1