示例#1
0
 /// <summary>
 /// 添加日志方法
 /// </summary>
 /// <param name="typeId">日志类型编号</param>
 /// <param name="logMessge">日志内容</param>
 /// <param name="billTag">单据标示</param>
 public static void AddLog(LogType typeId, string logMessge, string billTag, EDRS.Model.XT_ZZJG_RYBM UserInfo, List <EDRS.Model.XT_QX_JSBM> UserRole, HttpRequest req)
 {
     try
     {
         EDRS.Model.YX_DZJZ_JZRZJL entity = new EDRS.Model.YX_DZJZ_JZRZJL();
         EDRS.BLL.YX_DZJZ_JZRZJL   rzBll  = new EDRS.BLL.YX_DZJZ_JZRZJL(req);
         entity.CZLX = ((int)typeId).ToString();
         if (UserInfo != null)
         {
             entity.DWBM  = UserInfo.DWBM;
             entity.DWMC  = UserInfo.DWMC;
             entity.CZRGH = UserInfo.GH;
             entity.CZR   = UserInfo.MC;
         }
         if (UserRole != null && UserRole.Count > 0)
         {
             entity.BMBM = UserRole[0].BMBM;
             entity.BMMC = UserRole[0].BMMC;
         }
         entity.RZNR      = logMessge;
         entity.CZAJBMSAH = billTag == null ? "" : billTag;
         rzBll.Add(entity);
     }
     catch (Exception)
     {
     }
 }
示例#2
0
    /// <summary>
    /// 验证用户是否登录
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void Page_Load(object sender, EventArgs e)
    {
        if (Session["user"] == null)
        {
            System.Web.Security.FormsAuthentication.SignOut();
            Session.Clear();
            Session.Abandon();
            Response.Clear();

            if (Request.Form.Count == 0)//window.alert('账号未登录,请进入登录页面!');
            {
                Response.Write("<script defer>window.alert('账号未登录,请进入登录页面!');parent.parent.location='/Login.aspx';</script>");
            }
            else
            {
                Response.Write(ReturnString.JsonToString(Prompt.error, "登录超时,请刷新页面重新登录fn=parent.skip", null));
            }
            Response.End();
        }
        else
        {
            if (this.UserInfo == null)
            {
                this.userInfo = Session["user"] as EDRS.Model.XT_ZZJG_RYBM;
            }
            if (this.UserDwbm == null)
            {
                this.userDwbm = Session["userDwbm"] as EDRS.Model.XT_ZZJG_DWBM;
            }
            if (this.UserRole == null)
            {
                this.userRole = Session["userRole"] as List <EDRS.Model.XT_QX_JSBM>;
            }

            if (this.UserInfo != null)
            {
                if (!GetRole(userInfo.DWBM, userInfo.GH))
                {
                    Response.Write("您没有权限访问该功能!");
                    Response.End();
                    return;
                }
            }

            if (this.UserRole != null)
            {
                string jsbms = "";
                string bmbms = "";
                for (int i = 0; i < UserRole.Count; i++)
                {
                    jsbms += "'" + UserRole[i].JSBM + "'";
                    bmbms += "'" + UserRole[i].BMBM + "'";

                    if (i < UserRole.Count - 1)
                    {
                        jsbms += ",";
                        bmbms += ",";
                    }
                }
                this.jsbms = jsbms;
                this.bmbms = bmbms;
            }
            //TODO: 页面权限判断
        }
    }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(EDRS.Model.XT_ZZJG_RYBM model)
 {
     return(dal.Update(model));
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(EDRS.Model.XT_ZZJG_RYBM model)
 {
     return(dal.Add(model));
 }
示例#5
0
    /// <summary>
    /// 添加日志方法
    /// </summary>
    /// <param name="typeId">日志类型编号</param>
    /// <param name="logMessge">日志内容</param>
    /// <param name="billTag">单据标示</param>
    public static void AddLogList(LogType typeId, string logMessge, string[] billTag, EDRS.Model.XT_ZZJG_RYBM UserInfo, List <EDRS.Model.XT_QX_JSBM> UserRole, HttpRequest req)
    {
        try
        {
            List <EDRS.Model.YX_DZJZ_JZRZJL> entityList = new List <EDRS.Model.YX_DZJZ_JZRZJL>();
            EDRS.BLL.YX_DZJZ_JZRZJL          rzBll      = new EDRS.BLL.YX_DZJZ_JZRZJL(req);

            for (int i = 0; i < billTag.Length; i++)
            {
                EDRS.Model.YX_DZJZ_JZRZJL entity = new EDRS.Model.YX_DZJZ_JZRZJL();
                entity.CZSJ = DateTime.Now;
                //代理IP
                entity.CZIP = req.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (string.IsNullOrEmpty(entity.CZIP))
                {
                    //真实IP
                    entity.CZIP = req.ServerVariables["REMOTE_ADDR"];
                }
                entity.CZLX = ((int)typeId).ToString();
                if (UserInfo != null)
                {
                    entity.DWBM  = UserInfo.DWBM;
                    entity.DWMC  = UserInfo.DWMC;
                    entity.CZRGH = UserInfo.GH;
                    entity.CZR   = UserInfo.MC;
                }
                if (UserRole != null && UserRole.Count > 0)
                {
                    entity.BMBM = UserRole[0].BMBM;
                    entity.BMMC = UserRole[0].BMMC;
                }
                entity.RZNR      = logMessge;
                entity.CZAJBMSAH = billTag[i];
                entityList.Add(entity);
            }

            rzBll.AddByModelList(entityList);
        }
        catch (Exception)
        {
        }
    }
示例#6
0
 public static void AddLog(LogType typeId, string logMessge, EDRS.Model.XT_ZZJG_RYBM UserInfo, List <EDRS.Model.XT_QX_JSBM> UserRole, HttpRequest req)
 {
     AddLog(typeId, logMessge, "", UserInfo, UserRole, req);
 }