/// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Delete(BaseEntity p_Entity)
        {
            try
            {
                AuthGrpWinListSub MasterEntity = (AuthGrpWinListSub)p_Entity;
                if (MasterEntity.AuthGrpID == 0)
                {
                    return(0);
                }

                //删除主表数据
                string Sql = "";
                Sql = "DELETE FROM Data_AuthGrpWinListSub WHERE " + "AuthGrpID=" + SysString.ToDBString(MasterEntity.AuthGrpID) + " AND WinListSubID=" + SysString.ToDBString(MasterEntity.WinListSubID) + " AND HeadTypeID=" + SysString.ToDBString(MasterEntity.HeadTypeID) + " AND SubTypeID=" + SysString.ToDBString(MasterEntity.SubTypeID);
                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(Sql);
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(Sql);
                }

                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E);
            }
        }
Exemple #2
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private AuthGrpWinListSub[] GetEntityWinListSub()
        {
            ArrayList al = new ArrayList();

            this.GetEntityWinListSub(al, treeList1.Nodes);
            AuthGrpWinListSub[] entity = new AuthGrpWinListSub[al.Count];
            for (int i = 0; i < al.Count; i++)
            {
                entity[i] = (AuthGrpWinListSub)al[i];
            }
            return(entity);
        }
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                AuthGrpWinListSub MasterEntity = (AuthGrpWinListSub)p_Entity;
                if (MasterEntity.AuthGrpID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Data_AuthGrpWinListSub(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("AuthGrpID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.AuthGrpID) + ",");
                MasterField.Append("WinListSubID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.WinListSubID) + ",");
                MasterField.Append("HeadTypeID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.HeadTypeID) + ",");
                MasterField.Append("SubTypeID" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.SubTypeID) + ")");



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
Exemple #4
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="p_BE">要删除的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RDelete(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         AuthGrpWinListSub    entity  = (AuthGrpWinListSub)p_BE;
         AuthGrpWinListSubCtl control = new AuthGrpWinListSubCtl(sqlTrans);
         control.Delete(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                AuthGrpWinListSub MasterEntity = (AuthGrpWinListSub)p_Entity;
                if (MasterEntity.AuthGrpID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Data_AuthGrpWinListSub SET ");
                UpdateBuilder.Append(" AuthGrpID=" + SysString.ToDBString(MasterEntity.AuthGrpID) + ",");
                UpdateBuilder.Append(" WinListSubID=" + SysString.ToDBString(MasterEntity.WinListSubID) + ",");
                UpdateBuilder.Append(" HeadTypeID=" + SysString.ToDBString(MasterEntity.HeadTypeID) + ",");
                UpdateBuilder.Append(" SubTypeID=" + SysString.ToDBString(MasterEntity.SubTypeID));

                UpdateBuilder.Append(" WHERE " + "AuthGrpID=" + SysString.ToDBString(MasterEntity.AuthGrpID) + " AND WinListSubID=" + SysString.ToDBString(MasterEntity.WinListSubID) + " AND HeadTypeID=" + SysString.ToDBString(MasterEntity.HeadTypeID) + " AND SubTypeID=" + SysString.ToDBString(MasterEntity.SubTypeID));



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E);
            }
        }
Exemple #6
0
 /// <summary>
 /// 新增(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         AuthGrpWinListSub    entity  = (AuthGrpWinListSub)p_BE;
         AuthGrpWinListSubCtl control = new AuthGrpWinListSubCtl(sqlTrans);
         //entity.ID=(int)EntityIDTable.GetID((long)SysEntity.Data_AuthGrpWinListSub,sqlTrans);
         control.AddNew(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Exemple #7
0
        /// <summary>
        /// 获得ArrayList
        /// </summary>
        /// <param name="p_Al">ArrayList</param>
        /// <param name="p_Nodes">节点数组</param>
        /// <returns></returns>
        private void GetEntityWinListSub(ArrayList p_Al, TreeListNodes p_Nodes)
        {
            for (int i = 0; i < p_Nodes.Count; i++)
            {
                if (((CheckState)p_Nodes[i].Tag == CheckState.Checked || (CheckState)p_Nodes[i].Tag == CheckState.Indeterminate))
                {
                    if (SysConvert.ToString(p_Nodes[i].GetValue("MenuID")) == string.Empty)//无菜单ID
                    {
                        AuthGrpWinListSub entity = new AuthGrpWinListSub();
                        entity.AuthGrpID    = SysConvert.ToInt32(txtID.Text.Trim());
                        entity.WinListSubID = SysConvert.ToInt32(p_Nodes[i].GetValue("ID"));
                        entity.HeadTypeID   = SysConvert.ToInt32(p_Nodes[i].GetValue("HeadTypeID"));
                        entity.SubTypeID    = SysConvert.ToInt32(p_Nodes[i].GetValue("SubTypeID"));
                        p_Al.Add(entity);
                    }
                }

                GetEntityWinListSub(p_Al, p_Nodes[i].Nodes);
            }
        }
Exemple #8
0
 /// <summary>
 /// 检查将要操作的数据是否符合业务规则
 /// </summary>
 /// <param name="p_BE"></param>
 private void CheckCorrect(BaseEntity p_BE)
 {
     AuthGrpWinListSub entity = (AuthGrpWinListSub)p_BE;
 }