Beispiel #1
0
 /// <summary>
 /// 设置表头定义批量公开
 /// </summary>
 /// <param name="KeyValue">主键值</param>
 /// <param name="MenuId">模块菜单主键</param>
 /// <returns></returns>
 public bool BatchIsPublic(string[] KeyValue, string MenuId)
 {
     //return dal.BatchIsPublic(KeyValue, MenuId) >= 0 ? true : false;
     StringBuilder[] sqls = new StringBuilder[KeyValue.Length + 1];
     object[] objs = new object[KeyValue.Length + 1];
     AMS_TableColumns entity = new AMS_TableColumns();
     entity.MenuId = MenuId;
     entity.IsPublic = 0;
     sqls[0] = SqlParamHelper.UpdateSql(entity, "MenuId");
     objs[0] = SqlParamHelper.GetParameter(entity);
     int index = 1;
     foreach (string item in KeyValue)
     {
         if (item.Length > 0)
         {
             AMS_TableColumns entityitem = new AMS_TableColumns();
             entityitem.TableColumnsId = item;
             entityitem.IsPublic = 1;
             entityitem.SortCode = index;
             sqls[index] = SqlParamHelper.UpdateSql(entityitem, "TableColumnsId");
             objs[index] = SqlParamHelper.GetParameter(entityitem);
             index++;
         }
     }
     int IsOK = DbHelper.BatchExecuteBySql(sqls, objs);
     return IsOK >= 0 ? true : false;
 }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public bool Update(AMS_TableColumns entity)
 {
     //return dal.Update(entity) >= 0 ? true : false;
     #region 获取旧值
     var oldEntity = this.GetEntity(AMS_SysLogBLL.Instance.GetKeyFieldValue<AMS_TableColumns>(entity).ToString());
     #endregion
     int IsOk = DbUtils.Update(entity, "TableColumnsId");
     #region 写日操作日志
     if (IsOk > 0)
     {
         AMS_SysLogBLL.Instance.UpdateTaskLog<AMS_TableColumns>(oldEntity, entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName);
     }
     #endregion
     return IsOk >= 0 ? true : false;
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public bool Insert(AMS_TableColumns entity)
 {
     //return dal.Insert(entity) >= 0 ? true : false;
     entity.SortCode = CommonHelper.GetInt(this.GetMaxCode());
     int IsOk = DbUtils.Insert(entity);
     #region 写日操作日志
     if (IsOk > 0)
     {
         AMS_SysLogBLL.Instance.AddTaskLog<AMS_TableColumns>(entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName);
     }
     #endregion
     return IsOk >= 0 ? true : false;
 }