public void DelOperType(Model.sa_t_oper_type type) { DB.IDB db = new DB.DBByAutoClose(Appsetting.conn); var oType = db.ExecuteToModel <Model.sa_t_oper_type>("select * from sa_t_oper_type where oper_type = '" + type.oper_type + "'", null); if (oType != null) { if (oType.update_time > type.update_time) { throw new Exception("操作员组[" + type.type_name + "]已被修改"); } var count = Convert.ToInt32(db.ExecuteScalar("select count(*) from sa_t_operator_i where oper_type='" + type.oper_type + "'", null)); if (count > 0) { throw new Exception("组[" + type.type_name + "]存在操作员,不能删除"); } db.ExecuteScalar("delete sa_t_oper_type where oper_type='" + type.oper_type + "' ", null); } else { throw new Exception("操作员组[" + type.type_name + "]不存在"); } }
public void ChangeOperType(Model.sa_t_oper_type type) { DB.IDB db = new DB.DBByAutoClose(Appsetting.conn); var oType = db.ExecuteToModel <Model.sa_t_oper_type>("select * from sa_t_oper_type where oper_type = '" + type.oper_type + "'", null); if (oType != null) { if (oType.update_time > type.update_time) { throw new Exception("操作员组[" + type.type_name + "]已被修改"); } db.Update(type, "oper_type"); } else { throw new Exception("操作员组[" + type.type_name + "]不存在"); } }
public void AddOperType(Model.sa_t_oper_type type) { DB.IDB db = new DB.DBByAutoClose(Appsetting.conn); type.oper_type = GetMaxTypeMode(); db.Insert(type); }