/// <summary> /// 记录日志到数据库 /// </summary> public static void WriteDepartmentUserLogToDB(int DepartmentID, string Remark, int UpType, int UserID, int UpdateUser) { try { StackTrace st = new StackTrace(true); MethodBase mb = st.GetFrame(1).GetMethod(); string clsString = mb.DeclaringType.FullName; string mName = mb.Name; DepartmentUserLog entity = new DepartmentUserLog(); entity.DepartmentID = DepartmentID; entity.Remark = Remark; entity.UpType = UpType; entity.UserID = UserID; entity.UpdateUser = UpdateUser; entity.RecordIsDelete = false; entity.RecordCreateTime = DateTime.Now; entity.RecordUpdateTime = DateTime.Now; DepartmentUserLogBLL op = new DepartmentUserLogBLL(); op.AddDepartmentUserLog(entity); } catch { } }
{ /// <summary> /// 新增 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddDepartmentUserLog(DepartmentUserLog model) { int result = 0; try { StringBuilder strSql = new StringBuilder(); strSql.Append(@"INSERT INTO [dbo].[DepartmentUserLog] ([DepartmentID],[Remark],[UpType],[UserID],[UpdateUser],[RecordIsDelete],[RecordCreateTime] ,[RecordUpdateTime]) VALUES (@DepartmentID ,@Remark ,@UpType ,@UserID ,@UpdateUser ,@RecordIsDelete ,@RecordCreateTime,@RecordUpdateTime )"); SqlParameter[] parameters = { new SqlParameter("@DepartmentID", model.DepartmentID), new SqlParameter("@Remark", model.Remark), new SqlParameter("@UpType", model.UpType), new SqlParameter("@UserID", model.UserID), new SqlParameter("@UpdateUser", model.UpdateUser), new SqlParameter("@RecordIsDelete", model.RecordIsDelete), new SqlParameter("@RecordCreateTime", model.RecordCreateTime), new SqlParameter("@RecordUpdateTime", model.RecordUpdateTime) }; result = SqlDataUtilityHelper.ExecuteScalar(this.ConnectionString, strSql.ToString(), parameters); } catch (Exception ex) { } return(result); }
private int AddDepartmentUserLog(DepartmentUserLog model) { return(departmentUserLogdal.AddDepartmentUserLog(model)); }