Esempio n. 1
0
 /// <summary>
 /// 更新
 /// </summary>
 public int updateById(role record)
 {
     using (qdbEntities myDb = new qdbEntities())
     {
         myDb.role.Attach(record);
         myDb.Entry(record).State = EntityState.Modified;
         return(myDb.SaveChanges());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 更新
 /// </summary>
 public int updateById(general_workflow_func record)
 {
     using (qdbEntities myDb = new qdbEntities())
     {
         myDb.general_workflow_func.Attach(record);
         myDb.Entry(record).State = EntityState.Modified;
         return(myDb.SaveChanges());
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 删除
 /// </summary>
 public int deleteById(int id, int deptid)
 {
     using (qdbEntities myDb = new qdbEntities())
     {
         // TODO 生成代码后需要检查一下是否找到正确的主键,这里做一个错误代码,避免直接使用
         roles_depts record = new roles_depts()
         {
             ROLE_ID = id, DEPT_ID = deptid
         };
         myDb.roles_depts.Attach(record);
         myDb.Entry(record).State = EntityState.Deleted;
         return(myDb.SaveChanges());
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 删除
        /// </summary>
        public int deleteById(int id)
        {
            using (qdbEntities myDb = new qdbEntities())
            {
                // TODO 生成代码后需要检查一下是否找到正确的主键,这里做一个错误代码,避免直接使用
                general_workflow_func record = new general_workflow_func()
                {
                    ORIGREC = id
                };

                myDb.general_workflow_func.Attach(record);
                myDb.Entry(record).State = EntityState.Deleted;
                return(myDb.SaveChanges());
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 删除
        /// </summary>
        public int deleteById(int id)
        {
            using (qdbEntities myDb = new qdbEntities())
            {
                // TODO 生成代码后需要检查一下是否找到正确的主键,这里做一个错误代码,避免直接使用
                dict_detail record = new dict_detail()
                {
                    ID = id
                };

                myDb.dict_detail.Attach(record);
                myDb.Entry(record).State = EntityState.Deleted;
                return(myDb.SaveChanges());
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 删除
        /// </summary>
        public int deleteById(int id, int roleid)
        {
            using (qdbEntities myDb = new qdbEntities())
            {
                // TODO 生成代码后需要检查一下是否找到正确的主键,这里做一个错误代码,避免直接使用
                users_roles record = new users_roles()
                {
                    USER_ID = id, ROLE_ID = roleid
                };

                myDb.users_roles.Attach(record);
                myDb.Entry(record).State = EntityState.Deleted;
                return(myDb.SaveChanges());
            }
        }