public List <ResidentRollCallFileLog> GetImportFiles(string month, string year) { string str = month + "_" + year; DataTable dt = dbc.GetDataTable("SELECT * FROM ResidentRollCallImportLog Where FileName like '%" + str + "%'"); List <ResidentRollCallFileLog> list = new List <ResidentRollCallFileLog>(); foreach (DataRow dr in dt.Rows) { ResidentRollCallFileLog log = new ResidentRollCallFileLog { ResidentRollCallImportId = (int)dr["ResidentRollCallImportId"], FileLocation = dr["FileLocation"].ToString(), FileName = dr["FileName"].ToString() }; list.Add(log); } return(list); }
public void RemoveFile(ResidentRollCallFileLog file) { string sql = "DELETE FROM ResidentRollCallImportLog WHERE ResidentRollCallImportId=" + file.ResidentRollCallImportId; dbc.ExecuteCommand(sql); }