码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-09-17 11:26:41      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:

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(),"");

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

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

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

标签:

原文地址:http://www.cnblogs.com/hutie1980/p/4815505.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!