/// <summary> /// 添加 /// </summary> public int add(role record) { using (qdbEntities myDb = new qdbEntities()) { myDb.role.Add(record); return(myDb.SaveChanges()); } }
/// <summary> /// 添加 /// </summary> public int add(general_workflow_func record) { using (qdbEntities myDb = new qdbEntities()) { myDb.general_workflow_func.Add(record); return(myDb.SaveChanges()); } }
/// <summary> /// 添加 /// </summary> public int add(dict_detail record) { using (qdbEntities myDb = new qdbEntities()) { myDb.dict_detail.Add(record); return(myDb.SaveChanges()); } }
/// <summary> /// 添加 /// </summary> public int add(users_roles record) { using (qdbEntities myDb = new qdbEntities()) { myDb.users_roles.Add(record); return(myDb.SaveChanges()); } }
/// <summary> /// 添加 /// </summary> public int add(user_avatar record) { using (qdbEntities myDb = new qdbEntities()) { myDb.user_avatar.Add(record); return(myDb.SaveChanges()); } }
/// <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()); } }
/// <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()); } }
/// <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()); } }
/// <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()); } }
/// <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()); } }
/// <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()); } }