public List <DayOffState> GetDayOffStateInfo(string param, DayOffStateGetDataMode mode) { string sql = null; if (DayOffStateGetDataMode.GET_DATA_ALL == mode) { sql = "select * from DayOffState"; } else if (DayOffStateGetDataMode.GET_DATA_BY_ID == mode) { sql = "select * from DayOffState where DayOffStateID = " + param; } else if (DayOffStateGetDataMode.GET_DATA_BY_NAME == mode) { sql = "select * from DayOffState where DayOffStateName = " + "'" + param + "'"; } else { return(null); } SqlDataReader objReader = SqlOperation.GetReader(sql); List <DayOffState> list = CopyDataToListFromSqlReader(objReader); objReader.Close(); return(list); }
public List <SalesLeaveState> GetSalesLeaveStateInfo(string parm, SalesLeaveStateGetDataMode mode) { string sql = null; if (SalesLeaveStateGetDataMode.GET_DATA_MODE_BY_ID == mode) { sql = "select * from SalesLeaveState where SalesLeaveStateID = " + parm; } else if (SalesLeaveStateGetDataMode.GET_DATA_MODE_BY_NAME == mode) { sql = "select * from SalesLeaveState where SalesLeaveStateName = " + "'" + parm + "'"; } else if (SalesLeaveStateGetDataMode.GET_DATA_MODE_ALL == mode) { sql = "select * from SalesLeaveState"; } SqlDataReader objReader = SqlOperation.GetReader(sql); List <SalesLeaveState> list = CopyDataToListFromSqlReader(objReader); objReader.Close(); return(list); }
public List <Department> GetDepartmentByID(string id) { string sql = "select * from Department where DepartmentID = " + id; SqlDataReader objReader = SqlOperation.GetReader(sql); List <Department> list = CopyDataToListFromSqlReader(objReader); objReader.Close(); return(list); }
public List <Department> GetDepartmentAll() { string sql = "select * from Department"; SqlDataReader objReader = SqlOperation.GetReader(sql); List <Department> list = CopyDataToListFromSqlReader(objReader); objReader.Close(); return(list); }
/// <summary> /// 通过部门名称查找对应部门信息接口 /// </summary> /// <param name="name">部门名称</param> /// <returns></returns> public List <Department> GetDepartmentByName(string name) { string sql = "select * from Department where DepartmentName = " + "'" + name + "'"; SqlDataReader objReader = SqlOperation.GetReader(sql); List <Department> list = CopyDataToListFromSqlReader(objReader); objReader.Close(); return(list); }