zoukankan      html  css  js  c++  java
  • 2015-09-17 001 日志与对话框公用类_public

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

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

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

  • 相关阅读:
    js 获取当前时间
    html5拨打电话及发短信
    ::before和::after伪元素的使用
    vue单页面应用刷新网页后vuex的state数据丢失问题以及beforeunload的兼容性
    CSS3径向渐变实现优惠券波浪造型
    iOS 幻灯片的自动循环滚动
    iOS 编译正常,但无法运行到真机和模拟器上,Choose a destination with a supported architecture in order to run on this device.
    iOS webView抓取改变js的alertView
    iOS 创建单例的方法
    webView图片点击可以实现预览效果
  • 原文地址:https://www.cnblogs.com/hutie1980/p/4815505.html
Copyright © 2011-2022 走看看