您的位置:首页 > 其它

2015-09-17 001 日志与对话框公用类_public

2015-09-17 10:18 387 查看
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///H_public 的摘要说明
/// </summary>
namespace P_ht
{
public class H_public
{
//
//TODO: 在此处添加构造函数逻辑
//

// 弹出消息对话框
public void msg(string str_msg)
{
ClientScriptManager scriptManager = ((Page)System.Web.HttpContext.Current.Handler).ClientScript;
//scriptManager.RegisterStartupScript(typeof(string), "", "alert(' 提示: 您输入的内容已经存在,请输入其他的内容, \\r\\n 以保证内容的唯一性! ');", true);
scriptManager.RegisterStartupScript(typeof(string), "", "alert('" + str_msg.Trim().ToString() + "');", true);
}

// 写入日志
public static void insert_log(string str_type, string str_title, string str_content, string str_name, string str_time, string str_description)
{
string out_info = string.Empty;
System.Data.Common.DbParameter[] Parameter = new System.Data.Common.DbParameter[7];
System.Data.Common.DbParameter s_type = P_ht.H_data_Helper.ReturnParameters("log_type", System.Data.DbType.String, 50, str_type.Trim().ToString(), System.Data.ParameterDirection.Input);
System.Data.Common.DbParameter s_title = P_ht.H_data_Helper.ReturnParameters("log_title", System.Data.DbType.String, 50, str_title.Trim().ToString(), System.Data.ParameterDirection.Input);
System.Data.Common.DbParameter s_content = P_ht.H_data_Helper.ReturnParameters("log_content", System.Data.DbType.String, 200, str_content.Trim().ToString(), System.Data.ParameterDirection.Input);
System.Data.Common.DbParameter str_create_person = P_ht.H_data_Helper.ReturnParameters("create_person", System.Data.DbType.String, 20, str_name.Trim().ToString(), System.Data.ParameterDirection.Input);
System.Data.Common.DbParameter str_create_date = P_ht.H_data_Helper.ReturnParameters("create_time", System.Data.DbType.String, 50, str_time, System.Data.ParameterDirection.Input);
System.Data.Common.DbParameter str_log_description = P_ht.H_data_Helper.ReturnParameters("log_description", System.Data.DbType.String, 100, str_description, System.Data.ParameterDirection.Input);

System.Data.Common.DbParameter prtReturnValue = P_ht.H_data_Helper.ReturnParameters("ReturnValue", System.Data.DbType.String, 36, "-1", System.Data.ParameterDirection.ReturnValue);

Parameter[0] = s_type;
Parameter[1] = s_title;
Parameter[2] = s_content;
Parameter[3] = str_create_person;
Parameter[4] = str_create_date;
Parameter[5] = str_log_description;
Parameter[6] = prtReturnValue;

System.Data.DataSet ds_t = P_ht.H_data_Helper.ExecuteProcedureReturnDataSet("sp_sys_log_add", Parameter, out out_info);
if (!string.IsNullOrEmpty(out_info))
{
//System.Windows.Forms.MessageBox.Show(out_info);
P_ht.H_public H_public = new P_ht.H_public();
H_public.msg(out_info);
return;
}
}

}
}

///////////////////////////////////////////

P_ht.H_public H_public = new P_ht.H_public();
H_public.msg(" 提示: 您输入的用户编号已经存在, \\r\\n 请输入其他的用户编号! ");
return;

///////////////////////////////////////////

//log
P_ht.H_public.insert_log("系统管理", "用户添加", "添加用户 '" + TextBox2.Text.Trim().ToString() + "' ", Session["login_usesname"].ToString().Trim(), DateTime.Now.ToString(),"");

///////////////////////////////////////////

///////////////////////////////////////////
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: