Exemplo n.º 1
0
        /// <summary>
        /// 设置表头定义批量公开
        /// </summary>
        /// <param name="KeyValue">主键值</param>
        /// <param name="MenuId">模块菜单主键</param>
        /// <returns></returns>
        public int BatchIsPublic(string[] KeyValue, string MenuId)
        {
            StringBuilder[]   sqls   = new StringBuilder[KeyValue.Length + 1];
            object[]          objs   = new object[KeyValue.Length + 1];
            BPMS_TableColumns entity = new BPMS_TableColumns();

            entity.MenuId   = MenuId;
            entity.IsPublic = 0;
            sqls[0]         = DbCommon.UpdateSql(entity, "MenuId");
            objs[0]         = DbCommon.GetParameter(entity);
            int index = 1;

            foreach (string item in KeyValue)
            {
                if (item.Length > 0)
                {
                    BPMS_TableColumns entityitem = new BPMS_TableColumns();
                    entityitem.TableColumnsId = item;
                    entityitem.IsPublic       = 1;
                    entityitem.SortCode       = index;
                    sqls[index] = DbCommon.UpdateSql(entityitem, "TableColumnsId");
                    objs[index] = DbCommon.GetParameter(entityitem);
                    index++;
                }
            }
            return(DataFactory.SqlHelper().BatchExecuteBySql(sqls, objs));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public void InitControl()
 {
     if (!string.IsNullOrEmpty(_key))
     {
         bpms_tablecolumns = bpms_tablecolumnsibll.GetEntity(_key);
         ControlBindHelper.SetWebControls(this.Page, bpms_tablecolumns);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="entity">实体类</param>
        /// <returns></returns>
        public int Insert(BPMS_TableColumns entity)
        {
            entity.SortCode = CommonHelper.GetInt(this.GetMaxCode());
            int IsOk = DataFactory.DbUtils().Insert(entity);

            #region 写日操作日志
            if (IsOk > 0)
            {
                BPMS_SysLogDAL.Instance.AddTaskLog <BPMS_TableColumns>(entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName);
            }
            #endregion
            return(IsOk);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public int Update(BPMS_TableColumns entity)
 {
     #region 获取旧值
     var oldEntity = this.GetEntity(BPMS_SysLogDAL.Instance.GetKeyFieldValue <BPMS_TableColumns>(entity).ToString());
     #endregion
     int IsOk = DataFactory.DbUtils().Update(entity, "TableColumnsId");
     #region 写日操作日志
     if (IsOk > 0)
     {
         BPMS_SysLogDAL.Instance.UpdateTaskLog <BPMS_TableColumns>(oldEntity, entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName);
     }
     #endregion
     return(IsOk);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 确认事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Accept_Click(object sender, EventArgs e)
        {
            bool IsOk = false;

            bpms_tablecolumns             = ControlBindHelper.GetWebControls <BPMS_TableColumns>(this.Page);
            bpms_tablecolumns.MenuId      = _Menu_Id;
            bpms_tablecolumns.IsPublic    = IsPublic.Checked ? 1 : 0;
            bpms_tablecolumns.IsHidden    = IsHidden.Checked ? 1 : 0;
            bpms_tablecolumns.Enabled     = Enabled.Checked ? 1 : 0;
            bpms_tablecolumns.AllowEdit   = AllowEdit.Checked ? 1 : 0;
            bpms_tablecolumns.AllowDelete = AllowDelete.Checked ? 1 : 0;
            if (!string.IsNullOrEmpty(_key))//判断是否编辑
            {
                bpms_tablecolumns.TableColumnsId = _key;
                bpms_tablecolumns.ModifyDate     = DateTime.Now;
                bpms_tablecolumns.ModifyUserId   = RequestSession.GetSessionUser().UserId;
                bpms_tablecolumns.ModifyUserName = RequestSession.GetSessionUser().UserName;
                IsOk = bpms_tablecolumnsibll.Update(bpms_tablecolumns);
                if (IsOk)
                {
                    ShowMsgHelper.AlertCallback(MessageHelper.MSG0006);
                }
            }
            else
            {
                bpms_tablecolumns.TableColumnsId = CommonHelper.GetGuid;
                bpms_tablecolumns.CreateUserId   = RequestSession.GetSessionUser().UserId;
                bpms_tablecolumns.CreateUserName = RequestSession.GetSessionUser().UserName;
                IsOk = bpms_tablecolumnsibll.Insert(bpms_tablecolumns);
                if (IsOk)
                {
                    ShowMsgHelper.AlertCallback(MessageHelper.MSG0005);
                }
            }
            if (!IsOk)
            {
                ShowMsgHelper.Alert_Error(MessageHelper.MSG0022);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public bool Update(BPMS_TableColumns entity)
 {
     return(dal.Update(entity) >= 0 ? true : false);
 }
Exemplo n.º 7
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public bool Insert(BPMS_TableColumns entity)
 {
     return(dal.Insert(entity) >= 0 ? true : false);
 }