// Gets the viewing id based on other information to search by public static int GetViewingId(string moviename, string customername, string categoryname, DateTime viewedon) { string sql = SqlProcedures.GetViewingsOnDateWithId(moviename, customername, categoryname, viewedon); DataTable temp = Call(sql); if (temp.Rows.Count > 0) { int id; int.TryParse(temp.Rows[0][0].ToString(), out id); return(id); } else { return(-1); } }