Exemple #1
0
    /// <summary>
    /// 新增业务日志
    /// </summary>
    /// <param name="LogClass">单据名称</param>
    /// <param name="ApplicationId">业务ID</param>
    /// <param name="LogType">业务名称 新增、审核、退回、提交...</param>
    /// <param name="LogRemark">备注</param>
    /// <param name="UserID">操作人Id</param>
    public static void AddSysBusinessLog(int CompId, string LogClass, string ApplicationId, string LogType, string LogRemark, string UserID)
    {
        try
        {
            Hi.Model.SYS_Users userModel = new Hi.BLL.SYS_Users().GetModel(Convert.ToInt32(UserID));
            if (userModel != null)
            {
                Hi.Model.SYS_SysBusinessLog SysBusinessLogModel = new Hi.Model.SYS_SysBusinessLog();
                SysBusinessLogModel.CompID          = CompId;
                SysBusinessLogModel.LogClass        = LogClass;
                SysBusinessLogModel.ApplicationId   = Convert.ToInt32(ApplicationId);
                SysBusinessLogModel.LogType         = LogType;
                SysBusinessLogModel.OperatePersonId = Convert.ToInt32(UserID);
                SysBusinessLogModel.OperatePerson   = userModel.TrueName == "" ? userModel.UserName : userModel.TrueName;
                SysBusinessLogModel.LogRemark       = LogRemark;
                SysBusinessLogModel.LogTime         = DateTime.Now;
                SysBusinessLogModel.ts = DateTime.Now;

                new Hi.BLL.SYS_SysBusinessLog().Add(SysBusinessLogModel);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.SYS_SysBusinessLog model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.SYS_SysBusinessLog model)
 {
     return(dal.Add(model));
 }
Exemple #4
0
    /// <summary>
    /// 新增业务日志
    /// </summary>
    /// <param name="LogClass">单据名称</param>
    /// <param name="ApplicationId">业务ID</param>
    /// <param name="LogType">业务名称 新增、审核、退回、提交...</param>
    /// <param name="LogRemark">备注</param>
    public static void AddSysBusinessLog(int CompId, string LogClass, string ApplicationId, string LogType, string LogRemark)
    {
        try
        {
            LoginModel AdminUserModel = null;
            if (HttpContext.Current.Session != null)
            {
                AdminUserModel = HttpContext.Current.Session["UserModel"] as LoginModel;//得到登录LoginId
            }

            if (LogType.Equals("订单物流"))
            {
                string strwhere = "CompID=" + CompId + " and ApplicationId=" + ApplicationId + " and LogType='" + LogType + "'";
                List <Hi.Model.SYS_SysBusinessLog> l = new Hi.BLL.SYS_SysBusinessLog().GetList("", strwhere, "");

                if (l != null)
                {
                    if (l.Count > 0)
                    {
                        foreach (Hi.Model.SYS_SysBusinessLog item in l)
                        {
                            item.LogRemark       = LogRemark;
                            item.LogTime         = DateTime.Now;
                            item.OperatePersonId = AdminUserModel.UserID;
                            item.OperatePerson   = AdminUserModel.TrueName == "" ? AdminUserModel.UserName : AdminUserModel.TrueName;
                            item.modifyuser      = AdminUserModel.UserID;
                            new Hi.BLL.SYS_SysBusinessLog().Update(item);
                        }
                    }
                    else
                    {
                        Hi.Model.SYS_SysBusinessLog SysBusinessLogModel = new Hi.Model.SYS_SysBusinessLog();
                        SysBusinessLogModel.CompID          = CompId;
                        SysBusinessLogModel.LogClass        = LogClass;
                        SysBusinessLogModel.ApplicationId   = Convert.ToInt32(ApplicationId);
                        SysBusinessLogModel.LogType         = LogType;
                        SysBusinessLogModel.OperatePersonId = AdminUserModel.UserID;
                        SysBusinessLogModel.OperatePerson   = AdminUserModel.TrueName == "" ? AdminUserModel.UserName : AdminUserModel.TrueName;
                        SysBusinessLogModel.LogRemark       = LogRemark;
                        SysBusinessLogModel.LogTime         = DateTime.Now;
                        SysBusinessLogModel.ts = DateTime.Now;

                        new Hi.BLL.SYS_SysBusinessLog().Add(SysBusinessLogModel);
                    }
                }
            }
            else
            {
                Hi.Model.SYS_SysBusinessLog SysBusinessLogModel = new Hi.Model.SYS_SysBusinessLog();
                SysBusinessLogModel.CompID          = CompId;
                SysBusinessLogModel.LogClass        = LogClass;
                SysBusinessLogModel.ApplicationId   = Convert.ToInt32(ApplicationId);
                SysBusinessLogModel.LogType         = LogType;
                SysBusinessLogModel.OperatePersonId = AdminUserModel.UserID;
                SysBusinessLogModel.OperatePerson   = AdminUserModel.TrueName == "" ? AdminUserModel.UserName : AdminUserModel.TrueName;
                SysBusinessLogModel.LogRemark       = LogRemark;
                SysBusinessLogModel.LogTime         = DateTime.Now;
                SysBusinessLogModel.ts = DateTime.Now;

                new Hi.BLL.SYS_SysBusinessLog().Add(SysBusinessLogModel);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }